1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[d3d11] Use Map() for host-visible buffers in UpdateSubresource

This commit is contained in:
Philip Rebohle 2018-01-23 12:16:28 +01:00
parent 3148155c35
commit 2c20bf4dcb
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 6 additions and 14 deletions

View File

@ -30,7 +30,7 @@ namespace dxvk {
}
UINT D3D11CommandList::GetContextFlags() {
UINT STDMETHODCALLTYPE D3D11CommandList::GetContextFlags() {
return m_contextFlags;
}

View File

@ -21,7 +21,7 @@ namespace dxvk {
void STDMETHODCALLTYPE GetDevice(
ID3D11Device **ppDevice) final;
UINT GetContextFlags();
UINT STDMETHODCALLTYPE GetContextFlags() final;
void AddChunk(Rc<DxvkCsChunk>&& Chunk);

View File

@ -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)),