[dxvk] Fixed reported size of staging buffers

Fixes staging slice allocation in Tomb Raider (2013),
and potentially other games which allocate large staging
buffers.
This commit is contained in:
Philip Rebohle 2018-01-24 15:44:40 +01:00
parent 363a0f8a6b
commit e4d49aeb66
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,6 @@ namespace dxvk {
Rc<DxvkPhysicalBuffer> DxvkBuffer::allocPhysicalBuffer(VkDeviceSize sliceCount) const {
TRACE(this, sliceCount);
return m_device->allocPhysicalBuffer(m_info, sliceCount, m_memFlags);
}

View File

@ -21,7 +21,9 @@ namespace dxvk {
VkDeviceSize DxvkStagingBuffer::freeBytes() const {
return m_bufferSize - m_bufferOffset;
return m_bufferSize >= m_bufferOffset
? m_bufferSize - m_bufferOffset
: VkDeviceSize(0);
}