Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl_codegen.c:
for (i = 0; i < 4; ++i) { if (writemask & (1u << i))
var_def->values[comp + i].state = VALUE_STATE_DYNAMICALLY_WRITTEN;
{
struct copy_propagation_trace *trace = &var_def->traces[comp + i];
/* Don't add an invalidate record if it is already invalidated. */
if (trace->record_count && trace->records[trace->record_count - 1].timestamp == time)
{
assert(!trace->records[trace->record_count - 1].statically_written);
continue;
}
Having this as an optimization is fine, if perhaps unnecessary, but why compare the timestamp here? Why would that cause problems?