summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2014-02-02 17:49:15 -0800
committerJordan Justen <[email protected]>2014-02-20 10:33:08 -0800
commit0c558f9ee6cfc412037dc56ad4c3686e0f116852 (patch)
treebca51f236da9cfebecd2dd01494ee366f7241d78 /src/glsl/glsl_parser_extras.cpp
parent5bc0b2f4321fe623e37535aa1ff1848aa5a2dec1 (diff)
glsl: convert GS input primitive to use ast_type_qualifier
We introduce a new merge_in_qualifier ast_type_qualifier which allows specialized handling of merging input layout qualifiers. By merging layout qualifiers into state->in_qualifier, we allow multiple input qualifiers. For example, the primitive type can be specified specified separately from the invocations count (ARB_gpu_shader5). state->gs_input_prim_type is moved into state->in_qualifier->prim_type state->gs_input_prim_type_specified is still processed separately so we can determine when the input primitive is specified. This is important since certain scenerios are not supported until after the primitive type has been specified in the shader code. v4: * Merge with compute shader input layout qualifiers Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 901124d2c39..f102b11bc6d 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -202,8 +202,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
this->default_uniform_qualifier->flags.q.column_major = 1;
this->gs_input_prim_type_specified = false;
- this->gs_input_prim_type = GL_POINTS;
this->gs_input_size = 0;
+ this->in_qualifier = new(this) ast_type_qualifier();
this->out_qualifier = new(this) ast_type_qualifier();
this->early_fragment_tests = false;
memset(this->atomic_counter_offsets, 0,
@@ -1348,7 +1348,7 @@ set_shader_inout_layout(struct gl_shader *shader,
{
if (shader->Stage != MESA_SHADER_GEOMETRY) {
/* Should have been prevented by the parser. */
- assert(!state->gs_input_prim_type_specified);
+ assert(!state->in_qualifier->flags.i);
assert(!state->out_qualifier->flags.i);
}
@@ -1364,7 +1364,7 @@ set_shader_inout_layout(struct gl_shader *shader,
shader->Geom.VerticesOut = state->out_qualifier->max_vertices;
if (state->gs_input_prim_type_specified) {
- shader->Geom.InputType = state->gs_input_prim_type;
+ shader->Geom.InputType = state->in_qualifier->prim_type;
} else {
shader->Geom.InputType = PRIM_UNKNOWN;
}