diff options
author | Marek Olšák <marek.olsak@amd.com> | 2018-01-30 19:40:43 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-02-01 16:20:19 +0100 |
commit | 71c6f64e54c72bbe023afd1af754b046555af442 (patch) | |
tree | defe59cd9fe30232b7f68b28eb6693d26fecf9c3 /src | |
parent | b0a6053a995abc4dbf29a19d78a4e0d661df16ae (diff) |
radeonsi: use ac_build_buffer_load_format for image buffer loads
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c index d89907e117..84d483abe2 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c @@ -566,11 +566,17 @@ static void load_emit( } if (inst->Memory.Texture == TGSI_TEXTURE_BUFFER) { + unsigned num_channels = util_last_bit(inst->Dst[0].Register.WriteMask); + LLVMValueRef result = + ac_build_buffer_load_format(&ctx->ac, + emit_data->args[0], + emit_data->args[1], + emit_data->args[2], + num_channels, + LLVMConstIntGetZExtValue(emit_data->args[3]), + can_speculate); emit_data->output[emit_data->chan] = - lp_build_intrinsic( - builder, "llvm.amdgcn.buffer.load.format.v4f32", emit_data->dst_type, - emit_data->args, emit_data->arg_count, - ac_get_load_intr_attribs(can_speculate)); + ac_build_expand_to_vec4(&ctx->ac, result, num_channels); } else { ac_get_image_intr_name("llvm.amdgcn.image.load", emit_data->dst_type, /* vdata */ |