1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Fix incorrect tracking of mapped image subresources

When returnig DXGI_ERROR_WAS_STILL_DRAWING, we should not mark
the subresource as mapped, and instead ignore subsequent calls
to Unmap.
This commit is contained in:
Philip Rebohle 2019-08-03 19:11:19 +02:00
parent 140a2c1017
commit 6b2f4f93cc

View File

@ -340,8 +340,6 @@ namespace dxvk {
if (unlikely(Subresource >= pResource->CountSubresources()))
return E_INVALIDARG;
pResource->SetMapType(Subresource, MapType);
VkFormat packedFormat = m_parent->LookupPackedFormat(
pResource->Desc()->Format, pResource->GetFormatMode()).Format;
@ -356,6 +354,9 @@ namespace dxvk {
if (!WaitForResource(mappedImage, MapFlags))
return DXGI_ERROR_WAS_STILL_DRAWING;
// Mark the given subresource as mapped
pResource->SetMapType(Subresource, MapType);
// Query the subresource's memory layout and hope that
// the application respects the returned pitch values.
VkSubresourceLayout layout = mappedImage->querySubresourceLayout(subresource);
@ -397,6 +398,9 @@ namespace dxvk {
physSlice = mappedBuffer->getSliceHandle();
}
// Mark the given subresource as mapped
pResource->SetMapType(Subresource, MapType);
// Set up map pointer. Data is tightly packed within the mapped buffer.
pMappedResource->pData = physSlice.mapPtr;
pMappedResource->RowPitch = formatInfo->elementSize * blockCount.width;