ac/nir: for ubo load use correct num_components
authorDave Airlie <airlied@redhat.com>
Tue, 31 Oct 2017 01:29:54 +0000 (11:29 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Nov 2017 04:54:19 +0000 (14:54 +1000)
I was hacking something stupid in doom, and hit an assert for the bitcast
following this, it definitely looks like this should be the number of 32-bit
components, not the instr level ones.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 38a65b9cd13b2fb6ddf2362aa6f7d1273b4f4c92..2ae656693fc63e54f0dcf998a0942b97ed2a9008 100644 (file)
@@ -2467,7 +2467,7 @@ static LLVMValueRef visit_load_ubo_buffer(struct ac_nir_context *ctx,
        }
 
 
-       ret = ac_build_gather_values(&ctx->ac, results, instr->num_components);
+       ret = ac_build_gather_values(&ctx->ac, results, num_components);
        return LLVMBuildBitCast(ctx->ac.builder, ret,
                                get_def_type(ctx, &instr->dest.ssa), "");
 }