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:
parent
08b9b0eb44
commit
897e7816f0
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user