amd/lower_mem_access_bit_sizes: don't create subdword UBO loads with LLVM

These are unsupported.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14127
Fixes: fbf0399517 ("amd/lower_mem_access_bit_sizes: lower all SMEM instructions to supported sizes")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
(cherry picked from commit 79b2fa785d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38010>
This commit is contained in:
Rhys Perry 2025-10-20 10:44:07 +01:00 committed by Dylan Baker
parent 2a8f2ff397
commit e967da84a8
2 changed files with 5 additions and 2 deletions

View file

@ -244,7 +244,7 @@
"description": "amd/lower_mem_access_bit_sizes: don't create subdword UBO loads with LLVM",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "fbf0399517aefea0485df5f8fd43ac065e01443c",
"notes": null

View file

@ -122,8 +122,11 @@ lower_mem_access_cb(nir_intrinsic_op intrin, uint8_t bytes, uint8_t bit_size, ui
}
if (is_smem) {
const bool supported_subdword = cb_data->gfx_level >= GFX12 &&
intrin != nir_intrinsic_load_push_constant &&
(!cb_data->use_llvm || intrin != nir_intrinsic_load_ubo);
/* Round up subdword loads if unsupported. */
const bool supported_subdword = cb_data->gfx_level >= GFX12 && intrin != nir_intrinsic_load_push_constant;
if (bit_size < 32 && (bytes >= 3 || !supported_subdword))
bytes = align(bytes, 4);