[Mesa-dev] [PATCH v3 19/32] glsl: relax bindless sampler arrays indexing

Timothy Arceri tarceri at itsqueeze.com
Fri May 5 00:25:53 UTC 2017



On 04/05/17 22:29, Nicolai Hähnle wrote:
> On 02.05.2017 22:53, Samuel Pitoiset wrote:
>> From section 4.1.7 of the ARB_bindless_texture spec:
>>
>>    "Samplers aggregated into arrays within a shader (using square
>>     brackets []) can be indexed with arbitrary integer expressions."
>>
>> v3: - update spec comment formatting
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com> (v2)
>> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com> (v2)
> 
> Again, feel free to remove the (v2) on those.

Same here. Feel free to remove all the v2 on the patches that have my r-b.

> 
>> ---
>>  src/compiler/glsl/ast_array_index.cpp | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/glsl/ast_array_index.cpp 
>> b/src/compiler/glsl/ast_array_index.cpp
>> index dfa44b703d..f6b7a64a28 100644
>> --- a/src/compiler/glsl/ast_array_index.cpp
>> +++ b/src/compiler/glsl/ast_array_index.cpp
>> @@ -299,12 +299,18 @@ _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.
>> +       *
>> +       * From section 4.1.7 of the ARB_bindless_texture spec:
>> +       *
>> +       *    "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 "
>>
> 
> 


More information about the mesa-dev mailing list