llvmpipe: fix 8/16 bit global stores
authorDave Airlie <airlied@redhat.com>
Thu, 8 Oct 2020 02:47:06 +0000 (12:47 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 25 Oct 2020 22:30:04 +0000 (08:30 +1000)
Fixes:
CL vstore_half-float-global*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7309>

src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c

index 501f01f..0df4f6b 100644 (file)
@@ -834,6 +834,12 @@ static void emit_store_global(struct lp_build_nir_context *bld_base,
                                                       loop_state.counter, "");
       addr_ptr = global_addr_to_ptr(gallivm, addr_ptr, bit_size);
       switch (bit_size) {
+      case 8:
+         value_ptr = LLVMBuildBitCast(builder, value_ptr, LLVMInt8TypeInContext(gallivm->context), "");
+         break;
+      case 16:
+         value_ptr = LLVMBuildBitCast(builder, value_ptr, LLVMInt16TypeInContext(gallivm->context), "");
+         break;
       case 32:
          value_ptr = LLVMBuildBitCast(builder, value_ptr, LLVMInt32TypeInContext(gallivm->context), "");
          break;