radv/gfx10: Do GS prologue outside of gs_threads if.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 11 Jul 2019 06:44:17 +0000 (08:44 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 Jul 2019 13:45:56 +0000 (15:45 +0200)
Mirror radeonsi.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_nir_to_llvm.c

index dc37c937155faf3e523f43620e302e6cd5e311a6..490b16a1f25dfd4c78a192deb285b2feabee53cf 100644 (file)
@@ -4372,6 +4372,12 @@ 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, "");
@@ -4383,11 +4389,6 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
                        LLVMBuildCondBr(ctx.ac.builder, cond, then_block, merge_block);
 
                        LLVMPositionBuilderAtEnd(ctx.ac.builder, then_block);
-
-                       if (shaders[i]->info.stage == MESA_SHADER_GEOMETRY &&
-                           ctx.options->key.vs_common_out.as_ngg) {
-                               gfx10_ngg_gs_emit_prologue(&ctx);
-                       }
                }
 
                if (shaders[i]->info.stage == MESA_SHADER_FRAGMENT)