[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
Fri Jul 24 15:04:09 PDT 2015


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

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


More information about the mesa-dev mailing list