diff options
author | Samuel Pitoiset <[email protected]> | 2018-02-26 14:05:05 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-02-27 10:09:27 +0100 |
commit | a549da877bcf641b3ef2d915d551cd49fb3f300e (patch) | |
tree | 85a542b54be21b12318d1f9f5bc7d013f32f9889 | |
parent | e683a797c6881ddb3b07cad8fdb84f77c6655c95 (diff) |
ac/nir: clean up a hack about rounding 2nd coord component
It's basically just the opposite, and it only makes sense to
round the layer for 2D texture arrays.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 8 |
1 files 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 8183e48bd3e..3f0bfedfa7d 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]); } |