mesa/src/amd/compiler/instruction_selection
Pierre-Eric Pelloux-Prayer 3bcbd11a33 aco/isel: fix visit_tex handling of is_sparse
For cases when less than 4 components are read, the original code
would compute an incorrect dmask. eg: with a single component + is_sparse,
the dmask was 0x13:
  - 0x 3 = coming from nir_def_components_read
  - 0x10 = the sparse bit
While it should have at 2 bits set (1 for the color/depth, 1 for tfe).

This caused problem when expand_vector() used the dmask to generate
the final results, because the value for the sparse component was
read from the wrong index.

So after the call to emit_mimg() dmask needs to be adjusted
because the components will be stored in order, so if mask is 0x11
the tfe value would be stored at invalid index=5 (while it should
be at index=1).

This fixes KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_2d_depth_component16
and KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_2d_depth_component16
with ACO.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
..
aco_instruction_selection.h aco/isel: move visit_intrinsic() into separate file 2025-05-16 11:01:19 +00:00
aco_isel_cfg.cpp aco/isel: move control-flow helper functions into separate file 2025-05-16 11:01:19 +00:00
aco_isel_helpers.cpp
aco_isel_setup.cpp
aco_select_nir.cpp aco/isel: fix visit_tex handling of is_sparse 2025-06-11 12:11:28 +00:00
aco_select_nir_alu.cpp aco: do not use v_cvt_pk_u8_f32 for f2u8 2025-06-10 07:32:04 +00:00
aco_select_nir_intrinsics.cpp aco/isel: use vector-aligned operands for image_bvh64_intersect_ray 2025-05-28 09:24:17 +00:00
aco_select_ps_epilog.cpp aco/isel: move select_ps_epilog() into separate file 2025-05-16 11:01:19 +00:00
aco_select_ps_prolog.cpp aco/isel: move select_ps_prolog() into separate file 2025-05-16 11:01:19 +00:00
aco_select_rt_prolog.cpp aco/isel: move select_rt_prolog() into separate file 2025-05-16 11:01:19 +00:00
aco_select_trap_handler.cpp aco/isel: move select_trap_handler_shader() into separate file 2025-05-16 11:01:19 +00:00
aco_select_vs_prolog.cpp aco/isel: move select_vs_prolog() into separate file 2025-05-16 11:01:19 +00:00