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

[dxvk] Introduce checkGfxImageBarrier

This commit is contained in:
Philip Rebohle 2019-10-26 03:51:54 +02:00
parent 7a78852776
commit e918104ef3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 28 additions and 12 deletions

View File

@ -4587,18 +4587,8 @@ namespace dxvk {
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
if (slot.imageView != nullptr if (slot.imageView != nullptr
&& slot.imageView->imageInfo().usage & storageImageUsage) { && slot.imageView->imageInfo().usage & storageImageUsage) {
srcAccess = m_gfxBarriers.getImageAccess( srcAccess = this->checkGfxImageBarrier(slot.imageView,
slot.imageView->image(), binding.stages, binding.access);
slot.imageView->imageSubresources());
m_gfxBarriers.accessImage(
slot.imageView->image(),
slot.imageView->imageSubresources(),
slot.imageView->imageInfo().layout,
binding.stages, binding.access,
slot.imageView->imageInfo().layout,
slot.imageView->imageInfo().stages,
slot.imageView->imageInfo().access);
} }
break; break;
@ -4642,6 +4632,27 @@ namespace dxvk {
} }
DxvkAccessFlags DxvkContext::checkGfxImageBarrier(
const Rc<DxvkImageView>& imageView,
VkPipelineStageFlags stages,
VkAccessFlags access) {
auto srcAccess = m_gfxBarriers.getImageAccess(
imageView->image(),
imageView->imageSubresources());
m_gfxBarriers.accessImage(
imageView->image(),
imageView->imageSubresources(),
imageView->imageInfo().layout,
stages, access,
imageView->imageInfo().layout,
imageView->imageInfo().stages,
imageView->imageInfo().access);
return srcAccess;
}
void DxvkContext::emitMemoryBarrier( void DxvkContext::emitMemoryBarrier(
VkDependencyFlags flags, VkDependencyFlags flags,
VkPipelineStageFlags srcStages, VkPipelineStageFlags srcStages,

View File

@ -1190,6 +1190,11 @@ namespace dxvk {
VkPipelineStageFlags stages, VkPipelineStageFlags stages,
VkAccessFlags access); VkAccessFlags access);
DxvkAccessFlags checkGfxImageBarrier(
const Rc<DxvkImageView>& imageView,
VkPipelineStageFlags stages,
VkAccessFlags access);
void emitMemoryBarrier( void emitMemoryBarrier(
VkDependencyFlags flags, VkDependencyFlags flags,
VkPipelineStageFlags srcStages, VkPipelineStageFlags srcStages,