[Mesa-dev] [PATCH] glsl: binding qualifier must match with opaque-uniforms only

Edward O'Callaghan funfunctor at folklore1984.net
Mon Feb 6 02:23:13 UTC 2017


Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

On 02/06/2017 05:53 AM, Andres Gomez wrote:
> The binding point is a valid layout qualifier for Uniform Blocks,
> Shader Storage Blocks and Opaque-Uniforms.
> 
> From page 60 (page 66 of the PDF) of the GLSL 4.20 spec, v11:
> 
>   " A link error will result if two compilation units in a program
>     specify different integer-constant bindings for the same
>     opaque-uniform name. However, it is not an error to specify a
>     binding on some but not all declarations for the same name, as
>     shown in the examples below."
> 
> As we see, this restriction applies to Opaque-Uniforms only, not to
> Uniform Blocks nor Shader Storage Blocks.
> 
> Fixes GL45-CTS.enhanced_layouts.ssb_layout_qualifier_conflict
> 
> Signed-off-by: Andres Gomez <agomez at igalia.com>
> ---
>  src/compiler/glsl/linker.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
> index b768a6e5285..ae13a45d22b 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -962,7 +962,7 @@ cross_validate_globals(struct gl_shader_program *prog,
>            *  opaque-uniform name.  However, it is not an error to specify a
>            *  binding on some but not all declarations for the same name"
>            */
> -         if (var->data.explicit_binding) {
> +         if (var->type->contains_opaque() && var->data.explicit_binding) {
>              if (existing->data.explicit_binding &&
>                  var->data.binding != existing->data.binding) {
>                 linker_error(prog, "explicit bindings for %s "
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170206/3a7d5fc3/attachment.sig>


More information about the mesa-dev mailing list