mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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:
parent
140a2c1017
commit
6b2f4f93cc
@ -340,8 +340,6 @@ namespace dxvk {
|
|||||||
if (unlikely(Subresource >= pResource->CountSubresources()))
|
if (unlikely(Subresource >= pResource->CountSubresources()))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
pResource->SetMapType(Subresource, MapType);
|
|
||||||
|
|
||||||
VkFormat packedFormat = m_parent->LookupPackedFormat(
|
VkFormat packedFormat = m_parent->LookupPackedFormat(
|
||||||
pResource->Desc()->Format, pResource->GetFormatMode()).Format;
|
pResource->Desc()->Format, pResource->GetFormatMode()).Format;
|
||||||
|
|
||||||
@ -356,6 +354,9 @@ namespace dxvk {
|
|||||||
if (!WaitForResource(mappedImage, MapFlags))
|
if (!WaitForResource(mappedImage, MapFlags))
|
||||||
return DXGI_ERROR_WAS_STILL_DRAWING;
|
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
|
// Query the subresource's memory layout and hope that
|
||||||
// the application respects the returned pitch values.
|
// the application respects the returned pitch values.
|
||||||
VkSubresourceLayout layout = mappedImage->querySubresourceLayout(subresource);
|
VkSubresourceLayout layout = mappedImage->querySubresourceLayout(subresource);
|
||||||
@ -397,6 +398,9 @@ namespace dxvk {
|
|||||||
physSlice = mappedBuffer->getSliceHandle();
|
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.
|
// Set up map pointer. Data is tightly packed within the mapped buffer.
|
||||||
pMappedResource->pData = physSlice.mapPtr;
|
pMappedResource->pData = physSlice.mapPtr;
|
||||||
pMappedResource->RowPitch = formatInfo->elementSize * blockCount.width;
|
pMappedResource->RowPitch = formatInfo->elementSize * blockCount.width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user