Re: [Mesa-dev] [PATCH] glsl: fix duplicated layout qualifier detection for GS

2014-07-03 Thread Samuel Iglesias Gonsálvez
On Wed, 2014-07-02 at 12:47 -0700, Jordan Justen wrote:
 Reviewed-by: Jordan Justen jordan.l.jus...@intel.com
 

I don't have commit access to the repository.

Would you mind pushing this patch to master?

Sam


signature.asc
Description: This is a digitally signed message part
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: fix duplicated layout qualifier detection for GS

2014-07-03 Thread Jordan Justen
On 2014-07-03 07:18:42, Samuel Iglesias Gonsálvez wrote:
 On Wed, 2014-07-02 at 12:47 -0700, Jordan Justen wrote:
  Reviewed-by: Jordan Justen jordan.l.jus...@intel.com
 
 I don't have commit access to the repository.
 
 Would you mind pushing this patch to master?

Pushed. Thanks for the patch!

-Jordan


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


[Mesa-dev] [PATCH] glsl: fix duplicated layout qualifier detection for GS

2014-07-02 Thread Samuel Iglesias Gonsalvez
This patch fixes the duplicated layout qualifier detection
for geometry shader's layout qualifiers.

Also it makes the detection code more legible by defining
allowed_duplicates_mask variable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778

Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com
---
 src/glsl/ast_type.cpp | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 017f23d..de4c1a4 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -122,18 +122,28 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
ubo_binding_mask.flags.q.explicit_binding = 1;
ubo_binding_mask.flags.q.explicit_offset = 1;
 
+   ast_type_qualifier stream_layout_mask;
+   stream_layout_mask.flags.i = 0;
+   stream_layout_mask.flags.q.stream = 1;
+
/* Uniform block layout qualifiers get to overwrite each
 * other (rightmost having priority), while all other
 * qualifiers currently don't allow duplicates.
-*
-* Geometry shaders can have several layout qualifiers
+*/
+   ast_type_qualifier allowed_duplicates_mask;
+   allowed_duplicates_mask.flags.i =
+  ubo_mat_mask.flags.i |
+  ubo_layout_mask.flags.i |
+  ubo_binding_mask.flags.i;
+
+   /* Geometry shaders can have several layout qualifiers
 * assigning different stream values.
 */
+   if (state-stage == MESA_SHADER_GEOMETRY)
+  allowed_duplicates_mask.flags.i |=
+ stream_layout_mask.flags.i;
 
-   if ((state-stage != MESA_SHADER_GEOMETRY) 
-   (this-flags.i  q.flags.i  ~(ubo_mat_mask.flags.i |
- ubo_layout_mask.flags.i |
-  ubo_binding_mask.flags.i)) != 0) {
+   if ((this-flags.i  q.flags.i  ~allowed_duplicates_mask.flags.i) != 0) {
   _mesa_glsl_error(loc, state,
   duplicate layout qualifiers used);
   return false;
-- 
2.0.0

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


Re: [Mesa-dev] [PATCH] glsl: fix duplicated layout qualifier detection for GS

2014-07-02 Thread Jordan Justen
Reviewed-by: Jordan Justen jordan.l.jus...@intel.com

On Wed, Jul 2, 2014 at 12:38 AM, Samuel Iglesias Gonsalvez
sigles...@igalia.com wrote:
 This patch fixes the duplicated layout qualifier detection
 for geometry shader's layout qualifiers.

 Also it makes the detection code more legible by defining
 allowed_duplicates_mask variable.

 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778

 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com
 ---
  src/glsl/ast_type.cpp | 22 --
  1 file changed, 16 insertions(+), 6 deletions(-)

 diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
 index 017f23d..de4c1a4 100644
 --- a/src/glsl/ast_type.cpp
 +++ b/src/glsl/ast_type.cpp
 @@ -122,18 +122,28 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
 ubo_binding_mask.flags.q.explicit_binding = 1;
 ubo_binding_mask.flags.q.explicit_offset = 1;

 +   ast_type_qualifier stream_layout_mask;
 +   stream_layout_mask.flags.i = 0;
 +   stream_layout_mask.flags.q.stream = 1;
 +
 /* Uniform block layout qualifiers get to overwrite each
  * other (rightmost having priority), while all other
  * qualifiers currently don't allow duplicates.
 -*
 -* Geometry shaders can have several layout qualifiers
 +*/
 +   ast_type_qualifier allowed_duplicates_mask;
 +   allowed_duplicates_mask.flags.i =
 +  ubo_mat_mask.flags.i |
 +  ubo_layout_mask.flags.i |
 +  ubo_binding_mask.flags.i;
 +
 +   /* Geometry shaders can have several layout qualifiers
  * assigning different stream values.
  */
 +   if (state-stage == MESA_SHADER_GEOMETRY)
 +  allowed_duplicates_mask.flags.i |=
 + stream_layout_mask.flags.i;

 -   if ((state-stage != MESA_SHADER_GEOMETRY) 
 -   (this-flags.i  q.flags.i  ~(ubo_mat_mask.flags.i |
 - ubo_layout_mask.flags.i |
 -  ubo_binding_mask.flags.i)) != 0) {
 +   if ((this-flags.i  q.flags.i  ~allowed_duplicates_mask.flags.i) != 0) {
_mesa_glsl_error(loc, state,
duplicate layout qualifiers used);
return false;
 --
 2.0.0

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