aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_parser.yy
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-24 08:15:59 +0200
committermarha <marha@users.sourceforge.net>2013-10-24 08:15:59 +0200
commit285b1bd8933288fc56259cfb3de61207c8e35d9e (patch)
tree2107aaa7f683f16a9a1a73e5f6f2d7ba53710f32 /mesalib/src/glsl/glsl_parser.yy
parentc665b6e88274f8bc603b0f14f92bf09d2023bd4d (diff)
parent4eb0b643ad978d94837e2d587a5d4358f974a25c (diff)
downloadvcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.tar.gz
vcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.tar.bz2
vcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa xserver git update 24 oct 2013 Conflicts: xorg-server/glx/glxdricommon.c
Diffstat (limited to 'mesalib/src/glsl/glsl_parser.yy')
-rw-r--r--mesalib/src/glsl/glsl_parser.yy35
1 files changed, 32 insertions, 3 deletions
diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy
index 00589e28e..0a0708e95 100644
--- a/mesalib/src/glsl/glsl_parser.yy
+++ b/mesalib/src/glsl/glsl_parser.yy
@@ -2372,6 +2372,7 @@ layout_defaults:
| layout_qualifier IN_TOK ';'
{
void *ctx = state;
+ $$ = NULL;
if (state->target != geometry_shader) {
_mesa_glsl_error(& @1, state,
"input layout qualifiers only valid in "
@@ -2380,8 +2381,22 @@ layout_defaults:
_mesa_glsl_error(& @1, state,
"input layout qualifiers must specify a primitive"
" type");
+ } else {
+ /* Make sure this is a valid input primitive type. */
+ switch ($1.prim_type) {
+ case GL_POINTS:
+ case GL_LINES:
+ case GL_LINES_ADJACENCY:
+ case GL_TRIANGLES:
+ case GL_TRIANGLES_ADJACENCY:
+ $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type);
+ break;
+ default:
+ _mesa_glsl_error(&@1, state,
+ "invalid geometry shader input primitive type");
+ break;
+ }
}
- $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type);
}
| layout_qualifier OUT_TOK ';'
@@ -2390,8 +2405,22 @@ layout_defaults:
_mesa_glsl_error(& @1, state,
"out layout qualifiers only valid in "
"geometry shaders");
- } else if (!state->out_qualifier->merge_qualifier(& @1, state, $1)) {
- YYERROR;
+ } else {
+ if ($1.flags.q.prim_type) {
+ /* Make sure this is a valid output primitive type. */
+ switch ($1.prim_type) {
+ case GL_POINTS:
+ case GL_LINE_STRIP:
+ case GL_TRIANGLE_STRIP:
+ break;
+ default:
+ _mesa_glsl_error(&@1, state, "invalid geometry shader output "
+ "primitive type");
+ break;
+ }
+ }
+ if (!state->out_qualifier->merge_qualifier(& @1, state, $1))
+ YYERROR;
}
$$ = NULL;
}