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

Andres Gomez agomez at igalia.com
Fri Feb 17 10:16:39 UTC 2017


Dropping this patch due to the discussion I opened at:
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16238

The layout qualification among Uniform and Shader Storage Blocks across
a linked program must match.

Br.

On Sun, 2017-02-05 at 20:53 +0200, 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 "
-- 
Br,

Andres


More information about the mesa-dev mailing list