if (!(ctx->input_mask & (1ull << i)))
continue;
- if (i >= VARYING_SLOT_VAR0 || i == VARYING_SLOT_PNTC) {
+ if (i >= VARYING_SLOT_VAR0 || i == VARYING_SLOT_PNTC ||
+ i == VARYING_SLOT_PRIMITIVE_ID) {
interp_param = *inputs;
interp_fs_input(ctx, index, interp_param, ctx->prim_mask,
inputs);
ctx->shader_info->fs.num_interp = index;
if (ctx->input_mask & (1 << VARYING_SLOT_PNTC))
ctx->shader_info->fs.has_pcoord = true;
+ if (ctx->input_mask & (1 << VARYING_SLOT_PRIMITIVE_ID))
+ ctx->shader_info->fs.prim_id_input = true;
ctx->shader_info->fs.input_mask = ctx->input_mask >> VARYING_SLOT_VAR0;
}
(1ull << VARYING_SLOT_CULL_DIST0) |
(1ull << VARYING_SLOT_CULL_DIST1));
+ ctx->shader_info->vs.prim_id_output = 0xffffffff;
if (clip_mask) {
LLVMValueRef slots[8];
unsigned j;
ctx->shader_info->vs.writes_viewport_index = true;
viewport_index_value = values[0];
continue;
+ } else if (i == VARYING_SLOT_PRIMITIVE_ID) {
+ ctx->shader_info->vs.prim_id_output = param_count;
+ target = V_008DFC_SQ_EXP_PARAM + param_count;
+ param_count++;
} else if (i >= VARYING_SLOT_VAR0) {
ctx->shader_info->vs.export_mask |= 1u << (i - VARYING_SLOT_VAR0);
target = V_008DFC_SQ_EXP_PARAM + param_count;