summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/glsl_parser_extras.cpp4
-rw-r--r--src/glsl/link_interface_blocks.cpp2
-rw-r--r--src/glsl/link_varyings.cpp22
-rw-r--r--src/glsl/linker.cpp16
-rw-r--r--src/glsl/lower_packed_varyings.cpp2
-rw-r--r--src/glsl/opt_dead_builtin_varyings.cpp4
6 files changed, 25 insertions, 25 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 8a9526c471f..0031e15d722 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -1448,7 +1448,7 @@ static void
set_shader_inout_layout(struct gl_shader *shader,
struct _mesa_glsl_parse_state *state)
{
- if (shader->Type != GL_GEOMETRY_SHADER) {
+ if (shader->Stage != MESA_SHADER_GEOMETRY) {
/* Should have been prevented by the parser. */
assert(!state->gs_input_prim_type_specified);
assert(!state->out_qualifier->flags.i);
@@ -1516,7 +1516,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
if (!state->error && !shader->ir->is_empty()) {
struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader->Type)];
+ &ctx->ShaderCompilerOptions[shader->Stage];
/* Do some optimization at compile time to reduce shader IR size
* and reduce later work if the same shader is linked multiple times
diff --git a/src/glsl/link_interface_blocks.cpp b/src/glsl/link_interface_blocks.cpp
index 4769636423f..52552cc682a 100644
--- a/src/glsl/link_interface_blocks.cpp
+++ b/src/glsl/link_interface_blocks.cpp
@@ -313,7 +313,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
const gl_shader *consumer)
{
interface_block_definitions definitions;
- const bool extra_array_level = consumer->Type == GL_GEOMETRY_SHADER;
+ const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY;
/* Add input interfaces from the consumer to the symbol table. */
foreach_list(node, consumer->ir) {
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index ab40d458563..da97e9ff24e 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -1072,7 +1072,7 @@ assign_varying_locations(struct gl_context *ctx,
const unsigned producer_base = VARYING_SLOT_VAR0;
const unsigned consumer_base = VARYING_SLOT_VAR0;
varying_matches matches(ctx->Const.DisableVaryingPacking,
- consumer && consumer->Type == GL_FRAGMENT_SHADER);
+ consumer && consumer->Stage == MESA_SHADER_FRAGMENT);
hash_table *tfeedback_candidates
= hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare);
hash_table *consumer_inputs
@@ -1217,9 +1217,9 @@ assign_varying_locations(struct gl_context *ctx,
linker_error(prog, "%s shader varying %s not written "
"by %s shader\n.",
- _mesa_progshader_enum_to_string(consumer->Type),
+ _mesa_shader_stage_to_string(consumer->Stage),
var->name,
- _mesa_progshader_enum_to_string(producer->Type));
+ _mesa_shader_stage_to_string(producer->Stage));
}
/* An 'in' variable is only really a shader input if its
@@ -1250,14 +1250,14 @@ check_against_output_limit(struct gl_context *ctx,
}
unsigned max_output_components;
- switch (producer->Type) {
- case GL_VERTEX_SHADER:
+ switch (producer->Stage) {
+ case MESA_SHADER_VERTEX:
max_output_components = ctx->Const.VertexProgram.MaxOutputComponents;
break;
- case GL_GEOMETRY_SHADER:
+ case MESA_SHADER_GEOMETRY:
max_output_components = ctx->Const.GeometryProgram.MaxOutputComponents;
break;
- case GL_FRAGMENT_SHADER:
+ case MESA_SHADER_FRAGMENT:
default:
assert(!"Should not get here.");
return false;
@@ -1299,14 +1299,14 @@ check_against_input_limit(struct gl_context *ctx,
}
unsigned max_input_components;
- switch (consumer->Type) {
- case GL_GEOMETRY_SHADER:
+ switch (consumer->Stage) {
+ case MESA_SHADER_GEOMETRY:
max_input_components = ctx->Const.GeometryProgram.MaxInputComponents;
break;
- case GL_FRAGMENT_SHADER:
+ case MESA_SHADER_FRAGMENT:
max_input_components = ctx->Const.FragmentProgram.MaxInputComponents;
break;
- case GL_VERTEX_SHADER:
+ case MESA_SHADER_VERTEX:
default:
assert(!"Should not get here.");
return false;
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 428a044e9b8..91a7220fc8e 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -438,7 +438,7 @@ analyze_clip_usage(struct gl_shader_program *prog,
if (clip_vertex.variable_found() && clip_distance.variable_found()) {
linker_error(prog, "%s shader writes to both `gl_ClipVertex' "
"and `gl_ClipDistance'\n",
- _mesa_progshader_enum_to_string(shader->Type));
+ _mesa_shader_stage_to_string(shader->Stage));
return;
}
*UsesClipDistance = clip_distance.variable_found();
@@ -1209,7 +1209,7 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog,
/* No in/out qualifiers defined for anything but GLSL 1.50+
* geometry shaders so far.
*/
- if (linked_shader->Type != GL_GEOMETRY_SHADER || prog->Version < 150)
+ if (linked_shader->Stage != MESA_SHADER_GEOMETRY || prog->Version < 150)
return;
/* From the GLSL 1.50 spec, page 46:
@@ -1376,7 +1376,7 @@ link_intrastage_shaders(void *mem_ctx,
if (main == NULL) {
linker_error(prog, "%s shader lacks `main'\n",
- _mesa_progshader_enum_to_string(shader_list[0]->Type));
+ _mesa_shader_stage_to_string(shader_list[0]->Stage));
return NULL;
}
@@ -1450,7 +1450,7 @@ link_intrastage_shaders(void *mem_ctx,
validate_ir_tree(linked->ir);
/* Set the size of geometry shader input arrays */
- if (linked->Type == GL_GEOMETRY_SHADER) {
+ if (linked->Stage == MESA_SHADER_GEOMETRY) {
unsigned num_vertices = vertices_per_prim(prog->Geom.InputType);
geom_array_resize_visitor input_resize_visitor(num_vertices, prog);
foreach_iter(exec_list_iterator, iter, *linked->ir) {
@@ -2049,16 +2049,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
goto done;
}
- switch (prog->Shaders[i]->Type) {
- case GL_VERTEX_SHADER:
+ switch (prog->Shaders[i]->Stage) {
+ case MESA_SHADER_VERTEX:
vert_shader_list[num_vert_shaders] = prog->Shaders[i];
num_vert_shaders++;
break;
- case GL_FRAGMENT_SHADER:
+ case MESA_SHADER_FRAGMENT:
frag_shader_list[num_frag_shaders] = prog->Shaders[i];
num_frag_shaders++;
break;
- case GL_GEOMETRY_SHADER:
+ case MESA_SHADER_GEOMETRY:
geom_shader_list[num_geom_shaders] = prog->Shaders[i];
num_geom_shaders++;
break;
diff --git a/src/glsl/lower_packed_varyings.cpp b/src/glsl/lower_packed_varyings.cpp
index 9edef5d0487..c23d1801b4e 100644
--- a/src/glsl/lower_packed_varyings.cpp
+++ b/src/glsl/lower_packed_varyings.cpp
@@ -669,7 +669,7 @@ lower_packed_varyings(void *mem_ctx, unsigned location_base,
gs_input_vertices, &new_instructions);
visitor.run(instructions);
if (mode == ir_var_shader_out) {
- if (shader->Type == GL_GEOMETRY_SHADER) {
+ if (shader->Stage == MESA_SHADER_GEOMETRY) {
/* For geometry shaders, outputs need to be lowered before each call
* to EmitVertex()
*/
diff --git a/src/glsl/opt_dead_builtin_varyings.cpp b/src/glsl/opt_dead_builtin_varyings.cpp
index a939a2b646f..c2a306e7bce 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;
}