[Mesa-dev] [PATCH v2 30/31] glsl: disable tree grafting optimization for bindless images

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Apr 26 08:27:34 UTC 2017



On 04/26/2017 10:05 AM, Nicolai Hähnle wrote:
> On 24.04.2017 12:36, Samuel Pitoiset wrote:
>> Because the variable declaration holds more information than
>> the dereference. Note that an image is considered bindless either
>> if it has been declared in the default uniform block with the
>> bindless_sampler layout qualifier, or when its storage is not
>> uniform because this is not allowed without ARB_bindless_texture.
> 
> It seems unfortunate that we have to do this. Can you explain what goes 
> wrong without this change?

We lost the variable and all information contained in ir_variable for 
images.

> 
> Thanks,
> Nicolai
> 
> 
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>  src/compiler/glsl/opt_tree_grafting.cpp | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/src/compiler/glsl/opt_tree_grafting.cpp 
>> b/src/compiler/glsl/opt_tree_grafting.cpp
>> index 28b6e1856e..d4a1ec5675 100644
>> --- a/src/compiler/glsl/opt_tree_grafting.cpp
>> +++ b/src/compiler/glsl/opt_tree_grafting.cpp
>> @@ -371,6 +371,15 @@ tree_grafting_basic_block(ir_instruction *bb_first,
>>        if (lhs_var->data.precise)
>>           continue;
>>
>> +      if (lhs_var->type->is_image() &&
>> +          (lhs_var->data.bindless || lhs_var->data.mode != 
>> ir_var_uniform)) {
>> +         /* Disable tree grafting optimization for bindless image 
>> types because
>> +          * the variable declaration holds more information than the
>> +          * dereference.
>> +          */
>> +         continue;
>> +      }
>> +
>>        ir_variable_refcount_entry *entry = 
>> info->refs->get_variable_entry(lhs_var);
>>
>>        if (!entry->declaration ||
>>
> 
> 


More information about the mesa-dev mailing list