gl renderer: Move texture labeling below initialization

Apparently genTextures and friends only "reserves names", initializing
them will actually create them. Using glObjectLabel on textures before
initializing them will throw a GL_INVALID_VALUE error.
This commit is contained in:
Timm Bäder 2019-04-27 09:50:21 +02:00
parent 6f3e608331
commit 931b0b3752
2 changed files with 10 additions and 9 deletions

View File

@ -535,8 +535,6 @@ gsk_gl_driver_get_texture_for_texture (GskGLDriver *self,
} }
t = create_texture (self, gdk_texture_get_width (texture), gdk_texture_get_height (texture)); t = create_texture (self, gdk_texture_get_width (texture), gdk_texture_get_height (texture));
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, t->texture_id,
"GdkTexture<%p> %d", texture, t->texture_id);
if (gdk_texture_set_render_data (texture, self, t, gsk_gl_driver_release_texture)) if (gdk_texture_set_render_data (texture, self, t, gsk_gl_driver_release_texture))
t->user = texture; t->user = texture;
@ -547,6 +545,9 @@ gsk_gl_driver_get_texture_for_texture (GskGLDriver *self,
surface, surface,
min_filter, min_filter,
mag_filter); mag_filter);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, t->texture_id,
"GdkTexture<%p> %d", texture, t->texture_id);
cairo_surface_destroy (surface); cairo_surface_destroy (surface);
return t->texture_id; return t->texture_id;

View File

@ -479,14 +479,14 @@ render_fallback_node (GskGLRenderer *self,
texture_id = gsk_gl_driver_create_texture (self->gl_driver, texture_id = gsk_gl_driver_create_texture (self->gl_driver,
surface_width, surface_width,
surface_height); surface_height);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, texture_id,
"Fallback %s %d", node->node_class->type_name, texture_id);
gsk_gl_driver_bind_source_texture (self->gl_driver, texture_id); gsk_gl_driver_bind_source_texture (self->gl_driver, texture_id);
gsk_gl_driver_init_texture_with_surface (self->gl_driver, gsk_gl_driver_init_texture_with_surface (self->gl_driver,
texture_id, texture_id,
surface, surface,
GL_NEAREST, GL_NEAREST); GL_NEAREST, GL_NEAREST);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, texture_id,
"Fallback %s %d", node->node_class->type_name, texture_id);
cairo_surface_destroy (surface); cairo_surface_destroy (surface);
@ -1431,10 +1431,10 @@ render_outset_shadow_node (GskGLRenderer *self,
GskRoundedRect blit_clip; GskRoundedRect blit_clip;
texture_id = gsk_gl_driver_create_texture (self->gl_driver, texture_width, texture_height); texture_id = gsk_gl_driver_create_texture (self->gl_driver, texture_width, texture_height);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, texture_id,
"Outset Shadow Temp %d", texture_id);
gsk_gl_driver_bind_source_texture (self->gl_driver, texture_id); gsk_gl_driver_bind_source_texture (self->gl_driver, texture_id);
gsk_gl_driver_init_texture_empty (self->gl_driver, texture_id); gsk_gl_driver_init_texture_empty (self->gl_driver, texture_id);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, texture_id,
"Outset Shadow Temp %d", texture_id);
render_target = gsk_gl_driver_create_render_target (self->gl_driver, texture_id, FALSE, FALSE); render_target = gsk_gl_driver_create_render_target (self->gl_driver, texture_id, FALSE, FALSE);
gdk_gl_context_label_object_printf (self->gl_context, GL_FRAMEBUFFER, render_target, gdk_gl_context_label_object_printf (self->gl_context, GL_FRAMEBUFFER, render_target,
"Outset Shadow FB Temp %d", render_target); "Outset Shadow FB Temp %d", render_target);
@ -1468,10 +1468,10 @@ render_outset_shadow_node (GskGLRenderer *self,
}); });
blurred_texture_id = gsk_gl_driver_create_permanent_texture (self->gl_driver, texture_width, texture_height); blurred_texture_id = gsk_gl_driver_create_permanent_texture (self->gl_driver, texture_width, texture_height);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, blurred_texture_id,
"Outset Shadow Cache %d", blurred_texture_id);
gsk_gl_driver_bind_source_texture (self->gl_driver, blurred_texture_id); gsk_gl_driver_bind_source_texture (self->gl_driver, blurred_texture_id);
gsk_gl_driver_init_texture_empty (self->gl_driver, blurred_texture_id); gsk_gl_driver_init_texture_empty (self->gl_driver, blurred_texture_id);
gdk_gl_context_label_object_printf (self->gl_context, GL_TEXTURE, blurred_texture_id,
"Outset Shadow Cache %d", blurred_texture_id);
blurred_render_target = gsk_gl_driver_create_render_target (self->gl_driver, blurred_texture_id, TRUE, TRUE); blurred_render_target = gsk_gl_driver_create_render_target (self->gl_driver, blurred_texture_id, TRUE, TRUE);
gdk_gl_context_label_object_printf (self->gl_context, GL_FRAMEBUFFER, render_target, gdk_gl_context_label_object_printf (self->gl_context, GL_FRAMEBUFFER, render_target,
"Outset Shadow Cache FB %d", render_target); "Outset Shadow Cache FB %d", render_target);