[Mesa-dev] [PATCH 2/2] i965: don't drop const initializers in vector splitting

Rob Clark robdclark at gmail.com
Sat Jun 25 14:52:52 UTC 2016


On Sat, Jun 25, 2016 at 10:29 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
> On Jun 25, 2016 5:39 AM, "Rob Clark" <robdclark at gmail.com> wrote:
>>
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> Not entirely sure how we didn't hit this before, but dropping the const
>> initializer on the floor is obviously not correct.
>>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>> ---
>> No idea why i965 even still uses this pass, vs nir scalarizing pass.
>> So might want to drop this.  But I figured fixing it first gives
>> something that can be cherry-picked to release branches, so this
>> patch should land before deleting the ir pass.
>>
>>  src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
>> b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
>> index 5fe24de..7c58089 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
>> @@ -372,6 +372,18 @@ brw_do_vector_splitting(exec_list *instructions)
>>
>>           ralloc_free(name);
>>
>> +         if (entry->var->constant_initializer) {
>> +            ir_constant_data data = {0};
>> +            assert(entry->var->data.has_initializer);
>> +            if (entry->var->type->is_double()) {
>> +               data.d[i] = entry->var->constant_initializer->value.d[i];
>
> I think you want data.d[0] on the l left hands side.
>
>> +            } else {
>> +               data.u[i] = entry->var->constant_initializer->value.u[i];
>
> Same here

oh, yes ofc..  I should have known only having a way to test it w/
zero's would bite me :-P

fixed up locally

BR,
-R

>> +            }
>> +            entry->components[i]->data.has_initializer = true;
>> +            entry->components[i]->constant_initializer =
>> new(entry->components[i]) ir_constant(type, &data);
>> +         }
>> +
>>          entry->var->insert_before(entry->components[i]);
>>        }
>>
>> --
>> 2.7.4
>>
>> _______________________________________________
>> 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