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

2017-02-17 Thread Andres Gomez
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 
> ---
>  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
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-02-05 Thread Edward O'Callaghan
Reviewed-by: Edward O'Callaghan 

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 
> ---
>  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 "
> 



signature.asc
Description: OpenPGP digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-02-05 Thread Andres Gomez
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 
---
 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 "
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev