radv/gfx10: emit the GS NGG prologue before the nested barrier
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 Jul 2019 13:51:32 +0000 (15:51 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 22 Jul 2019 07:02:39 +0000 (09:02 +0200)
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 27b46d2e1bad75825bb909fed0af9e9c00f8e7a6..fa1413bf8d09156b1ee9f11a96a5945a74915d78 100644 (file)
@@ -4455,6 +4455,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
                if (i) {
                        if (shaders[i]->info.stage == MESA_SHADER_GEOMETRY &&
                            ctx.options->key.vs_common_out.as_ngg) {
+                               gfx10_ngg_gs_emit_prologue(&ctx);
                                nested_barrier = false;
                        } else {
                                nested_barrier = true;
@@ -4497,12 +4498,6 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
 
                LLVMBasicBlockRef merge_block;
                if (shader_count >= 2 || is_ngg) {
-
-                       if (shaders[i]->info.stage == MESA_SHADER_GEOMETRY &&
-                           ctx.options->key.vs_common_out.as_ngg) {
-                               gfx10_ngg_gs_emit_prologue(&ctx);
-                       }
-
                        LLVMValueRef fn = LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx.ac.builder));
                        LLVMBasicBlockRef then_block = LLVMAppendBasicBlockInContext(ctx.ac.context, fn, "");
                        merge_block = LLVMAppendBasicBlockInContext(ctx.ac.context, fn, "");