mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
ir3: Implement ViewIndex for GS
For GS, the ViewIndex is passed through from the DS/VS in a similar manner to PrimID. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40153>
This commit is contained in:
parent
2d4bb4cdc6
commit
bc72ef2ee9
1 changed files with 16 additions and 0 deletions
|
|
@ -5554,6 +5554,8 @@ emit_instructions(struct ir3_context *ctx)
|
||||||
create_sysval_input(ctx, SYSTEM_VALUE_GS_HEADER_IR3, 0x1);
|
create_sysval_input(ctx, SYSTEM_VALUE_GS_HEADER_IR3, 0x1);
|
||||||
ctx->primitive_id =
|
ctx->primitive_id =
|
||||||
create_sysval_input(ctx, SYSTEM_VALUE_PRIMITIVE_ID, 0x1);
|
create_sysval_input(ctx, SYSTEM_VALUE_PRIMITIVE_ID, 0x1);
|
||||||
|
ctx->view_index =
|
||||||
|
create_sysval_input(ctx, SYSTEM_VALUE_VIEW_INDEX, 0x1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MESA_SHADER_TESS_CTRL:
|
case MESA_SHADER_TESS_CTRL:
|
||||||
|
|
@ -5872,6 +5874,18 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
|
||||||
outputs_count++;
|
outputs_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (so->type == MESA_SHADER_VERTEX && ctx->view_index) {
|
||||||
|
unsigned n = so->outputs_count++;
|
||||||
|
so->outputs[n].slot = VARYING_SLOT_VIEW_INDEX;
|
||||||
|
|
||||||
|
struct ir3_instruction *out =
|
||||||
|
ir3_collect(&ctx->build, ctx->view_index);
|
||||||
|
outputs[outputs_count] = out;
|
||||||
|
outidxs[outputs_count] = n;
|
||||||
|
regids[outputs_count] = regid(0, 2);
|
||||||
|
outputs_count++;
|
||||||
|
}
|
||||||
|
|
||||||
if (so->type == MESA_SHADER_VERTEX && ctx->rel_patch_id) {
|
if (so->type == MESA_SHADER_VERTEX && ctx->rel_patch_id) {
|
||||||
unsigned n = so->outputs_count++;
|
unsigned n = so->outputs_count++;
|
||||||
so->outputs[n].slot = VARYING_SLOT_REL_PATCH_ID_IR3;
|
so->outputs[n].slot = VARYING_SLOT_REL_PATCH_ID_IR3;
|
||||||
|
|
@ -6106,6 +6120,8 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
|
||||||
ctx->gs_header->dsts[0]->num = regid(0, 0);
|
ctx->gs_header->dsts[0]->num = regid(0, 0);
|
||||||
if (ctx->primitive_id)
|
if (ctx->primitive_id)
|
||||||
ctx->primitive_id->dsts[0]->num = regid(0, 1);
|
ctx->primitive_id->dsts[0]->num = regid(0, 1);
|
||||||
|
if (ctx->view_index)
|
||||||
|
ctx->view_index->dsts[0]->num = regid(0, 2);
|
||||||
} else if (so->num_sampler_prefetch) {
|
} else if (so->num_sampler_prefetch) {
|
||||||
assert(so->type == MESA_SHADER_FRAGMENT);
|
assert(so->type == MESA_SHADER_FRAGMENT);
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue