radeonsi: fix indirect loads of 64 bit constants
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 13 Oct 2016 09:19:50 +0000 (11:19 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 17 Oct 2016 17:08:36 +0000 (19:08 +0200)
This fixes GL45-CTS.compute_shader.fp64-case3.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index e6edd902c7f7c1a58b1169769789e1206fc31bda..1ae111a0dc1a654d1751dfba474fb2128e8a6b7d 100644 (file)
@@ -1914,11 +1914,11 @@ static LLVMValueRef fetch_constant(
                result = bitcast(bld_base, type, result);
        else {
                LLVMValueRef addr2, result2;
-               addr2 = ctx->radeon_bld.soa.addr[ireg->Index][ireg->Swizzle + 1];
+               addr2 = ctx->radeon_bld.soa.addr[ireg->Index][ireg->Swizzle];
                addr2 = LLVMBuildLoad(base->gallivm->builder, addr2, "load addr reg2");
                addr2 = lp_build_mul_imm(&bld_base->uint_bld, addr2, 16);
                addr2 = lp_build_add(&bld_base->uint_bld, addr2,
-                                    lp_build_const_int32(base->gallivm, idx * 4));
+                                    lp_build_const_int32(base->gallivm, (idx + 1) * 4));
 
                result2 = buffer_load_const(ctx, bufp, addr2);