[Mesa-dev] [PATCH v2 18/31] glsl: relax bindless sampler arrays indexing
Nicolai Hähnle
nhaehnle at gmail.com
Wed Apr 26 07:41:17 UTC 2017
On 24.04.2017 12:35, Samuel Pitoiset wrote:
> The ARB_bindless_texture spec says:
>
> "Replace Section 4.1.7 (Samplers), p. 25"
>
> "Samplers aggregated into arrays within a shader (using square
> brackets []) can be indexed with arbitrary integer expressions."
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> src/compiler/glsl/ast_array_index.cpp | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/ast_array_index.cpp b/src/compiler/glsl/ast_array_index.cpp
> index dfa44b703d..a761215eb5 100644
> --- a/src/compiler/glsl/ast_array_index.cpp
> +++ b/src/compiler/glsl/ast_array_index.cpp
> @@ -299,12 +299,20 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
> * values must not diverge between shader invocations run together. If the
> * values *do* diverge, then the behavior of the operation requiring a
> * dynamically uniform expression is undefined.
> + *
> + * The ARB_bindless_texture spec says:
> + *
> + * "Replace Section 4.1.7 (Samplers), p. 25"
> + *
> + * "Samplers aggregated into arrays within a shader (using square
> + * brackets []) can be indexed with arbitrary integer expressions."
> */
> if (array->type->without_array()->is_sampler()) {
> if (!state->is_version(400, 320) &&
> !state->ARB_gpu_shader5_enable &&
> !state->EXT_gpu_shader5_enable &&
> - !state->OES_gpu_shader5_enable) {
> + !state->OES_gpu_shader5_enable &&
> + !state->has_bindless()) {
> if (state->is_version(130, 300))
> _mesa_glsl_error(&loc, state,
> "sampler arrays indexed with non-constant "
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list