mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
shader: keep unbounded material selectors on bounded GPU heaps
This commit is contained in:
@@ -2103,7 +2103,7 @@ private:
|
||||
}
|
||||
|
||||
bool MatchScalarMaterialKey(Value key, DescriptorSource::IndirectDescriptor& indirect,
|
||||
DescriptorSource& material_source) {
|
||||
DescriptorSource& material_source, bool require_bound) {
|
||||
DescriptorSource::IndirectDescriptor::SelectorRead selector;
|
||||
const auto* read = SelectorReadValue(key, Value(true), selector);
|
||||
if (read == nullptr) return false;
|
||||
@@ -2160,6 +2160,9 @@ private:
|
||||
offset = static_cast<uint32_t>(affine.offset % divisor) & ~3u;
|
||||
}
|
||||
}
|
||||
// A bounded image heap already supports GPU selection. Only enumerate a
|
||||
// narrower proven selector domain instead of scanning unrelated material data.
|
||||
if (require_bound && count.IsEmpty() && !rows) return false;
|
||||
if (!MakeRuntimeTableSource(*read, material_source)) return false;
|
||||
selector.source = InternSource(material_source);
|
||||
selector.stride = stride;
|
||||
@@ -2635,7 +2638,8 @@ private:
|
||||
// only the image handle is projected onto the bounded workgroup key.
|
||||
plan.retain_reads = true;
|
||||
} else if (!plan.table_indexed &&
|
||||
MatchScalarMaterialKey(key, indirect, material_source)) {
|
||||
MatchScalarMaterialKey(key, indirect, material_source,
|
||||
table_source.dword_count == 4u)) {
|
||||
// Keep live descriptor payloads, but project descriptor-only SMEM onto
|
||||
// the GPU key using the same plan as other indirect image reads.
|
||||
plan.retain_reads |= table_source.dword_count == 4u;
|
||||
|
||||
Reference in New Issue
Block a user