[Mesa-dev] [PATCH v2 15/31] glsl: allow bindless samplers/images as varying variables

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


The ARB_bindless_texture spec says:

   "Replace Section 4.1.7 (Samplers), p. 25"

   "Samplers may be declared as shader inputs and outputs, as uniform
    variables, as temporary variables, and as function parameters"

and,

   "Replace Section 4.1.X, (Images)"

   "Images may be declared as shader inputs and outputs, as uniform
    variables, as temporary variables, and as function parameters."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/compiler/glsl/ast_to_hir.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 5ef99bf504..423a6b98c1 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -3975,6 +3975,11 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
       case GLSL_TYPE_UINT64:
       case GLSL_TYPE_INT64:
          break;
+      case GLSL_TYPE_SAMPLER:
+      case GLSL_TYPE_IMAGE:
+         if (state->has_bindless())
+            break;
+         /* fallthrough */
       default:
          _mesa_glsl_error(loc, state, "illegal type for a varying variable");
          break;
-- 
2.12.2



More information about the mesa-dev mailing list