Re: [Mesa-dev] [PATCH v2 22/31] glsl: allow bindless samplers/images to be initialized

2017-04-26 Thread Nicolai Hähnle

With Timothy's suggestion:

Reviewed-by: Nicolai Hähnle 

On 24.04.2017 12:35, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
 src/compiler/glsl/ast_to_hir.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index f90ae3d09a..e4d8bae2f5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4293,7 +4293,8 @@ process_initializer(ir_variable *var, ast_declaration 
*decl,
 * OpenGL API; they cannot be declared with an initializer in a
 * shader."
 */
-   if (var->type->contains_opaque()) {
+   if (var->type->contains_atomic() ||
+   (!state->has_bindless() && var->type->contains_opaque())) {
   _mesa_glsl_error(&initializer_loc, state,
"cannot initialize opaque variable %s",
var->name);




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 22/31] glsl: allow bindless samplers/images to be initialized

2017-04-25 Thread Timothy Arceri

On 24/04/17 20:35, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
  src/compiler/glsl/ast_to_hir.cpp | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index f90ae3d09a..e4d8bae2f5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4293,7 +4293,8 @@ process_initializer(ir_variable *var, ast_declaration 
*decl,
  * OpenGL API; they cannot be declared with an initializer in a
  * shader."
  */
-   if (var->type->contains_opaque()) {
+   if (var->type->contains_atomic() ||
+   (!state->has_bindless() && var->type->contains_opaque())) {
_mesa_glsl_error(&initializer_loc, state,
 "cannot initialize opaque variable %s",
 var->name);


Please add spec quote to the comment and update the error message to ? 
"atomic" : "opaque" as suggested elsewhere.


With that:

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


[Mesa-dev] [PATCH v2 22/31] glsl: allow bindless samplers/images to be initialized

2017-04-24 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 src/compiler/glsl/ast_to_hir.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index f90ae3d09a..e4d8bae2f5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4293,7 +4293,8 @@ process_initializer(ir_variable *var, ast_declaration 
*decl,
 * OpenGL API; they cannot be declared with an initializer in a
 * shader."
 */
-   if (var->type->contains_opaque()) {
+   if (var->type->contains_atomic() ||
+   (!state->has_bindless() && var->type->contains_opaque())) {
   _mesa_glsl_error(&initializer_loc, state,
"cannot initialize opaque variable %s",
var->name);
-- 
2.12.2

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