[Mesa-dev] [PATCH 1/2] nir: Add a nir->info.uses_interp_var_at_offset flag.
Jason Ekstrand
jason at jlekstrand.net
Fri May 13 18:12:01 UTC 2016
On Fri, May 13, 2016 at 1:42 AM, Kenneth Graunke <kenneth at whitecape.org>
wrote:
> It would probably make more sense to set this from nir_gather_info()
> in case we manage to dead code eliminate these intrinsics. However,
> we haven't transitioned the GL driver to using that pass yet...
>
Please add it anyway so nir_gather_info doesn't get out-of-date.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/compiler/nir/glsl_to_nir.cpp | 3 +++
> src/compiler/nir/nir.h | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/src/compiler/nir/glsl_to_nir.cpp
> b/src/compiler/nir/glsl_to_nir.cpp
> index fb1d421..e82d98a 100644
> --- a/src/compiler/nir/glsl_to_nir.cpp
> +++ b/src/compiler/nir/glsl_to_nir.cpp
> @@ -1276,6 +1276,9 @@ nir_visitor::visit(ir_expression *ir)
> intrin->intrinsic == nir_intrinsic_interp_var_at_sample)
> intrin->src[0] =
> nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
>
> + if (intrin->intrinsic == nir_intrinsic_interp_var_at_offset)
> + shader->info.uses_interp_var_at_offset = true;
> +
> unsigned bit_size = glsl_get_bit_size(deref->type);
> add_instr(&intrin->instr, deref->type->vector_elements, bit_size);
>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 20927a2..d12792d 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -1710,6 +1710,9 @@ typedef struct nir_shader_info {
> /* Whether or not this shader ever uses textureGather() */
> bool uses_texture_gather;
>
> + /** Whether or not this shader uses nir_intrinsic_interp_var_at_offset
> */
> + bool uses_interp_var_at_offset;
> +
> /* Whether or not this shader uses the gl_ClipDistance output */
> bool uses_clip_distance_out;
>
> --
> 2.8.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160513/219a2cf0/attachment.html>
More information about the mesa-dev
mailing list