continue;
if (i >= VARYING_SLOT_VAR0 || i == VARYING_SLOT_PNTC ||
- i == VARYING_SLOT_PRIMITIVE_ID) {
+ i == VARYING_SLOT_PRIMITIVE_ID || i == VARYING_SLOT_LAYER) {
interp_param = *inputs;
interp_fs_input(ctx, index, interp_param, ctx->prim_mask,
inputs);
ctx->shader_info->fs.has_pcoord = true;
if (ctx->input_mask & (1 << VARYING_SLOT_PRIMITIVE_ID))
ctx->shader_info->fs.prim_id_input = true;
+ if (ctx->input_mask & (1 << VARYING_SLOT_LAYER))
+ ctx->shader_info->fs.layer_input = true;
ctx->shader_info->fs.input_mask = ctx->input_mask >> VARYING_SLOT_VAR0;
}
(1ull << VARYING_SLOT_CULL_DIST1));
ctx->shader_info->vs.prim_id_output = 0xffffffff;
+ ctx->shader_info->vs.layer_output = 0xffffffff;
if (clip_mask) {
LLVMValueRef slots[8];
unsigned j;
} else if (i == VARYING_SLOT_LAYER) {
ctx->shader_info->vs.writes_layer = true;
layer_value = values[0];
- continue;
+ ctx->shader_info->vs.layer_output = param_count;
+ target = V_008DFC_SQ_EXP_PARAM + param_count;
+ param_count++;
} else if (i == VARYING_SLOT_VIEWPORT) {
ctx->shader_info->vs.writes_viewport_index = true;
viewport_index_value = values[0];
++ps_offset;
}
+ if (ps->info.fs.layer_input && (vs->info.vs.layer_output != 0xffffffff)) {
+ unsigned vs_offset, flat_shade;
+ unsigned val;
+ vs_offset = vs->info.vs.layer_output;
+ flat_shade = true;
+ val = S_028644_OFFSET(vs_offset) | S_028644_FLAT_SHADE(flat_shade);
+ radeon_set_context_reg(cmd_buffer->cs, R_028644_SPI_PS_INPUT_CNTL_0 + 4 * ps_offset, val);
+ ++ps_offset;
+ }
+
for (unsigned i = 0; i < 32 && (1u << i) <= ps->info.fs.input_mask; ++i) {
unsigned vs_offset, flat_shade;
unsigned val;
if (vs_offset >= vs->info.vs.prim_id_output)
vs_offset++;
}
+ if (vs->info.vs.layer_output != 0xffffffff) {
+ if (vs_offset >= vs->info.vs.layer_output)
+ vs_offset++;
+ }
flat_shade = !!(ps->info.fs.flat_shaded_mask & (1u << ps_offset));
val = S_028644_OFFSET(vs_offset) | S_028644_FLAT_SHADE(flat_shade);