diff options
author | Samuel Pitoiset <[email protected]> | 2017-03-20 21:37:03 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-06 16:40:19 +0200 |
commit | 8834c74fef4ab405397833e4499b622b6ce9c116 (patch) | |
tree | 606ddc227aa930c6e76486c51f86fd841b60a2bf | |
parent | 015c0b4a341431e75a98d93b813f7cdf404c3eaf (diff) |
glsl: allow bindless samplers/images as vertex shader inputs
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."
v3: - update spec comment formatting
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 7968b5def2c..040314a3488 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -5097,6 +5097,14 @@ ast_declarator_list::hir(exec_list *instructions, * vectors, matrices, signed and unsigned integers and integer * vectors. Vertex shader inputs cannot be arrays or * structures." + * + * 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." */ const glsl_type *check_type = var->type->without_array(); @@ -5113,6 +5121,12 @@ ast_declarator_list::hir(exec_list *instructions, case GLSL_TYPE_DOUBLE: if (check_type->is_double() && (state->is_version(410, 0) || state->ARB_vertex_attrib_64bit_enable)) break; + case GLSL_TYPE_SAMPLER: + if (check_type->is_sampler() && state->has_bindless()) + break; + case GLSL_TYPE_IMAGE: + if (check_type->is_image() && state->has_bindless()) + break; /* FALLTHROUGH */ default: _mesa_glsl_error(& loc, state, |