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:
parent
94806c98bf
commit
ea696ae4b1
@ -119,7 +119,6 @@ struct _CoglContext
|
|||||||
|
|
||||||
GString *codegen_header_buffer;
|
GString *codegen_header_buffer;
|
||||||
GString *codegen_source_buffer;
|
GString *codegen_source_buffer;
|
||||||
GString *codegen_boilerplate_buffer;
|
|
||||||
|
|
||||||
CoglPipelineCache *pipeline_cache;
|
CoglPipelineCache *pipeline_cache;
|
||||||
|
|
||||||
|
@ -284,7 +284,6 @@ cogl_context_new (CoglDisplay *display,
|
|||||||
|
|
||||||
context->codegen_header_buffer = g_string_new ("");
|
context->codegen_header_buffer = g_string_new ("");
|
||||||
context->codegen_source_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;
|
context->default_gl_texture_2d_tex = NULL;
|
||||||
|
|
||||||
|
@ -217,6 +217,7 @@ _cogl_glsl_shader_set_source_with_boilerplate (CoglContext *ctx,
|
|||||||
g_autofree char *version_string = NULL;
|
g_autofree char *version_string = NULL;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int n_layers;
|
int n_layers;
|
||||||
|
g_autoptr (GString) layer_declarations = NULL;
|
||||||
|
|
||||||
vertex_boilerplate = _COGL_VERTEX_SHADER_BOILERPLATE;
|
vertex_boilerplate = _COGL_VERTEX_SHADER_BOILERPLATE;
|
||||||
fragment_boilerplate = _COGL_FRAGMENT_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);
|
n_layers = cogl_pipeline_get_n_layers (pipeline);
|
||||||
if (n_layers)
|
if (n_layers)
|
||||||
{
|
{
|
||||||
GString *layer_declarations = ctx->codegen_boilerplate_buffer;
|
layer_declarations = g_string_new ("");
|
||||||
g_string_set_size (layer_declarations, 0);
|
|
||||||
|
|
||||||
g_string_append_printf (layer_declarations,
|
g_string_append_printf (layer_declarations,
|
||||||
"varying vec4 _cogl_tex_coord[%d];\n",
|
"varying vec4 _cogl_tex_coord[%d];\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user