[Mesa-dev] [PATCH v3 07/14] glsl: move stream layout max validation

Timothy Arceri timothy.arceri at collabora.com
Sat Nov 14 05:58:23 PST 2015


On Sun, 2015-11-15 at 00:42 +1100, Timothy Arceri wrote:
> From: Timothy Arceri <timothy.arceri at collabora.com>
> 
> This validation is moved later so we can validate the
> max value when compile time constant support is added in a
> later patch.
> ---
>  src/glsl/ast_to_hir.cpp | 22 ++++++++++++++++++++--
>  src/glsl/ast_type.cpp   | 14 --------------
>  2 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index 53faacf..dedc39f 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -2522,8 +2522,24 @@ process_qualifier_constant(struct
> _mesa_glsl_parse_state *state,
>  }
>  
>  static bool
> +validate_stream_qualifier(YYLTYPE *loc, struct _mesa_glsl_parse_state
> *state,
> +                          unsigned stream)
> +{
> +   if (stream >= state->ctx->Const.MaxVertexStreams) {
> +      _mesa_glsl_error(loc, state,
> +                       "invalid stream specified %d is larger than "
> +                       "MAX_VERTEX_STREAMS - 1 (%d).",
> +                       stream, state->ctx->Const.MaxVertexStreams - 1);
> +      return false;
> +   }
> +
> +   return true;
> +}
> +
> +static void
>  validate_binding_qualifier(struct _mesa_glsl_parse_state *state,
>                             YYLTYPE *loc,
> +                           ir_variable *var,

This and changeing the function to not return bool are meant to be in the next
patch. I've fixed this up locally.



More information about the mesa-dev mailing list