mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 11:50:09 +01:00
intel/compiler: Fix sparse cube map array coordinate lowering
Brown paper bag fix for my untested review feedback comments.
Cube array images use a coordinate of the form <X, Y, 6*Slice+Face>,
while cube array textures use a <X, Y, Slice, Face> style coordinate.
This code tried to convert one to the other, but instead of writing
Z / 6 and Z % 6, we tried to reuse our original division result. What
we wanted was Z - (Z/6) * 6, but instead we botched it and wrote Z-Z*6
which produced...totally invalid cube faces.
Fixes: fe81d40bff ("intel/nir: add lower for sparse images & textures")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24481>
This commit is contained in:
parent
2a580bba76
commit
95db3e87fe
1 changed files with 1 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ lower_sparse_image_load(nir_builder *b, nir_intrinsic_instr *intrin)
|
|||
nir_ssa_def *img_layer = nir_channel(b, intrin->src[1].ssa, 2);
|
||||
nir_ssa_def *tex_slice = nir_idiv(b, img_layer, nir_imm_int(b, 6));
|
||||
nir_ssa_def *tex_face =
|
||||
nir_iadd(b, img_layer, nir_ineg(b, nir_imul_imm(b, img_layer, 6)));
|
||||
nir_iadd(b, img_layer, nir_ineg(b, nir_imul_imm(b, tex_slice, 6)));
|
||||
nir_ssa_def *comps[4] = {
|
||||
nir_channel(b, intrin->src[1].ssa, 0),
|
||||
nir_channel(b, intrin->src[1].ssa, 1),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue