1
0
Fork 0

cogl: Repace codegen_boilerplate_buffer with a local variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
This commit is contained in:
Sebastian Wick 2024-07-30 12:46:17 +02:00 committed by Marge Bot
parent 94806c98bf
commit ea696ae4b1
3 changed files with 2 additions and 4 deletions

View file

@ -119,7 +119,6 @@ struct _CoglContext
GString *codegen_header_buffer;
GString *codegen_source_buffer;
GString *codegen_boilerplate_buffer;
CoglPipelineCache *pipeline_cache;

View file

@ -284,7 +284,6 @@ cogl_context_new (CoglDisplay *display,
context->codegen_header_buffer = g_string_new ("");
context->codegen_source_buffer = g_string_new ("");
context->codegen_boilerplate_buffer = g_string_new ("");
context->default_gl_texture_2d_tex = NULL;

View file

@ -217,6 +217,7 @@ _cogl_glsl_shader_set_source_with_boilerplate (CoglContext *ctx,
g_autofree char *version_string = NULL;
int count = 0;
int n_layers;
g_autoptr (GString) layer_declarations = NULL;
vertex_boilerplate = _COGL_VERTEX_SHADER_BOILERPLATE;
fragment_boilerplate = _COGL_FRAGMENT_SHADER_BOILERPLATE;
@ -249,8 +250,7 @@ _cogl_glsl_shader_set_source_with_boilerplate (CoglContext *ctx,
n_layers = cogl_pipeline_get_n_layers (pipeline);
if (n_layers)
{
GString *layer_declarations = ctx->codegen_boilerplate_buffer;
g_string_set_size (layer_declarations, 0);
layer_declarations = g_string_new ("");
g_string_append_printf (layer_declarations,
"varying vec4 _cogl_tex_coord[%d];\n",