break;
}
}
- if (i == TGSI_INTERPOLATE_COUNT) {
- report_error( ctx, "Expected semantic or interpolate attribute" );
- return FALSE;
- }
}
cur = ctx->cur;
}
}
+ cur = ctx->cur;
+ eat_opt_white( &cur );
+ if (*cur == ',' && !is_vs_input) {
+ cur++;
+ eat_opt_white( &cur );
+ if (str_match_nocase_whole( &cur, tgsi_invariant_name )) {
+ decl.Declaration.Invariant = 1;
+ ctx->cur = cur;
+ } else {
+ report_error( ctx, "Expected semantic, interpolate attribute, or invariant ");
+ return FALSE;
+ }
+ }
+
advance = tgsi_build_full_declaration(
&decl,
ctx->tokens_cur,
unsigned first;
unsigned last;
unsigned array_id;
+ boolean invariant;
} output[UREG_MAX_OUTPUT];
unsigned nr_outputs, nr_output_regs;
unsigned index,
unsigned usage_mask,
unsigned array_id,
- unsigned array_size)
+ unsigned array_size,
+ boolean invariant)
{
unsigned i;
ureg->output[i].first = index;
ureg->output[i].last = index + array_size - 1;
ureg->output[i].array_id = array_id;
+ ureg->output[i].invariant = invariant;
ureg->nr_output_regs = MAX2(ureg->nr_output_regs, index + array_size);
ureg->nr_outputs++;
}
unsigned array_size)
{
return ureg_DECL_output_layout(ureg, name, index, 0,
- ureg->nr_output_regs, usage_mask, array_id, array_size);
+ ureg->nr_output_regs, usage_mask, array_id,
+ array_size, FALSE);
}
unsigned semantic_index,
unsigned streams,
unsigned usage_mask,
- unsigned array_id)
+ unsigned array_id,
+ boolean invariant)
{
union tgsi_any_token *out = get_tokens(ureg, DOMAIN_DECL, array_id ? 4 : 3);
out[0].decl.UsageMask = usage_mask;
out[0].decl.Semantic = 1;
out[0].decl.Array = array_id != 0;
+ out[0].decl.Invariant = invariant;
out[1].value = 0;
out[1].decl_range.First = first;
ureg->input[i].semantic_index,
0,
TGSI_WRITEMASK_XYZW,
- ureg->input[i].array_id);
+ ureg->input[i].array_id,
+ FALSE);
}
}
else {
ureg->input[i].semantic_index +
(j - ureg->input[i].first),
0,
- TGSI_WRITEMASK_XYZW, 0);
+ TGSI_WRITEMASK_XYZW, 0, FALSE);
}
}
}
ureg->system_value[i].semantic_name,
ureg->system_value[i].semantic_index,
0,
- TGSI_WRITEMASK_XYZW, 0);
+ TGSI_WRITEMASK_XYZW, 0, FALSE);
}
if (ureg->supports_any_inout_decl_range) {
ureg->output[i].semantic_index,
ureg->output[i].streams,
ureg->output[i].usage_mask,
- ureg->output[i].array_id);
+ ureg->output[i].array_id,
+ ureg->output[i].invariant);
}
}
else {
ureg->output[i].semantic_index +
(j - ureg->output[i].first),
ureg->output[i].streams,
- ureg->output[i].usage_mask, 0);
+ ureg->output[i].usage_mask,
+ 0,
+ ureg->output[i].invariant);
}
}
}
enum glsl_interp_mode interp;
enum glsl_base_type base_type;
ubyte usage_mask; /* GLSL-style usage-mask, i.e. single bit per double */
+ bool invariant;
};
static struct inout_decl *
unsigned num_components;
num_outputs++;
+ decl->invariant = var->data.invariant;
+
if (type_without_array->is_64bit())
component = component / 2;
if (type_without_array->vector_elements)
(enum tgsi_semantic) outputSemanticName[slot],
outputSemanticIndex[slot],
decl->gs_out_streams,
- slot, tgsi_usage_mask, decl->array_id, decl->size);
-
+ slot, tgsi_usage_mask, decl->array_id, decl->size, decl->invariant);
+ dst.Invariant = decl->invariant;
for (unsigned j = 0; j < decl->size; ++j) {
if (t->outputs[slot + j].File != TGSI_FILE_OUTPUT) {
/* The ArrayID is set up in dst_register */
t->outputs[slot + j] = dst;
t->outputs[slot + j].ArrayID = 0;
t->outputs[slot + j].Index += j;
+ t->outputs[slot + j].Invariant = decl->invariant;
}
}
}