From 17d689f79480f9d08c1ef8e62b990db0cdb6a36d Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 2 Dec 2010 18:05:22 +0000 Subject: [PATCH] cogl-pipeline: Rename the fragment_{source,header}_buffer to codegen We want to reuse the same buffers for vertends so calling them fragment_* doesn't make sense. --- clutter/cogl/cogl/cogl-context.c | 4 ++-- clutter/cogl/cogl/cogl-context.h | 4 ++-- clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c | 4 ++-- clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c | 8 ++++---- clutter/cogl/cogl/cogl-pipeline-progend-glsl.c | 12 ++++++------ 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/clutter/cogl/cogl/cogl-context.c b/clutter/cogl/cogl/cogl-context.c index d83ad84..976b988 100644 --- a/clutter/cogl/cogl/cogl-context.c +++ b/clutter/cogl/cogl/cogl-context.c @@ -157,8 +157,8 @@ cogl_create_context (void) _context->opaque_color_pipeline = cogl_pipeline_new (); _context->blended_color_pipeline = cogl_pipeline_new (); _context->texture_pipeline = cogl_pipeline_new (); - _context->fragment_header_buffer = g_string_new (""); - _context->fragment_source_buffer = g_string_new (""); + _context->codegen_header_buffer = g_string_new (""); + _context->codegen_source_buffer = g_string_new (""); _context->source_stack = NULL; _context->legacy_state_set = 0; diff --git a/clutter/cogl/cogl/cogl-context.h b/clutter/cogl/cogl/cogl-context.h index 4b51d38..b172023 100644 --- a/clutter/cogl/cogl/cogl-context.h +++ b/clutter/cogl/cogl/cogl-context.h @@ -85,8 +85,8 @@ typedef struct CoglPipeline *opaque_color_pipeline; /* used for set_source_color */ CoglPipeline *blended_color_pipeline; /* used for set_source_color */ CoglPipeline *texture_pipeline; /* used for set_source_texture */ - GString *fragment_header_buffer; - GString *fragment_source_buffer; + GString *codegen_header_buffer; + GString *codegen_source_buffer; GList *source_stack; int legacy_state_set; diff --git a/clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c b/clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c index 61767a8..48eef5e 100644 --- a/clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c +++ b/clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c @@ -296,8 +296,8 @@ _cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline, int i; /* We reuse a single grow-only GString for code-gen */ - g_string_set_size (ctx->fragment_source_buffer, 0); - arbfp_program_state->source = ctx->fragment_source_buffer; + g_string_set_size (ctx->codegen_source_buffer, 0); + arbfp_program_state->source = ctx->codegen_source_buffer; g_string_append (arbfp_program_state->source, "!!ARBfp1.0\n" "TEMP output;\n" diff --git a/clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c b/clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c index a06455b..07c65e9 100644 --- a/clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c +++ b/clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c @@ -303,10 +303,10 @@ _cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline, other contains the main function. We need two strings because we need to dynamically declare attributes as the add_layer callback is invoked */ - g_string_set_size (ctx->fragment_header_buffer, 0); - g_string_set_size (ctx->fragment_source_buffer, 0); - priv->glsl_shader_state->header = ctx->fragment_header_buffer; - priv->glsl_shader_state->source = ctx->fragment_source_buffer; + g_string_set_size (ctx->codegen_header_buffer, 0); + g_string_set_size (ctx->codegen_source_buffer, 0); + priv->glsl_shader_state->header = ctx->codegen_header_buffer; + priv->glsl_shader_state->source = ctx->codegen_source_buffer; g_string_append (priv->glsl_shader_state->source, "void\n" diff --git a/clutter/cogl/cogl/cogl-pipeline-progend-glsl.c b/clutter/cogl/cogl/cogl-pipeline-progend-glsl.c index 8062e0d..6442496 100644 --- a/clutter/cogl/cogl/cogl-pipeline-progend-glsl.c +++ b/clutter/cogl/cogl/cogl-pipeline-progend-glsl.c @@ -221,13 +221,13 @@ get_uniform_cb (CoglPipeline *pipeline, /* We can reuse the source buffer to create the uniform name because the program has now been linked */ - g_string_set_size (ctx->fragment_source_buffer, 0); - g_string_append_printf (ctx->fragment_source_buffer, + g_string_set_size (ctx->codegen_source_buffer, 0); + g_string_append_printf (ctx->codegen_source_buffer, "_cogl_sampler_%i", state->unit); GE_RET( uniform_location, glGetUniformLocation (state->gl_program, - ctx->fragment_source_buffer->str) ); + ctx->codegen_source_buffer->str) ); /* We can set the uniform immediately because the samplers are the unit index not the texture object number so it will never @@ -236,13 +236,13 @@ get_uniform_cb (CoglPipeline *pipeline, if (uniform_location != -1) GE( glUniform1i (uniform_location, state->unit) ); - g_string_set_size (ctx->fragment_source_buffer, 0); - g_string_append_printf (ctx->fragment_source_buffer, + g_string_set_size (ctx->codegen_source_buffer, 0); + g_string_append_printf (ctx->codegen_source_buffer, "_cogl_layer_constant_%i", state->unit); GE_RET( uniform_location, glGetUniformLocation (state->gl_program, - ctx->fragment_source_buffer->str) ); + ctx->codegen_source_buffer->str) ); unit_state->combine_constant_uniform = uniform_location; -- 2.7.4