[Mesa-dev] [PATCH v2] ac/nir: clean up a hack about rounding 2nd coord component

Bas Nieuwenhuizen basni at chromium.org
Mon Feb 26 14:06:11 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Mon, Feb 26, 2018 at 2:05 PM, Samuel Pitoiset <samuel.pitoiset at gmail.com>
wrote:

> It's basically just the opposite, and it only makes sense to
> round the layer for 2D texture arrays.
>
> v2: - add SUBPASS
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_
> llvm.c
> index 2c5a6e6cf6..b6392ae380 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -5082,9 +5082,11 @@ static void visit_tex(struct ac_nir_context *ctx,
> nir_tex_instr *instr)
>                         address[count++] = coords[1];
>                 }
>                 if (instr->coord_components > 2) {
> -                       /* This seems like a bit of a hack - but it passes
> Vulkan CTS with it */
> -                       if (instr->sampler_dim != GLSL_SAMPLER_DIM_3D &&
> -                           instr->sampler_dim != GLSL_SAMPLER_DIM_CUBE &&
> +                       if ((instr->sampler_dim == GLSL_SAMPLER_DIM_2D ||
> +                            instr->sampler_dim == GLSL_SAMPLER_DIM_MS ||
> +                            instr->sampler_dim ==
> GLSL_SAMPLER_DIM_SUBPASS ||
> +                            instr->sampler_dim ==
> GLSL_SAMPLER_DIM_SUBPASS_MS) &&
> +                           instr->is_array &&
>                             instr->op != nir_texop_txf) {
>                                 coords[2] = apply_round_slice(&ctx->ac,
> coords[2]);
>                         }
> --
> 2.16.2
>
> _______________________________________________
> 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/20180226/709cc70a/attachment.html>


More information about the mesa-dev mailing list