ac/nir: init full exec mask for merged shaders.
authorDave Airlie <airlied@redhat.com>
Thu, 19 Oct 2017 04:29:02 +0000 (05:29 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 19 Oct 2017 23:50:40 +0000 (01:50 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c

index 949f181aace05c0517b2f4d0a8fa0b2316a14fca..e5cd23e02513e1182767076826a7d58e99dfe0e5 100644 (file)
@@ -1734,3 +1734,11 @@ void ac_optimize_vs_outputs(struct ac_llvm_context *ctx,
                *num_param_exports = exports.num;
        }
 }
+
+void ac_init_exec_full_mask(struct ac_llvm_context *ctx)
+{
+       LLVMValueRef full_mask = LLVMConstInt(ctx->i64, ~0ull, 0);
+       ac_build_intrinsic(ctx,
+                          "llvm.amdgcn.init.exec", ctx->voidt,
+                          &full_mask, 1, AC_FUNC_ATTR_CONVERGENT);
+}
index f0b5875b42391d70eb34f53ce66f7a003a37fad6..aa2a2899ab424b53b8a01dfd2c6b3b355f15bb42 100644 (file)
@@ -281,6 +281,7 @@ void ac_optimize_vs_outputs(struct ac_llvm_context *ac,
                            uint8_t *vs_output_param_offset,
                            uint32_t num_outputs,
                            uint8_t *num_param_exports);
+void ac_init_exec_full_mask(struct ac_llvm_context *ctx);
 #ifdef __cplusplus
 }
 #endif
index 44de834bd86dd76ea1e2ba4b7171a523d266aeb4..0e1c65ae813515f6b6825f4bce9e99ef31363363 100644 (file)
@@ -6488,6 +6488,9 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
        ctx.abi.load_ssbo = radv_load_ssbo;
        ctx.abi.load_sampler_desc = radv_get_sampler_desc;
 
+       if (shader_count >= 2)
+               ac_init_exec_full_mask(&ctx.ac);
+
        if (ctx.ac.chip_class == GFX9 &&
            shaders[shader_count - 1]->stage == MESA_SHADER_TESS_CTRL)
                ac_nir_fixup_ls_hs_input_vgprs(&ctx);