diff options
author | Jonathan Marek <[email protected]> | 2020-06-24 15:58:44 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-25 15:57:45 +0000 |
commit | 16a9e233da9a4ce64c876e2e69a8e9bb96436ff3 (patch) | |
tree | 95299cda662c7887da211164dfbaaa7ace9b2001 /src/freedreno/ir3/ir3_compiler_nir.c | |
parent | 01799b3448ca4e31bb83a79b95e8b7634fa2c8c7 (diff) |
freedreno/ir3: add support for load_draw_id
This is part of adding VK_KHR_shader_draw_parameters for turnip.
IR3_DP_VTXID_BASE/IR3_DP_VTXCNT_MAX offsets are changed to match what
CP_DRAW_INDIRECT_MULTI requires.
Signed-off-by: Jonathan Marek <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5635>
Diffstat (limited to 'src/freedreno/ir3/ir3_compiler_nir.c')
-rw-r--r-- | src/freedreno/ir3/ir3_compiler_nir.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 3c8007f5da3..42dc672423c 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1785,6 +1785,12 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr) } dst[0] = ctx->basevertex; break; + case nir_intrinsic_load_draw_id: + if (!ctx->draw_id) { + ctx->draw_id = create_driver_param(ctx, IR3_DP_DRAWID); + } + dst[0] = ctx->draw_id; + break; case nir_intrinsic_load_base_instance: if (!ctx->base_instance) { ctx->base_instance = create_driver_param(ctx, IR3_DP_INSTID_BASE); |