summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-12-09 17:02:01 +1000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-12-12 19:39:03 +0000
commit300f807649e3d441f7d3e67c7ce687a0b18dfb57 (patch)
treedab7a2517d538c560a0727954d54c0f92652d91d
parent61a275b789b6009e2dabbb2e6585b3f18e9cd7e6 (diff)
radeonsi: handle doubles in lds load path.
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> (cherry picked from commit 8c9e40ac22ce5a60753172a8f95a120d84a3ec4c)
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 14f12dfb821..e2cf27dcce9 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -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), "");
}