summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-08-08 15:38:04 +0200
committerNicolai Hähnle <[email protected]>2016-08-09 15:56:04 +0200
commit8dbf2a857008599a9432d64c1363c5a1139e6acd (patch)
treeee898bbc19861d19caa794e839db5a863c3bb28e /src/gallium/drivers/radeonsi/si_shader.c
parentfebb5dbf7243d93f6f0e44a6dc4c0fe72cf4250c (diff)
radeonsi: add DRAWID parameter to vertex shaders
Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 2c00f56d7b0..2de20cb1bd0 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1668,6 +1668,11 @@ static void declare_system_value(
SI_PARAM_START_INSTANCE);
break;
+ case TGSI_SEMANTIC_DRAWID:
+ value = LLVMGetParam(radeon_bld->main_fn,
+ SI_PARAM_DRAWID);
+ break;
+
case TGSI_SEMANTIC_INVOCATIONID:
if (ctx->type == PIPE_SHADER_TESS_CTRL)
value = unpack_param(ctx, SI_PARAM_REL_IDS, 8, 5);
@@ -5460,7 +5465,8 @@ static void create_function(struct si_shader_context *ctx)
params[SI_PARAM_VERTEX_BUFFERS] = const_array(ctx->v16i8, SI_NUM_VERTEX_BUFFERS);
params[SI_PARAM_BASE_VERTEX] = ctx->i32;
params[SI_PARAM_START_INSTANCE] = ctx->i32;
- num_params = SI_PARAM_START_INSTANCE+1;
+ params[SI_PARAM_DRAWID] = ctx->i32;
+ num_params = SI_PARAM_DRAWID+1;
if (shader->key.vs.as_es) {
params[ctx->param_es2gs_offset = num_params++] = ctx->i32;