summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-03-22 18:34:23 +0100
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-04-26 16:04:43 +0200
commitdc91ab1a51169920cbecbfe39f3c4feaed11cd43 (patch)
treeae24628220d4d197d0bf418a623173410caa397c
parent8b8bb7739706a553613e09049438dd891aeef48d (diff)
glsl: reject bindless samplers/images frag inputs without 'flat'
From section 4.3.4 of the ARB_bindless_texture spec "(modify last paragraph, p. 35, allowing samplers and images as fragment shader inputs) ... Fragment inputs can only be signed and unsigned integers and integer vectors, floating point scalars, floating-point vectors, matrices, sampler and image types, or arrays or structures of these. Fragment shader inputs that are signed or unsigned integers, integer vectors, or any double-precision floating- point type, or any sampler or image type must be qualified with the interpolation qualifier "flat"." v3: - update spec comment formatting Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (v2) Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v2)
-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 a7438d1228..12a7de72c6 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2995,6 +2995,26 @@ validate_fragment_flat_interpolation_input(struct _mesa_glsl_parse_state *state,
_mesa_glsl_error(loc, state, "if a fragment input is (or contains) "
"a double, then it must be qualified with 'flat'");
}
+
+ /* Bindless sampler/image fragment inputs must be qualified with 'flat'.
+ *
+ * From section 4.3.4 of the ARB_bindless_texture spec:
+ *
+ * "(modify last paragraph, p. 35, allowing samplers and images as
+ * fragment shader inputs) ... Fragment inputs can only be signed and
+ * unsigned integers and integer vectors, floating point scalars,
+ * floating-point vectors, matrices, sampler and image types, or arrays
+ * or structures of these. Fragment shader inputs that are signed or
+ * unsigned integers, integer vectors, or any double-precision floating-
+ * point type, or any sampler or image type must be qualified with the
+ * interpolation qualifier "flat"."
+ */
+ if (state->has_bindless()
+ && (var_type->contains_sampler() || var_type->contains_image())) {
+ _mesa_glsl_error(loc, state, "if a fragment input is (or contains) "
+ "a bindless sampler (or image), then it must be "
+ "qualified with 'flat'");
+ }
}
static void