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