summaryrefslogtreecommitdiff
path: root/src/glsl/opt_dead_builtin_varyings.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2014-01-07 10:58:56 -0800
committerPaul Berry <stereotype441@gmail.com>2014-01-08 07:31:45 -0800
commite3b86f07da4ba9a4db6b8aae4072af6f1638b7cc (patch)
tree1b3c89c2a65cdefd6c39974e19ac337962df42b9 /src/glsl/opt_dead_builtin_varyings.cpp
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 <brianp@vmware.com> v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects." Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/opt_dead_builtin_varyings.cpp')
-rw-r--r--src/glsl/opt_dead_builtin_varyings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/opt_dead_builtin_varyings.cpp b/src/glsl/opt_dead_builtin_varyings.cpp
index a939a2b646..c2a306e7bc 100644
--- a/src/glsl/opt_dead_builtin_varyings.cpp
+++ b/src/glsl/opt_dead_builtin_varyings.cpp
@@ -512,7 +512,7 @@ do_dead_builtin_varyings(struct gl_context *ctx,
tfeedback_decl *tfeedback_decls)
{
/* Lower the gl_FragData array to separate variables. */
- if (consumer && consumer->Type == GL_FRAGMENT_SHADER) {
+ if (consumer && consumer->Stage == MESA_SHADER_FRAGMENT) {
lower_fragdata_array(consumer->ir);
}
@@ -574,7 +574,7 @@ do_dead_builtin_varyings(struct gl_context *ctx,
* This doesn't prevent elimination of the gl_TexCoord elements which
* are not read by the fragment shader. We want to eliminate those anyway.
*/
- if (consumer->Type == GL_FRAGMENT_SHADER) {
+ if (consumer->Stage == MESA_SHADER_FRAGMENT) {
producer_info.texcoord_usage = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
}