radv: fix setting the number of entries for GSVS on VI+
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 13 Sep 2018 13:58:01 +0000 (15:58 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Sep 2018 08:59:52 +0000 (10:59 +0200)
According to RadeonSI, it's unnecessary to multiply by
the stride. That field seems to always be 64.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c

index e3f63ce5f76be3142d0ba3411a11e3f009c4025a..a6dbcd2a8b14e16082f8603a0e84fb161fa1f30e 100644 (file)
@@ -3140,15 +3140,12 @@ ac_setup_rings(struct radv_shader_context *ctx)
        if (ctx->stage == MESA_SHADER_GEOMETRY) {
                LLVMValueRef tmp;
                uint32_t num_entries = 64;
-               LLVMValueRef gsvs_ring_stride = LLVMConstInt(ctx->ac.i32, ctx->max_gsvs_emit_size, false);
                LLVMValueRef gsvs_ring_desc = LLVMConstInt(ctx->ac.i32, ctx->max_gsvs_emit_size << 16, false);
                ctx->gsvs_ring = ac_build_load_to_sgpr(&ctx->ac, ctx->ring_offsets, LLVMConstInt(ctx->ac.i32, RING_GSVS_GS, false));
 
                ctx->gsvs_ring = LLVMBuildBitCast(ctx->ac.builder, ctx->gsvs_ring, ctx->ac.v4i32, "");
 
                tmp = LLVMConstInt(ctx->ac.i32, num_entries, false);
-               if (ctx->options->chip_class >= VI)
-                       tmp = LLVMBuildMul(ctx->ac.builder, gsvs_ring_stride, tmp, "");
                ctx->gsvs_ring = LLVMBuildInsertElement(ctx->ac.builder, ctx->gsvs_ring, tmp, LLVMConstInt(ctx->ac.i32, 2, false), "");
                tmp = LLVMBuildExtractElement(ctx->ac.builder, ctx->gsvs_ring, ctx->ac.i32_1, "");
                tmp = LLVMBuildOr(ctx->ac.builder, tmp, gsvs_ring_desc, "");