gpu: clamp resolved buffer ranges to storage buffer limits

This commit is contained in:
Almo7aya
2026-10-19 13:53:18 +02:00
parent fde0b98e69
commit cd4eab9d65
@@ -763,12 +763,13 @@ void RenderExecutor::FindBuffers(std::span<PreparedBindings* const> stages) {
}
}
}
} else {
const auto& graphics = m_context.GetGraphics();
const auto limit = uint64_t {graphics.GetPhysicalDeviceProperties().limits.maxStorageBufferRange} -
(graphics.StorageMinAlignment() - 1);
size = std::min({size, uint64_t {256} * 1024 * 1024, limit});
}
// PPSA15246
const auto& graphics = m_context.GetGraphics();
const auto limit =
uint64_t {graphics.GetPhysicalDeviceProperties().limits.maxStorageBufferRange} -
(graphics.StorageMinAlignment() - 1);
size = std::min({size, uint64_t {256} * 1024 * 1024, limit});
}
// Finite GPU descriptors can span sparse PRT holes; clamp only oversized/sentinel ranges.
if (size >= (uint64_t {1} << 30u) || descriptor.NumRecords() == UINT32_MAX) {