shader: bound scalar-read overlap checks by the bytes fixed-offset buffer writes reach

This commit is contained in:
nmzik
2026-10-21 03:48:25 +02:00
parent 70668fbd98
commit 68d0ba5a81
3 changed files with 20 additions and 7 deletions
@@ -941,8 +941,12 @@ void RenderExecutor::CommitBindings(CommandBuffer& buffer,
for (const auto& resource: program.info.buffers) {
if (!resource.written || resource.descriptor_index == UINT32_MAX) continue;
const auto& written = writer->buffer_sources[resource.descriptor_index];
if (written.size != 0 && ImageRangeOverlaps(address, size,
written.address, written.size)) {
// ADD_TID and swizzle move fixed-offset writes past write_extent.
const bool linear = (resource.packed_stride & ((1u << 14u) | (1u << 20u))) == 0u;
const auto written_size =
linear ? std::min<uint64_t>(written.size, resource.write_extent) : written.size;
if (written_size != 0 && ImageRangeOverlaps(address, size,
written.address, written_size)) {
EXIT("scalar resource reads overlap a shader buffer write\n");
}
}