[Mesa-dev] [PATCH] glsl: check geometry output vertices limits.
Kenneth Graunke
kenneth at whitecape.org
Tue May 10 03:24:56 UTC 2016
On Tuesday, May 10, 2016 11:57:44 AM PDT Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This fixes:
> GL45-CTS.geometry_shader.limits.max_output_vertices
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/compiler/glsl/glsl_parser_extras.cpp | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/
glsl_parser_extras.cpp
> index fb64350..8230516 100644
> --- a/src/compiler/glsl/glsl_parser_extras.cpp
> +++ b/src/compiler/glsl/glsl_parser_extras.cpp
> @@ -1683,7 +1683,16 @@ 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;
> +
Bonus blank here
Weird, it's surprising we never bothered to check this.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> }
> }
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160509/d8acca2a/attachment.sig>
More information about the mesa-dev
mailing list