mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-11 01:24:12 +01:00
[d3d11] Use Map() for host-visible buffers in UpdateSubresource
This commit is contained in:
parent
3148155c35
commit
2c20bf4dcb
@ -30,7 +30,7 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
UINT D3D11CommandList::GetContextFlags() {
|
||||
UINT STDMETHODCALLTYPE D3D11CommandList::GetContextFlags() {
|
||||
return m_contextFlags;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace dxvk {
|
||||
void STDMETHODCALLTYPE GetDevice(
|
||||
ID3D11Device **ppDevice) final;
|
||||
|
||||
UINT GetContextFlags();
|
||||
UINT STDMETHODCALLTYPE GetContextFlags() final;
|
||||
|
||||
void AddChunk(Rc<DxvkCsChunk>&& Chunk);
|
||||
|
||||
|
@ -564,18 +564,10 @@ namespace dxvk {
|
||||
|
||||
if (((size == bufferSlice.length())
|
||||
&& (bufferSlice.buffer()->memFlags() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))) {
|
||||
auto physicalSlice = bufferSlice.buffer()->allocPhysicalSlice();
|
||||
physicalSlice.resource()->acquire();
|
||||
|
||||
std::memcpy(physicalSlice.mapPtr(0), pSrcData, size);
|
||||
|
||||
EmitCs([
|
||||
cDstBuffer = bufferSlice.buffer(),
|
||||
cPhysicalSlice = std::move(physicalSlice)
|
||||
] (DxvkContext* ctx) {
|
||||
ctx->invalidateBuffer(cDstBuffer, cPhysicalSlice);
|
||||
cPhysicalSlice.resource()->release();
|
||||
});
|
||||
D3D11_MAPPED_SUBRESOURCE mappedSr;
|
||||
Map(pDstResource, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedSr);
|
||||
std::memcpy(mappedSr.pData, pSrcData, size);
|
||||
Unmap(pDstResource, 0);
|
||||
} else {
|
||||
EmitCs([
|
||||
cDataBuffer = Rc<DxvkDataBuffer>(new DxvkDataBuffer(pSrcData, size)),
|
||||
|
Loading…
Reference in New Issue
Block a user