[Mesa-dev] [PATCH 3/4] i965: use UnrollSamplerArrayDynamicIndexing for gen < 7

Tapani Pälli tapani.palli at intel.com
Thu Jun 11 00:50:21 PDT 2015



On 06/09/2015 03:52 PM, Francisco Jerez wrote:
> Tapani Pälli <tapani.palli at intel.com> writes:
>
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> ---
>>   src/mesa/drivers/dri/i965/brw_context.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
>> index 652d9a3..38c6f72 100644
>> --- a/src/mesa/drivers/dri/i965/brw_context.c
>> +++ b/src/mesa/drivers/dri/i965/brw_context.c
>> @@ -578,6 +578,10 @@ brw_initialize_context_constants(struct brw_context *brw)
>>   	 (i == MESA_SHADER_FRAGMENT);
>>         ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
>>         ctx->Const.ShaderCompilerOptions[i].LowerClipDistance = true;
>> +
>> +      /* !ARB_gpu_shader5 */
>> +      if (brw->gen < 7)
>> +         ctx->Const.ShaderCompilerOptions[i].UnrollSamplerArrayDynamicIndexing = true;
>
> It would be nice to have this flag default to true on context init if
> the back-end doesn't support ARB_gpu_shader5 while the rest of
> ShaderCompilerOptions are initialized on context creation, otherwise we
> should probably make a similar change in the i915 driver and the Mesa
> state tracker at least.

Right, the reason why I went to use ShaderCompilerOptions is that it is 
all what is available in the optimizations round so there's no 
possibility to use ARB_gpu_shader5 or check for GLSL version.

It seems problematic to implement any kind of convenience around setting 
this option because backend needs to first indicate the support for 
ARB_gpu_shader5 before we could set the 'sane default'. I think only 
possible option here is to just go and toggle it per driver.


>>      }
>>
>>      ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;
>> --
>> 2.1.0


// Tapani


More information about the mesa-dev mailing list