summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2019-05-07 22:52:27 +0200
committerMarek Olšák <[email protected]>2019-07-03 15:51:12 -0400
commit04e27ec136e454700f395565a91a35035cce56dd (patch)
tree9d8fee96b203117db3173a68c69bf43f0f0d573d /src/gallium
parent5059a4df8aa855aa62ebcb6eb2ee66357407ca04 (diff)
radeonsi: make get_primitive_id externally visible
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c10
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_internal.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 1189f776deb..80bc43c7536 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h
index e7689520968..0c81fb64cda 100644
--- a/src/gallium/drivers/radeonsi/si_shader_internal.h
+++ b/src/gallium/drivers/radeonsi/si_shader_internal.h
@@ -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);