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>
(cherry picked from commit e2b9296146)
This commit is contained in:
Timothy Arceri 2018-01-16 17:45:30 +11:00 committed by Emil Velikov
parent ff06368950
commit 78e1165645

View file

@ -2527,8 +2527,11 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx,
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);
}
LLVMValueRef ret = results[0];