summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-07 10:58:56 -0800
committerPaul Berry <[email protected]>2014-01-08 07:31:45 -0800
commite3b86f07da4ba9a4db6b8aae4072af6f1638b7cc (patch)
tree1b3c89c2a65cdefd6c39974e19ac337962df42b9 /src/mesa/drivers
parent65511e5f22e2ba0a5ebd9210319a55d80ea5334e (diff)
mesa: Use gl_shader::Stage instead of gl_shader::Type where possible.
This reduces confusion since gl_shader::Type is sometimes GL_SHADER_PROGRAM_MESA but is more frequently GL_SHADER_{VERTEX,GEOMETRY,FRAGMENT}. It also has the advantage that when switching on gl_shader::Stage, the compiler will alert if one of the possible enum types is unhandled. Finally, many functions in src/glsl (especially those dealing with linking) already use gl_shader_stage to represent pipeline stages; using gl_shader::Stage in those functions avoids the need for a conversion. Note: in the process I changed _mesa_write_shader_to_file() so that if it encounters an unexpected shader stage, it will use a file suffix of "????" rather than "geom". Reviewed-by: Brian Paul <[email protected]> v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects." Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp5
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index c0d6aa27eeb..33197ebf105 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -262,7 +262,8 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
if (ctx->Shader.Flags & GLSL_DUMP) {
printf("\n");
printf("GLSL IR for linked %s program %d:\n",
- _mesa_progshader_enum_to_string(shader->base.Type), shProg->Name);
+ _mesa_shader_stage_to_string(shader->base.Stage),
+ shProg->Name);
_mesa_print_ir(shader->base.ir, NULL);
printf("\n");
}
@@ -275,7 +276,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
continue;
printf("GLSL %s shader %d source for linked program %d:\n",
- _mesa_progshader_enum_to_string(sh->Type),
+ _mesa_shader_stage_to_string(sh->Stage),
i,
shProg->Name);
printf("%s", sh->Source);
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 5236eda0d9f..acb1a40e632 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -842,7 +842,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
brw_create_constant_surface(brw, bo, binding->Offset,
bo->size - binding->Offset,
&surf_offsets[i],
- shader->Type == GL_FRAGMENT_SHADER);
+ shader->Stage == MESA_SHADER_FRAGMENT);
}
if (shader->NumUniformBlocks)