1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 05:52:11 +01:00

[dxvk] Store VkImage in barrier set rather than DxvkImage*

Avoids some accidental ref counting.
This commit is contained in:
Philip Rebohle 2021-02-20 14:35:22 +01:00
parent d66ecf4a94
commit 1a1cc32b11
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 6 additions and 6 deletions

View File

@ -73,7 +73,7 @@ namespace dxvk {
m_imgBarriers.push_back(barrier); m_imgBarriers.push_back(barrier);
} }
m_imgSlices.push_back({ image.ptr(), subresources, access }); m_imgSlices.push_back({ image->handle(), subresources, access });
} }
@ -152,8 +152,8 @@ namespace dxvk {
acquire.m_imgBarriers.push_back(barrier); acquire.m_imgBarriers.push_back(barrier);
DxvkAccessFlags access(DxvkAccess::Read, DxvkAccess::Write); DxvkAccessFlags access(DxvkAccess::Read, DxvkAccess::Write);
release.m_imgSlices.push_back({ image.ptr(), subresources, access }); release.m_imgSlices.push_back({ image->handle(), subresources, access });
acquire.m_imgSlices.push_back({ image.ptr(), subresources, access }); acquire.m_imgSlices.push_back({ image->handle(), subresources, access });
} }
@ -183,7 +183,7 @@ namespace dxvk {
for (uint32_t i = 0; i < m_imgSlices.size() && !result; i++) { for (uint32_t i = 0; i < m_imgSlices.size() && !result; i++) {
const VkImageSubresourceRange& dstSubres = m_imgSlices[i].subres; const VkImageSubresourceRange& dstSubres = m_imgSlices[i].subres;
result = (image == m_imgSlices[i].image) && (imgAccess | m_imgSlices[i].access).test(DxvkAccess::Write) result = (image->handle() == m_imgSlices[i].image) && (imgAccess | m_imgSlices[i].access).test(DxvkAccess::Write)
&& (imgSubres.baseArrayLayer < dstSubres.baseArrayLayer + dstSubres.layerCount) && (imgSubres.baseArrayLayer < dstSubres.baseArrayLayer + dstSubres.layerCount)
&& (imgSubres.baseArrayLayer + imgSubres.layerCount > dstSubres.baseArrayLayer) && (imgSubres.baseArrayLayer + imgSubres.layerCount > dstSubres.baseArrayLayer)
&& (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount) && (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount)
@ -219,7 +219,7 @@ namespace dxvk {
for (uint32_t i = 0; i < m_imgSlices.size(); i++) { for (uint32_t i = 0; i < m_imgSlices.size(); i++) {
const VkImageSubresourceRange& dstSubres = m_imgSlices[i].subres; const VkImageSubresourceRange& dstSubres = m_imgSlices[i].subres;
if ((image == m_imgSlices[i].image) if ((image->handle() == m_imgSlices[i].image)
&& (imgSubres.baseArrayLayer < dstSubres.baseArrayLayer + dstSubres.layerCount) && (imgSubres.baseArrayLayer < dstSubres.baseArrayLayer + dstSubres.layerCount)
&& (imgSubres.baseArrayLayer + imgSubres.layerCount > dstSubres.baseArrayLayer) && (imgSubres.baseArrayLayer + imgSubres.layerCount > dstSubres.baseArrayLayer)
&& (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount) && (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount)

View File

@ -93,7 +93,7 @@ namespace dxvk {
}; };
struct ImgSlice { struct ImgSlice {
DxvkImage* image; VkImage image;
VkImageSubresourceRange subres; VkImageSubresourceRange subres;
DxvkAccessFlags access; DxvkAccessFlags access;
}; };