[Mesa-dev] [PATCH 2/2] i965: don't drop const initializers in vector splitting
Jason Ekstrand
jason at jlekstrand.net
Sat Jun 25 14:29:17 UTC 2016
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
> + }
> + 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160625/20e67691/attachment.html>
More information about the mesa-dev
mailing list