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

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Apr 24 10:35:53 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 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



More information about the mesa-dev mailing list