mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[d3d11] Pre-clear buffers with D3D11_USAGE_DEFAULT
Some games may expect buffers, like images, to be pre-initialized.
This commit is contained in:
parent
51104c104d
commit
a39b9cb131
@ -1851,6 +1851,9 @@ namespace dxvk {
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData) {
|
||||
const DxvkBufferSlice bufferSlice = pBuffer->GetBufferSlice();
|
||||
|
||||
D3D11_BUFFER_DESC desc;
|
||||
pBuffer->GetDesc(&desc);
|
||||
|
||||
if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) {
|
||||
LockResourceInitContext();
|
||||
|
||||
@ -1860,6 +1863,16 @@ namespace dxvk {
|
||||
bufferSlice.length(),
|
||||
pInitialData->pSysMem);
|
||||
|
||||
UnlockResourceInitContext(1);
|
||||
} else if (desc.Usage == D3D11_USAGE_DEFAULT) {
|
||||
LockResourceInitContext();
|
||||
|
||||
m_resourceInitContext->clearBuffer(
|
||||
bufferSlice.buffer(),
|
||||
bufferSlice.offset(),
|
||||
bufferSlice.length(),
|
||||
0u);
|
||||
|
||||
UnlockResourceInitContext(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user