ac: fix buffer overflow bug in 64bit SSBO loads

Fixes: 441ee1e65b "radv/ac: Implement Float64 SSBO loads"

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Timothy Arceri 2018-01-16 17:45:30 +11:00
parent 409e15f26f
commit e2b9296146

View File

@ -2588,8 +2588,11 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx,
ctx->ac.i1false,
};
results[i] = ac_build_intrinsic(&ctx->ac, load_name, data_type, params, 5, 0);
int idx = i;
if (instr->dest.ssa.bit_size == 64)
idx = i > 1 ? 1 : 0;
results[idx] = ac_build_intrinsic(&ctx->ac, load_name, data_type, params, 5, 0);
}
assume(results[0]);