Re: [Mesa-dev] [PATCH 1/2] radv/ac: round cube array coordinate before fixup.

2017-04-03 Thread Bas Nieuwenhuizen
Series is:

Reviewed-by: Bas Nieuwenhuizen 

On Mon, Apr 3, 2017 at 5:46 AM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> This fixes:
> dEQP-VK.glsl.texture_functions.texture.samplercubearray*
>
> Signed-off-by: Dave Airlie 
> ---
>  src/amd/common/ac_nir_to_llvm.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 6985371..adba539 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -4237,6 +4237,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, 
> nir_tex_instr *instr)
> }
>
> if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE && coord) {
> +   if (instr->is_array && instr->op != nir_texop_lod)
> +   coords[3] = apply_round_slice(ctx, coords[3]);
> for (chan = 0; chan < instr->coord_components; chan++)
> coords[chan] = to_float(ctx, coords[chan]);
> if (instr->coord_components == 3)
> @@ -4264,7 +4266,9 @@ static void visit_tex(struct nir_to_llvm_context *ctx, 
> nir_tex_instr *instr)
> }
> 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->op != nir_texop_txf) {
> +   if (instr->sampler_dim != GLSL_SAMPLER_DIM_3D &&
> +   instr->sampler_dim != GLSL_SAMPLER_DIM_CUBE &&
> +   instr->op != nir_texop_txf) {
> coords[2] = apply_round_slice(ctx, coords[2]);
> }
> address[count++] = coords[2];
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] radv/ac: round cube array coordinate before fixup.

2017-04-02 Thread Dave Airlie
From: Dave Airlie 

This fixes:
dEQP-VK.glsl.texture_functions.texture.samplercubearray*

Signed-off-by: Dave Airlie 
---
 src/amd/common/ac_nir_to_llvm.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 6985371..adba539 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4237,6 +4237,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, 
nir_tex_instr *instr)
}
 
if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE && coord) {
+   if (instr->is_array && instr->op != nir_texop_lod)
+   coords[3] = apply_round_slice(ctx, coords[3]);
for (chan = 0; chan < instr->coord_components; chan++)
coords[chan] = to_float(ctx, coords[chan]);
if (instr->coord_components == 3)
@@ -4264,7 +4266,9 @@ static void visit_tex(struct nir_to_llvm_context *ctx, 
nir_tex_instr *instr)
}
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->op != nir_texop_txf) {
+   if (instr->sampler_dim != GLSL_SAMPLER_DIM_3D &&
+   instr->sampler_dim != GLSL_SAMPLER_DIM_CUBE &&
+   instr->op != nir_texop_txf) {
coords[2] = apply_round_slice(ctx, coords[2]);
}
address[count++] = coords[2];
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev