summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-07-10 15:18:53 +0200
committerSamuel Pitoiset <[email protected]>2019-07-10 23:36:50 +0200
commitf653e5c1d6979812ade6323b4a40933ac1b329ed (patch)
treeeea54a48cdd81ae5893f94976623843117b6e245
parent14781e21227d036b8875bbdde9f343a8e73ceeb6 (diff)
radv: remove an extra memcpy when exporting clip/cull distances
Cleanup. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index bd14f9fff1b..c0ff3210bd2 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -2717,9 +2717,8 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
struct radv_vs_output_info *outinfo)
{
uint32_t param_count = 0;
- unsigned target;
unsigned pos_idx, num_pos_exports = 0;
- struct ac_export_args args, pos_args[4] = {};
+ struct ac_export_args pos_args[4] = {};
LLVMValueRef psize_value = NULL, layer_value = NULL, viewport_index_value = NULL;
int i;
@@ -2765,10 +2764,10 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
for (i = length; i < 4; i++)
slots[i] = LLVMGetUndef(ctx->ac.f32);
- target = V_008DFC_SQ_EXP_POS + 2 + (location - VARYING_SLOT_CLIP_DIST0);
- si_llvm_init_export_args(ctx, &slots[0], 0xf, target, &args);
- memcpy(&pos_args[target - V_008DFC_SQ_EXP_POS],
- &args, sizeof(args));
+ unsigned index = 2 + (location - VARYING_SLOT_CLIP_DIST0);
+ si_llvm_init_export_args(ctx, &slots[0], 0xf,
+ V_008DFC_SQ_EXP_POS + index,
+ &pos_args[index]);
if (export_clip_dists) {
/* Export the clip/cull distances values to the next stage. */