From fdd0b367f6d502b3e93ad88bf8be9230638aff9b Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Fri, 14 Jul 2017 13:31:49 +0200 Subject: radeonsi/gfx9: fix vertex idx in ES with multiple waves per threadgroup --- src/gallium/drivers/radeonsi/si_shader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index b6dad60a64..116fcb00a8 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2997,7 +2997,12 @@ static void si_llvm_emit_es_epilogue(struct lp_build_tgsi_context *bld_base) if (ctx->screen->b.chip_class >= GFX9 && info->num_outputs) { unsigned itemsize_dw = es->selector->esgs_itemsize / 4; - lds_base = LLVMBuildMul(gallivm->builder, ac_get_thread_id(&ctx->ac), + LLVMValueRef vertex_idx = ac_get_thread_id(&ctx->ac); + LLVMValueRef wave_idx = unpack_param(ctx, ctx->param_merged_wave_info, 24, 4); + vertex_idx = LLVMBuildOr(gallivm->builder, vertex_idx, + LLVMBuildMul(gallivm->builder, wave_idx, + LLVMConstInt(ctx->i32, 64, false), ""), ""); + lds_base = LLVMBuildMul(gallivm->builder, vertex_idx, LLVMConstInt(ctx->i32, itemsize_dw, 0), ""); } -- cgit v1.2.3