aco: fix alignment check in emit_load
authorChia-I Wu <olvaffe@gmail.com>
Thu, 25 May 2023 21:01:44 +0000 (14:01 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 May 2023 16:02:34 +0000 (16:02 +0000)
align_offset already takes const_offset into consideration.  Remove the
adjustment.

Fixes: 542733dbbf7 ("aco: add emit_load helper")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9097
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23242>

src/amd/compiler/aco_instruction_selection.cpp

index fb6abaa..fd65bec 100644 (file)
@@ -4058,7 +4058,7 @@ emit_load(isel_context* ctx, Builder& bld, const LoadEmitInfo& info,
    unsigned const_offset = info.const_offset;
 
    const unsigned align_mul = info.align_mul ? info.align_mul : component_size;
-   unsigned align_offset = (info.align_offset + const_offset) % align_mul;
+   unsigned align_offset = info.align_offset % align_mul;
 
    unsigned bytes_read = 0;
    while (bytes_read < load_size) {