mirror of https://github.com/doitsujin/dxvk
[d3d9] Return empty buffer slice for out-of-bounds offsets
Fixes #3715.
This commit is contained in:
parent
1cb58b0732
commit
ea3149801f
|
@ -125,7 +125,12 @@ namespace dxvk {
|
|||
|
||||
template <D3D9_COMMON_BUFFER_TYPE Type>
|
||||
inline DxvkBufferSlice GetBufferSlice(VkDeviceSize offset, VkDeviceSize length) const {
|
||||
return DxvkBufferSlice(GetBuffer<Type>(), offset, length);
|
||||
if (likely(length && offset < m_desc.Size)) {
|
||||
return DxvkBufferSlice(GetBuffer<Type>(), offset,
|
||||
std::min<VkDeviceSize>(m_desc.Size - offset, length));
|
||||
}
|
||||
|
||||
return DxvkBufferSlice();
|
||||
}
|
||||
|
||||
inline DxvkBufferSliceHandle AllocMapSlice() {
|
||||
|
|
Loading…
Reference in New Issue