radeonsi: handle indirect constants gracefully
authorChristian König <deathsimple@vodafone.de>
Fri, 24 Aug 2012 10:55:34 +0000 (12:55 +0200)
committerChristian König <deathsimple@vodafone.de>
Mon, 3 Sep 2012 09:23:08 +0000 (11:23 +0200)
It's not supported yet, so at least don't try to crash the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/radeonsi/radeonsi_shader.c

index 2f417ecda52ec23c3ca95f2f535fb57f3d407bef..9734ab3ad0d134ac5c1793db9d5cb19ba245c360 100644 (file)
@@ -362,6 +362,13 @@ static LLVMValueRef fetch_constant(
        LLVMValueRef offset;
        LLVMValueRef load;
 
+       /* currently not supported */
+       if (reg->Register.Indirect) {
+               assert(0);
+               load = lp_build_const_int32(base->gallivm, 0);
+               return bitcast(bld_base, type, load);
+       }
+
        /* XXX: Assume the pointer to the constant buffer is being stored in
         * SGPR[0:1] */
        const_ptr = use_sgpr(base->gallivm, SGPR_CONST_PTR_F32, 0);