ac/nir: make emit_barrier() non-static
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 9 Mar 2018 15:56:31 +0000 (16:56 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 13 Mar 2018 13:05:06 +0000 (14:05 +0100)
Required in order to move all RADV specific code outside of ac/nir.

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

index 73bd172a78451698f99480c0dad2ca7594bbd7d4..ceda8c540d6ca4d9636ef517b5dd6749b1f7a1e5 100644 (file)
@@ -3809,7 +3809,7 @@ static void emit_membar(struct ac_llvm_context *ac,
                ac_build_waitcnt(ac, waitcnt);
 }
 
-static void emit_barrier(struct ac_llvm_context *ac, gl_shader_stage stage)
+void ac_emit_barrier(struct ac_llvm_context *ac, gl_shader_stage stage)
 {
        /* SI only (thanks to a hw bug workaround):
         * The real barrier instruction isn’t needed, because an entire patch
@@ -4534,7 +4534,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
                emit_membar(&ctx->ac, instr);
                break;
        case nir_intrinsic_barrier:
-               emit_barrier(&ctx->ac, ctx->stage);
+               ac_emit_barrier(&ctx->ac, ctx->stage);
                break;
        case nir_intrinsic_shared_atomic_add:
        case nir_intrinsic_shared_atomic_imin:
@@ -6318,7 +6318,7 @@ write_tess_factors(struct radv_shader_context *ctx)
        LLVMValueRef lds_base, lds_inner = NULL, lds_outer, byteoffset, buffer;
        LLVMValueRef out[6], vec0, vec1, tf_base, inner[4], outer[4];
        int i;
-       emit_barrier(&ctx->ac, ctx->stage);
+       ac_emit_barrier(&ctx->ac, ctx->stage);
 
        switch (ctx->options->key.tcs.primitive_mode) {
        case GL_ISOLINES:
@@ -6891,7 +6891,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
                }
 
                if (i)
-                       emit_barrier(&ctx.ac, ctx.stage);
+                       ac_emit_barrier(&ctx.ac, ctx.stage);
 
                ac_setup_rings(&ctx);
 
index ee73d1cbbcd73595eb995b7c182e510c135a9f22..ebe18febbf2b79c66f288f73d81a6689e85f1ad0 100644 (file)
@@ -248,6 +248,8 @@ ac_handle_shader_output_decl(struct ac_llvm_context *ctx,
                             struct nir_variable *variable,
                             gl_shader_stage stage);
 
+void ac_emit_barrier(struct ac_llvm_context *ac, gl_shader_stage stage);
+
 bool ac_lower_subgroups(struct nir_shader *shader);
 
 #endif /* AC_NIR_TO_LLVM_H */