summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-03-22 18:16:10 +0100
committerSamuel Pitoiset <[email protected]>2017-05-06 16:40:19 +0200
commit015c0b4a341431e75a98d93b813f7cdf404c3eaf (patch)
treee273e21161c3224f5ee20da6f5e8f47cbcf59e0e /src/compiler/glsl/ast_to_hir.cpp
parent89e37f9703d4c4d7d383cf1ec112d65d87f1ba11 (diff)
glsl: allow bindless samplers/images as varying variables
From section 4.3.4 of the ARB_bindless_texture spec: "(modify third paragraph of the section to allow sampler and image types) ... Vertex shader inputs can only be float, single-precision floating-point scalars, single-precision floating-point vectors, matrices, signed and unsigned integers and integer vectors, sampler and image types." From section 4.3.6 of the ARB_bindless_texture spec: "Output variables can only be floating-point scalars, floating-point vectors, matrices, signed or unsigned integers or integer vectors, sampler or image types, or arrays or structures of any these." v3: - add spec comment Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 5ee7d9aaab3..7968b5def2c 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4000,6 +4000,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
* Similar text exists in the GLSL ES 3.00 spec, except that the GLSL ES
* 3.00 spec allows structs as well. Varying structs are also allowed
* in GLSL 1.50.
+ *
+ * From section 4.3.4 of the ARB_bindless_texture spec:
+ *
+ * "(modify third paragraph of the section to allow sampler and image
+ * types) ... Vertex shader inputs can only be float,
+ * single-precision floating-point scalars, single-precision
+ * floating-point vectors, matrices, signed and unsigned integers
+ * and integer vectors, sampler and image types."
+ *
+ * From section 4.3.6 of the ARB_bindless_texture spec:
+ *
+ * "Output variables can only be floating-point scalars,
+ * floating-point vectors, matrices, signed or unsigned integers or
+ * integer vectors, sampler or image types, or arrays or structures
+ * of any these."
*/
switch (var->type->without_array()->base_type) {
case GLSL_TYPE_FLOAT:
@@ -4023,6 +4038,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;