[Mesa-dev] [PATCH v2 10/23] nir: handle doubles in nir_deref_get_const_initializer_load()

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Apr 4 07:35:19 UTC 2016



On 01/04/16 21:11, Jason Ekstrand wrote:
> On Thu, Mar 31, 2016 at 2:59 AM, Samuel Iglesias Gonsálvez <
> siglesias at igalia.com> wrote:
> 
>> From: Connor Abbott <connor.w.abbott at intel.com>
>>
>> ---
>>  src/compiler/nir/nir.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
>> index 56a5009..35ad2b3 100644
>> --- a/src/compiler/nir/nir.c
>> +++ b/src/compiler/nir/nir.c
>> @@ -698,6 +698,8 @@ nir_deref_get_const_initializer_load(nir_shader
>> *shader, nir_deref_var *deref)
>>        nir_load_const_instr_create(shader,
>> glsl_get_vector_elements(tail->type),
>>                                    32);
>>
>> +   load->def.bit_size = glsl_get_bit_size(glsl_get_base_type(tail->type));
>>
> 
> This should just be passed into the load_const_initializer_create() above.
> 

Oh, I missed it.

Thanks!

Sam

> 
>> +
>>     matrix_offset *= load->def.num_components;
>>     for (unsigned i = 0; i < load->def.num_components; i++) {
>>        switch (glsl_get_base_type(tail->type)) {
>> @@ -706,6 +708,9 @@ nir_deref_get_const_initializer_load(nir_shader
>> *shader, nir_deref_var *deref)
>>        case GLSL_TYPE_UINT:
>>           load->value.u32[i] = constant->value.u[matrix_offset + i];
>>           break;
>> +      case GLSL_TYPE_DOUBLE:
>> +         load->value.f64[i] = constant->value.d[matrix_offset + i];
>> +         break;
>>        case GLSL_TYPE_BOOL:
>>           load->value.u32[i] = constant->value.b[matrix_offset + i] ?
>>                               NIR_TRUE : NIR_FALSE;
>> --
>> 2.5.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> 


More information about the mesa-dev mailing list