radeonsi: handle doubles in lds load path.
authorDave Airlie <airlied@redhat.com>
Wed, 9 Dec 2015 07:02:01 +0000 (17:02 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 9 Dec 2015 07:03:38 +0000 (17:03 +1000)
This handles loading doubles from LDS properly.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: "11.0 11.1" <mesa-stable@lists.fedoraproject.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeonsi/si_shader.c

index 14f12dfb8213fa29e83306ce6ad6c7e22891c632..e2cf27dcce94fe8370d561dd6d06bb536c59f73d 100644 (file)
@@ -594,6 +594,14 @@ static LLVMValueRef lds_load(struct lp_build_tgsi_context *bld_base,
                            lp_build_const_int32(gallivm, swizzle));
 
        value = build_indexed_load(si_shader_ctx, si_shader_ctx->lds, dw_addr);
+       if (type == TGSI_TYPE_DOUBLE) {
+               LLVMValueRef value2;
+               dw_addr = lp_build_add(&bld_base->uint_bld, dw_addr,
+                                      lp_build_const_int32(gallivm, swizzle + 1));
+               value2 = build_indexed_load(si_shader_ctx, si_shader_ctx->lds, dw_addr);
+               return radeon_llvm_emit_fetch_double(bld_base, value, value2);
+       }
+
        return LLVMBuildBitCast(gallivm->builder, value,
                                tgsi2llvmtype(bld_base, type), "");
 }