gpu: verbose-print if shaders are inside merged ops

This is useful when trying to get more ops merged for performance
reasons.
This commit is contained in:
Benjamin Otte 2024-09-05 21:42:11 +02:00
parent 748acaf654
commit a8748598b6
3 changed files with 11 additions and 3 deletions

View File

@ -15,10 +15,17 @@ gsk_gpu_print_indent (GString *string,
void void
gsk_gpu_print_shader_flags (GString *string, gsk_gpu_print_shader_flags (GString *string,
GskGpuShaderFlags flags) GskGpuShaderFlags flags,
gboolean first)
{ {
GskGpuShaderClip clip = gsk_gpu_shader_flags_get_clip (flags); GskGpuShaderClip clip = gsk_gpu_shader_flags_get_clip (flags);
g_string_append (string, first ? "+ " : "| ");
#if 0
g_string_append (string, first ? (last ? "" : "")
: (last ? "" : ""));
#endif
switch (clip) switch (clip)
{ {
case GSK_GPU_SHADER_CLIP_NONE: case GSK_GPU_SHADER_CLIP_NONE:

View File

@ -18,7 +18,8 @@ void gsk_gpu_print_newline (GString
void gsk_gpu_print_string (GString *string, void gsk_gpu_print_string (GString *string,
const char *s); const char *s);
void gsk_gpu_print_shader_flags (GString *string, void gsk_gpu_print_shader_flags (GString *string,
GskGpuShaderFlags flags); GskGpuShaderFlags flags,
gboolean first);
void gsk_gpu_print_color_states (GString *string, void gsk_gpu_print_color_states (GString *string,
GskGpuColorStates color_states); GskGpuColorStates color_states);
void gsk_gpu_print_enum (GString *string, void gsk_gpu_print_enum (GString *string,

View File

@ -52,7 +52,7 @@ gsk_gpu_shader_op_print (GskGpuOp *op,
for (i = 0; i < self->n_ops; i++) for (i = 0; i < self->n_ops; i++)
{ {
gsk_gpu_print_op (string, indent, shader_name); gsk_gpu_print_op (string, indent, shader_name);
gsk_gpu_print_shader_flags (string, self->flags); gsk_gpu_print_shader_flags (string, self->flags, i == 0);
gsk_gpu_print_color_states (string, self->color_states); gsk_gpu_print_color_states (string, self->color_states);
shader_class->print_instance (self, shader_class->print_instance (self,
instance + i * shader_class->vertex_size, instance + i * shader_class->vertex_size,