mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-11 19:24:11 +01:00
[d3d11] Minor map optimization on deferred contexts
This commit is contained in:
parent
8d493d9445
commit
6c17fa075b
@ -94,6 +94,10 @@ namespace dxvk {
|
|||||||
return m_soCounter;
|
return m_soCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DxvkBufferSliceHandle AllocSlice() {
|
||||||
|
return m_buffer->allocSlice();
|
||||||
|
}
|
||||||
|
|
||||||
DxvkBufferSliceHandle DiscardSlice() {
|
DxvkBufferSliceHandle DiscardSlice() {
|
||||||
m_mapped = m_buffer->allocSlice();
|
m_mapped = m_buffer->allocSlice();
|
||||||
return m_mapped;
|
return m_mapped;
|
||||||
|
@ -165,9 +165,8 @@ namespace dxvk {
|
|||||||
UINT MapFlags,
|
UINT MapFlags,
|
||||||
D3D11DeferredContextMapEntry* pMapEntry) {
|
D3D11DeferredContextMapEntry* pMapEntry) {
|
||||||
D3D11Buffer* pBuffer = static_cast<D3D11Buffer*>(pResource);
|
D3D11Buffer* pBuffer = static_cast<D3D11Buffer*>(pResource);
|
||||||
const Rc<DxvkBuffer> buffer = pBuffer->GetBuffer();
|
|
||||||
|
|
||||||
if (!(buffer->memFlags() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) {
|
if (unlikely(pBuffer->GetMapMode() == D3D11_COMMON_BUFFER_MAP_MODE_NONE)) {
|
||||||
Logger::err("D3D11: Cannot map a device-local buffer");
|
Logger::err("D3D11: Cannot map a device-local buffer");
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
@ -182,7 +181,7 @@ namespace dxvk {
|
|||||||
// For resources that cannot be written by the GPU,
|
// For resources that cannot be written by the GPU,
|
||||||
// we may write to the buffer resource directly and
|
// we may write to the buffer resource directly and
|
||||||
// just swap in the buffer slice as needed.
|
// just swap in the buffer slice as needed.
|
||||||
pMapEntry->BufferSlice = buffer->allocSlice();
|
pMapEntry->BufferSlice = pBuffer->AllocSlice();
|
||||||
pMapEntry->MapPointer = pMapEntry->BufferSlice.mapPtr;
|
pMapEntry->MapPointer = pMapEntry->BufferSlice.mapPtr;
|
||||||
} else {
|
} else {
|
||||||
// For GPU-writable resources, we need a data slice
|
// For GPU-writable resources, we need a data slice
|
||||||
|
Loading…
Reference in New Issue
Block a user