mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Do not re-upload mapped image if it was mapped for reading
This commit is contained in:
parent
4d103aad5d
commit
ab3ba776e0
@ -394,7 +394,7 @@ namespace dxvk {
|
|||||||
auto subresource = pResource->GetSubresourceFromIndex(
|
auto subresource = pResource->GetSubresourceFromIndex(
|
||||||
formatInfo->aspectMask, Subresource);
|
formatInfo->aspectMask, Subresource);
|
||||||
|
|
||||||
pResource->SetMappedSubresource(subresource);
|
pResource->SetMappedSubresource(subresource, MapType);
|
||||||
|
|
||||||
if (pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
if (pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
||||||
const VkImageType imageType = mappedImage->info().type;
|
const VkImageType imageType = mappedImage->info().type;
|
||||||
@ -503,6 +503,9 @@ namespace dxvk {
|
|||||||
void D3D11ImmediateContext::UnmapImage(
|
void D3D11ImmediateContext::UnmapImage(
|
||||||
D3D11CommonTexture* pResource,
|
D3D11CommonTexture* pResource,
|
||||||
UINT Subresource) {
|
UINT Subresource) {
|
||||||
|
if (pResource->GetMapType() == D3D11_MAP_READ)
|
||||||
|
return;
|
||||||
|
|
||||||
if (pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER) {
|
if (pResource->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER) {
|
||||||
// Now that data has been written into the buffer,
|
// Now that data has been written into the buffer,
|
||||||
// we need to copy its contents into the image
|
// we need to copy its contents into the image
|
||||||
|
@ -105,13 +105,21 @@ namespace dxvk {
|
|||||||
VkImageSubresource GetMappedSubresource() const {
|
VkImageSubresource GetMappedSubresource() const {
|
||||||
return m_mappedSubresource;
|
return m_mappedSubresource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Current map type
|
||||||
|
*/
|
||||||
|
D3D11_MAP GetMapType() const {
|
||||||
|
return m_mapType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets mapped subresource
|
* \brief Sets mapped subresource
|
||||||
* \param [in] subresource THe subresource
|
* \param [in] subresource THe subresource
|
||||||
*/
|
*/
|
||||||
void SetMappedSubresource(VkImageSubresource subresource) {
|
void SetMappedSubresource(VkImageSubresource Subresource, D3D11_MAP MapType) {
|
||||||
m_mappedSubresource = subresource;
|
m_mappedSubresource = Subresource;
|
||||||
|
m_mapType = MapType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -188,6 +196,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
VkImageSubresource m_mappedSubresource
|
VkImageSubresource m_mappedSubresource
|
||||||
= { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 };
|
= { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 };
|
||||||
|
D3D11_MAP m_mapType = D3D11_MAP_READ;
|
||||||
|
|
||||||
Rc<DxvkBuffer> CreateMappedBuffer() const;
|
Rc<DxvkBuffer> CreateMappedBuffer() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user