1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[d3d11] Don't return undefined slices from GetBufferSlice

Instead, return a slice with length zero.
This commit is contained in:
Philip Rebohle 2022-08-07 15:32:46 +02:00
parent 08b9b0eb44
commit 897e7816f0
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -80,18 +80,14 @@ namespace dxvk {
DxvkBufferSlice GetBufferSlice(VkDeviceSize offset) const {
VkDeviceSize size = m_desc.ByteWidth;
return likely(offset < size)
? DxvkBufferSlice(m_buffer, offset, size - offset)
: DxvkBufferSlice();
offset = std::min(offset, size);
return DxvkBufferSlice(m_buffer, offset, size - offset);
}
DxvkBufferSlice GetBufferSlice(VkDeviceSize offset, VkDeviceSize length) const {
VkDeviceSize size = m_desc.ByteWidth;
return likely(offset < size)
? DxvkBufferSlice(m_buffer, offset, std::min(length, size - offset))
: DxvkBufferSlice();
offset = std::min(offset, size);
return DxvkBufferSlice(m_buffer, offset, std::min(length, size - offset));
}
DxvkBufferSlice GetSOCounter() {