Skip to content

Commit

Permalink
[dxvk] Store VkImage in barrier set rather than DxvkImage*
Browse files Browse the repository at this point in the history
Avoids some accidental ref counting.
  • Loading branch information
doitsujin committed Feb 20, 2021
1 parent d66ecf4 commit 1a1cc32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/dxvk/dxvk_barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace dxvk {
m_imgBarriers.push_back(barrier);
}

m_imgSlices.push_back({ image.ptr(), subresources, access });
m_imgSlices.push_back({ image->handle(), subresources, access });
}


Expand Down Expand Up @@ -152,8 +152,8 @@ namespace dxvk {
acquire.m_imgBarriers.push_back(barrier);

DxvkAccessFlags access(DxvkAccess::Read, DxvkAccess::Write);
release.m_imgSlices.push_back({ image.ptr(), subresources, access });
acquire.m_imgSlices.push_back({ image.ptr(), subresources, access });
release.m_imgSlices.push_back({ image->handle(), subresources, access });
acquire.m_imgSlices.push_back({ image->handle(), subresources, access });
}


Expand Down Expand Up @@ -183,7 +183,7 @@ namespace dxvk {
for (uint32_t i = 0; i < m_imgSlices.size() && !result; i++) {
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 + imgSubres.layerCount > dstSubres.baseArrayLayer)
&& (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount)
Expand Down Expand Up @@ -219,7 +219,7 @@ namespace dxvk {
for (uint32_t i = 0; i < m_imgSlices.size(); i++) {
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 + imgSubres.layerCount > dstSubres.baseArrayLayer)
&& (imgSubres.baseMipLevel < dstSubres.baseMipLevel + dstSubres.levelCount)
Expand Down
2 changes: 1 addition & 1 deletion src/dxvk/dxvk_barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace dxvk {
};

struct ImgSlice {
DxvkImage* image;
VkImage image;
VkImageSubresourceRange subres;
DxvkAccessFlags access;
};
Expand Down

0 comments on commit 1a1cc32

Please sign in to comment.