[Mesa-dev] [PATCH 1/3] i965: Check the INTEL_USE_NIR environment variable once at context creation

Matt Turner mattst88 at gmail.com
Fri Apr 3 09:46:31 PDT 2015


On Fri, Apr 3, 2015 at 1:07 AM, Jordan Justen <jordan.l.justen at intel.com> wrote:
> On 2015-04-02 20:56:15, Jason Ekstrand wrote:
>> ---
>>  src/mesa/drivers/dri/i965/brw_context.c | 10 +++++++++-
>>  src/mesa/drivers/dri/i965/brw_fs.cpp    |  4 ++--
>>  src/mesa/drivers/dri/i965/brw_vec4.cpp  |  4 +++-
>>  3 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
>> index 84818f0..f0de711 100644
>> --- a/src/mesa/drivers/dri/i965/brw_context.c
>> +++ b/src/mesa/drivers/dri/i965/brw_context.c
>> @@ -560,6 +560,12 @@ brw_initialize_context_constants(struct brw_context *brw)
>>        .lower_ffma = true,
>>     };
>>
>> +   bool use_nir_default[MESA_SHADER_STAGES];
>> +   use_nir_default[MESA_SHADER_VERTEX] = false;
>> +   use_nir_default[MESA_SHADER_GEOMETRY] = false;
>> +   use_nir_default[MESA_SHADER_FRAGMENT] = false;
>> +   use_nir_default[MESA_SHADER_COMPUTE] = false;
>
> How about memset to 0 for now to make sure all stages are set? We can
> add use_nir_default[MESA_SHADER_FOO] = true; after the memset to
> update the default for the shader stage.

Isn't this sufficient?

bool use_nir_default[MESA_SHADER_STAGES] = {false};

and use C99 designated initializers when we want to change the default
per-stage.


More information about the mesa-dev mailing list