diff options
author | Dave Airlie <[email protected]> | 2017-03-15 15:45:05 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-04-04 05:39:07 +1000 |
commit | 303d22f319dadfaeba3cb49da8fc52eaa22ce2cd (patch) | |
tree | db439e3effe604ddcecfde4481c165625f4bd861 /src/amd/common/ac_nir_to_llvm.c | |
parent | 5821f676eedc908bf679d130eaa3f7c79d86970d (diff) |
radv/ac: round cube array coordinate before fixup.
This fixes:
dEQP-VK.glsl.texture_functions.texture.samplercubearray*
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common/ac_nir_to_llvm.c')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index da38331cea3..7ac9a1a3167 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4236,6 +4236,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) @@ -4263,7 +4265,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]; |