[Mesa-dev] [PATCH v2 04/15] glsl parser: reject VS+in & FS+out interface blocks

Kenneth Graunke kenneth at whitecape.org
Sat Mar 23 14:02:06 PDT 2013


On 03/18/2013 04:35 PM, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>   src/glsl/glsl_parser.yy |   14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
> index 7adc06d..8e6b04d 100644
> --- a/src/glsl/glsl_parser.yy
> +++ b/src/glsl/glsl_parser.yy
> @@ -1935,6 +1935,20 @@ basic_interface_block:
>   	      }
>   	   }
>
> +	   /* GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +	    * "It is illegal to have an input block in a vertex shader
> +	    *  or an output block in a fragment shader"
> +	    */

Perhaps, for more consistency with other citations:

/* From the GLSL 1.50.11 spec, section 4.3.7 ("Interface Blocks"):
  * "It is illegal to have an input block in a vertex shader
  *  or an output block in a fragment shader"
  */

> +	   if ((state->target == vertex_shader) && $1.flags.q.in) {
> +	      _mesa_glsl_error(& @1, state,
> +	                       "in interface block is not allowed for "

Perhaps: "\"in\" interface blocks are not allowed for "

(without quotes it looks like a typo of "an interface block")

> +	                       "a vertex shader\n");
> +	   } else if ((state->target == fragment_shader) && $1.flags.q.out) {
> +	      _mesa_glsl_error(& @1, state,
> +	                       "out interface block is not allowed for "

"\"out\" interface blocks are not allowed for "

> +	                       "a fragment shader\n");
> +	   }
> +
>   	   /* Since block arrays require names, and both features are added in
>   	    * the same language versions, we don't have to explicitly
>   	    * version-check both things.

Either way, this patch is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list