Re: [Mesa-dev] [PATCH 06/23] glsl/ast: Keep track of type qualifiers defined by ARB_shader_image_load_store.

2013-12-11 Thread Paul Berry
On 26 November 2013 00:02, Francisco Jerez curroje...@riseup.net wrote:

 ---
  src/glsl/ast.h| 32 +++-
  src/glsl/ast_type.cpp |  5 +
  2 files changed, 36 insertions(+), 1 deletion(-)

 diff --git a/src/glsl/ast.h b/src/glsl/ast.h
 index 5c214b6..b750bb7 100644
 --- a/src/glsl/ast.h
 +++ b/src/glsl/ast.h
 @@ -413,12 +413,23 @@ struct ast_type_qualifier {
  unsigned prim_type:1;
  unsigned max_vertices:1;
  /** \} */
 +
 +/** \name Layout and memory qualifiers for
 ARB_shader_image_load_store. */
 +/** \{ */
 +unsigned early_fragment_tests:1;
 +unsigned explicit_image_format:1;
 +unsigned coherent:1;
 +unsigned _volatile:1;
 +unsigned _restrict:1;
 +unsigned read_only:1;
 +unsigned write_only:1;
 +/** \} */


As in patch 5, I'd like to see a comment next to read_only and
write_only to indicate that they correspond to the GLSL keywords
readonly and writeonly.


}
/** \brief Set of flags, accessed by name. */
q;

/** \brief Set of flags, accessed as a bitmask. */
 -  unsigned i;
 +  uint64_t i;


In glsl_parser.yy's basic_interface_block rule there are local variables
called interface_type_mask and block_interface_qualifier that store values
from ast_type_qualifier::flags.i.  They should also be changed to uint64_t.

With those changes, this patch is:

Reviewed-by: Paul Berry stereotype...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 06/23] glsl/ast: Keep track of type qualifiers defined by ARB_shader_image_load_store.

2013-11-26 Thread Francisco Jerez
---
 src/glsl/ast.h| 32 +++-
 src/glsl/ast_type.cpp |  5 +
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 5c214b6..b750bb7 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -413,12 +413,23 @@ struct ast_type_qualifier {
 unsigned prim_type:1;
 unsigned max_vertices:1;
 /** \} */
+
+/** \name Layout and memory qualifiers for 
ARB_shader_image_load_store. */
+/** \{ */
+unsigned early_fragment_tests:1;
+unsigned explicit_image_format:1;
+unsigned coherent:1;
+unsigned _volatile:1;
+unsigned _restrict:1;
+unsigned read_only:1;
+unsigned write_only:1;
+/** \} */
   }
   /** \brief Set of flags, accessed by name. */
   q;
 
   /** \brief Set of flags, accessed as a bitmask. */
-  unsigned i;
+  uint64_t i;
} flags;
 
/** Precision of the type (highp/medium/lowp). */
@@ -463,6 +474,25 @@ struct ast_type_qualifier {
int offset;
 
/**
+* Image format specified with an ARB_shader_image_load_store
+* layout qualifier.
+*
+* \note
+* This field is only valid if \c explicit_image_format is set.
+*/
+   GLenum image_format;
+
+   /**
+* Base type of the data read from or written to this image.  Only
+* the following enumerants are allowed: GLSL_TYPE_UINT,
+* GLSL_TYPE_INT, GLSL_TYPE_FLOAT.
+*
+* \note
+* This field is only valid if \c explicit_image_format is set.
+*/
+   glsl_base_type image_base_type;
+
+   /**
 * Return true if and only if an interpolation qualifier is present.
 */
bool has_interpolation() const;
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 2b088bf..64c6758 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -180,6 +180,11 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
if (q.precision != ast_precision_none)
   this-precision = q.precision;
 
+   if (q.flags.q.explicit_image_format) {
+  this-image_format = q.image_format;
+  this-image_base_type = q.image_base_type;
+   }
+
return true;
 }
 
-- 
1.8.3.4

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