radeonsi: make get_primitive_id externally visible
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 7 May 2019 20:52:27 +0000 (22:52 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_internal.h

index 1189f776debf3a16703319ad76770633cc3b3d27..80bc43c753620ed5069b5a6c9eb07fd6b8b8ec5c 100644 (file)
@@ -639,8 +639,8 @@ static void declare_input_vs(
        si_llvm_load_input_vs(ctx, input_index, out);
 }
 
-static LLVMValueRef get_primitive_id(struct si_shader_context *ctx,
-                                    unsigned swizzle)
+LLVMValueRef si_get_primitive_id(struct si_shader_context *ctx,
+                                unsigned swizzle)
 {
        if (swizzle > 0)
                return ctx->i32_0;
@@ -1625,7 +1625,7 @@ static LLVMValueRef fetch_input_gs(
 
        unsigned semantic_name = info->input_semantic_name[reg->Register.Index];
        if (swizzle != ~0 && semantic_name == TGSI_SEMANTIC_PRIMID)
-               return get_primitive_id(ctx, swizzle);
+               return si_get_primitive_id(ctx, swizzle);
 
        if (!reg->Register.Dimension)
                return NULL;
@@ -2111,7 +2111,7 @@ void si_load_system_value(struct si_shader_context *ctx,
        }
 
        case TGSI_SEMANTIC_PRIMID:
-               value = get_primitive_id(ctx, 0);
+               value = si_get_primitive_id(ctx, 0);
                break;
 
        case TGSI_SEMANTIC_GRID_SIZE:
@@ -3608,7 +3608,7 @@ static void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi,
        if (ctx->shader->key.mono.u.vs_export_prim_id) {
                outputs[i].semantic_name = TGSI_SEMANTIC_PRIMID;
                outputs[i].semantic_index = 0;
-               outputs[i].values[0] = ac_to_float(&ctx->ac, get_primitive_id(ctx, 0));
+               outputs[i].values[0] = ac_to_float(&ctx->ac, si_get_primitive_id(ctx, 0));
                for (j = 1; j < 4; j++)
                        outputs[i].values[j] = LLVMConstReal(ctx->f32, 0);
 
index e7689520968c737a927a1d25a15e5602a4f8b939..0c81fb64cda1bce00d82174a6266c46c42dfbf60 100644 (file)
@@ -346,6 +346,8 @@ void si_declare_compute_memory(struct si_shader_context *ctx);
 void si_tgsi_declare_compute_memory(struct si_shader_context *ctx,
                                    const struct tgsi_full_declaration *decl);
 
+LLVMValueRef si_get_primitive_id(struct si_shader_context *ctx,
+                                unsigned swizzle);
 void si_llvm_export_vs(struct si_shader_context *ctx,
                       struct si_shader_output_values *outputs,
                       unsigned noutput);