mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
radeonsi: fix array textures layer coordinate
Like for cube map (array) gather, we need to round to nearest on <= VI.
Fixes tests in dEQP-GLES3.functional.shaders.texture_functions.texture.*
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 87f7c7bd65)
[Juan A. Suarez: apply patch over si_shader.c]
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Conflicts:
src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
This commit is contained in:
parent
96f815aeab
commit
0ec2f628d1
1 changed files with 10 additions and 1 deletions
|
|
@ -4655,13 +4655,22 @@ static void tex_fetch_args(
|
|||
if (target == TGSI_TEXTURE_CUBE ||
|
||||
target == TGSI_TEXTURE_CUBE_ARRAY ||
|
||||
target == TGSI_TEXTURE_SHADOWCUBE ||
|
||||
target == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
|
||||
target == TGSI_TEXTURE_SHADOWCUBE_ARRAY) {
|
||||
ac_prepare_cube_coords(&ctx->ac,
|
||||
opcode == TGSI_OPCODE_TXD,
|
||||
target == TGSI_TEXTURE_CUBE_ARRAY ||
|
||||
target == TGSI_TEXTURE_SHADOWCUBE_ARRAY,
|
||||
opcode == TGSI_OPCODE_LODQ,
|
||||
coords, derivs);
|
||||
} else if (tgsi_is_array_sampler(target) &&
|
||||
opcode != TGSI_OPCODE_TXF &&
|
||||
opcode != TGSI_OPCODE_TXF_LZ &&
|
||||
ctx->screen->b.chip_class <= VI) {
|
||||
unsigned array_coord = target == TGSI_TEXTURE_1D_ARRAY ? 1 : 2;
|
||||
coords[array_coord] =
|
||||
ac_build_intrinsic(&ctx->ac, "llvm.rint.f32", ctx->f32,
|
||||
&coords[array_coord], 1, 0);
|
||||
}
|
||||
|
||||
if (opcode == TGSI_OPCODE_TXD)
|
||||
for (int i = 0; i < num_deriv_channels * 2; i++)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue