summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-05-19 18:17:12 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-05 12:33:48 +0200
commit68915f48897f9c1df581ab834a8496e5c436fdba (patch)
tree1475aba1575360b110345a4f83965c070027211d
parent18018d52c3794b9c97771ce0949e1177f42e919a (diff)
radeonsi: pass si_shader_context to get_primitive_id
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 2d78967d88..0619c0f8fd 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -601,11 +601,10 @@ static void declare_input_vs(
}
}
-static LLVMValueRef get_primitive_id(struct lp_build_tgsi_context *bld_base,
+
+static LLVMValueRef get_primitive_id(struct si_shader_context *ctx,
unsigned swizzle)
{
- struct si_shader_context *ctx = si_shader_context(bld_base);
-
if (swizzle > 0)
return ctx->i32_0;
@@ -1149,7 +1148,7 @@ static LLVMValueRef fetch_input_gs(
LLVMValueRef value;
if (swizzle != ~0 && semantic_name == TGSI_SEMANTIC_PRIMID)
- return get_primitive_id(bld_base, swizzle);
+ return get_primitive_id(ctx, swizzle);
if (!reg->Register.Dimension)
return NULL;
@@ -1638,7 +1637,7 @@ static void declare_system_value(struct si_shader_context *ctx,
}
case TGSI_SEMANTIC_PRIMID:
- value = get_primitive_id(&ctx->bld_base, 0);
+ value = get_primitive_id(ctx, 0);
break;
case TGSI_SEMANTIC_GRID_SIZE:
@@ -3071,7 +3070,7 @@ static void si_llvm_emit_vs_epilogue(struct lp_build_tgsi_context *bld_base)
outputs[i].semantic_name = TGSI_SEMANTIC_PRIMID;
outputs[i].semantic_index = 0;
outputs[i].values[0] = bitcast(bld_base, TGSI_TYPE_FLOAT,
- get_primitive_id(bld_base, 0));
+ get_primitive_id(ctx, 0));
for (j = 1; j < 4; j++)
outputs[i].values[j] = LLVMConstReal(ctx->f32, 0);