summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-05-01 15:37:48 -0700
committerCarl Worth <cworth@cworth.org>2014-05-05 11:23:20 -0700
commitec70be5628b0941767964cff6135b5ba0bf20766 (patch)
tree11cded400ffe805b83ce08326fb9d897761d6ee8
parent2d9bfe4bf424ed234c276d7ca80348e9d10a6e43 (diff)
downloadmesa-ec70be5628b0941767964cff6135b5ba0bf20766.tar.gz
glsl: Use switch to allow adding more shader types
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: <mesa-stable@lists.freedesktop.org>
-rw-r--r--src/glsl/glsl_parser_extras.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 87784ed690..6b7760feb3 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -1335,20 +1335,27 @@ set_shader_inout_layout(struct gl_shader *shader,
return;
}
- shader->Geom.VerticesOut = 0;
- if (state->out_qualifier->flags.q.max_vertices)
- shader->Geom.VerticesOut = state->out_qualifier->max_vertices;
-
- if (state->gs_input_prim_type_specified) {
- shader->Geom.InputType = state->gs_input_prim_type;
- } else {
- shader->Geom.InputType = PRIM_UNKNOWN;
- }
+ switch(shader->Stage) {
+ case MESA_SHADER_GEOMETRY:
+ shader->Geom.VerticesOut = 0;
+ if (state->out_qualifier->flags.q.max_vertices)
+ shader->Geom.VerticesOut = state->out_qualifier->max_vertices;
+
+ if (state->gs_input_prim_type_specified) {
+ shader->Geom.InputType = state->gs_input_prim_type;
+ } else {
+ shader->Geom.InputType = PRIM_UNKNOWN;
+ }
- if (state->out_qualifier->flags.q.prim_type) {
- shader->Geom.OutputType = state->out_qualifier->prim_type;
- } else {
- shader->Geom.OutputType = PRIM_UNKNOWN;
+ if (state->out_qualifier->flags.q.prim_type) {
+ shader->Geom.OutputType = state->out_qualifier->prim_type;
+ } else {
+ shader->Geom.OutputType = PRIM_UNKNOWN;
+ }
+ break;
+ default:
+ /* Nothing to do. */
+ break;
}
}