diff options
author | Dave Airlie <[email protected]> | 2016-05-10 11:56:31 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-05-10 14:26:03 +1000 |
commit | 4d8a71f7f18986f3969489ea8e94de335378a479 (patch) | |
tree | 651cbc65b1d6a569797286aff14fcd95847e1a6e /src | |
parent | 13c68e1447f90d067462ec4fa3186c5c871a56fe (diff) |
glsl: check geometry output vertices limits.
This fixes:
GL45-CTS.geometry_shader.limits.max_output_vertices
Reviewed-by: Kenneth Graunke <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index fb64350ed39..463cb9730ea 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -1683,6 +1683,14 @@ set_shader_inout_layout(struct gl_shader *shader, if (state->out_qualifier->max_vertices-> process_qualifier_constant(state, "max_vertices", &qual_max_vertices, true)) { + + if (qual_max_vertices > state->Const.MaxGeometryOutputVertices) { + YYLTYPE loc = state->out_qualifier->max_vertices->get_location(); + _mesa_glsl_error(&loc, state, + "maximum output vertices (%d) exceeds " + "GL_MAX_GEOMETRY_OUTPUT_VERTICES", + qual_max_vertices); + } shader->Geom.VerticesOut = qual_max_vertices; } } |