shader: preserve clamped scalar material selector provenance

This commit is contained in:
nmzik
2026-10-13 05:44:07 +02:00
parent 6309ac838d
commit fe6499b86e
4 changed files with 38 additions and 2 deletions
@@ -538,6 +538,8 @@ bool MaterializeIndirectDescriptor(const ResourcePlan& p
if (count < domain_count) keys.push_back(0u); // An out-of-bounds scalar read returns zero.
}
if (selector != nullptr && selector->byte_ranges.empty()) {
if (selector->maximum != UINT32_MAX)
for (auto& key: keys) key = std::min(key, selector->maximum);
std::ranges::sort(keys);
keys.erase(std::unique(keys.begin(), keys.end()), keys.end());
}