aco: don't vectorize 8/16bit load/store_ssbo
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 25 Feb 2020 10:52:08 +0000 (11:52 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Fri, 3 Apr 2020 22:13:15 +0000 (23:13 +0100)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002>

src/amd/compiler/aco_instruction_selection_setup.cpp

index 6caedc4347f2793699d4a21a7564b0e00b6abdd3..d7d294e7044dbd44bcf8e6ada3a3a097a0402da6 100644 (file)
@@ -706,9 +706,14 @@ mem_vectorize_callback(unsigned align, unsigned bit_size,
       return false;
 
    switch (low->intrinsic) {
-   case nir_intrinsic_load_ubo:
-   case nir_intrinsic_load_ssbo:
    case nir_intrinsic_store_ssbo:
+      if (low->src[0].ssa->bit_size < 32 || high->src[0].ssa->bit_size < 32)
+         return false;
+      return align % 4 == 0;
+   case nir_intrinsic_load_ssbo:
+      if (low->dest.ssa.bit_size < 32 || high->dest.ssa.bit_size < 32)
+         return false;
+   case nir_intrinsic_load_ubo:
    case nir_intrinsic_load_push_constant:
       return align % 4 == 0;
    case nir_intrinsic_load_deref: