[Mesa-dev] [PATCH v2 20/78] nir-lower_io: Store data.location instead, in const_index[0] of store_output

Jason Ekstrand jason at jlekstrand.net
Sun Jul 26 14:11:43 PDT 2015


On Jul 26, 2015 2:09 PM, "Eduardo Lima Mitev" <elima at igalia.com> wrote:
>
> On 07/25/2015 12:04 AM, Jason Ekstrand wrote:
> > I think we already agreed to just copy data.location into
> > data.driver_location and we don't need this special-casing.
> >
> > Just making a note of it as I review.
> > --Jason
> >
>
> Yes, I have completely removed this patch from the series. Now all the
> agreed changes live in the patch that implements store_output intrinsic,
> which now looks like this:
>
>
https://github.com/Igalia/mesa/commit/c7bfd3e8f0fa5540b4728f712e8441c254d029ba

Those changes look fine.
>
> > On Thu, Jul 23, 2015 at 3:17 AM, Eduardo Lima Mitev <elima at igalia.com>
wrote:
> >> Non-scalar backends like i965's NIR-vec4  need the orginal variable's
varying
> >> value instead of the driver_location (due to the way URB file emission
is
> >> implemented). This patch stores variable's location in const_index[0]
instead of
> >> the current driver_location value, which is not needed.
> >> ---
> >>  src/glsl/nir/nir_lower_io.c | 12 ++++++++++--
> >>  1 file changed, 10 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
> >> index ccc832b..71a925c 100644
> >> --- a/src/glsl/nir/nir_lower_io.c
> >> +++ b/src/glsl/nir/nir_lower_io.c
> >> @@ -378,9 +378,17 @@ nir_lower_io_block(nir_block *block, void
*void_state)
> >>           nir_src indirect;
> >>           unsigned offset = get_io_offset(intrin->variables[0],
> >>                                           &intrin->instr, &indirect,
state);
> >> -         offset += intrin->variables[0]->var->data.driver_location;
> >>
> >> -         store->const_index[0] = offset;
> >> +         /* Some non-scalar backends (like i965's NIR-vec4) need the
orginal
> >> +          * variable's varying value instead of the driver_location.
> >> +          */
> >> +         if (!state->is_scalar) {
> >> +            store->const_index[0] =
> >> +               intrin->variables[0]->var->data.location + offset;
> >> +         } else {
> >> +            store->const_index[0] =
> >> +               intrin->variables[0]->var->data.driver_location +
offset;
> >> +         }
> >>
> >>           nir_src_copy(&store->src[0], &intrin->src[0],
state->mem_ctx);
> >>
> >> --
> >> 2.1.4
> >>
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150726/925e9aa0/attachment.html>


More information about the mesa-dev mailing list