1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-01 19:29:16 +01:00

[dxvk] Don't rely on binding mask in commitGraphicsBarriers

We can't actually use that here since we check barriers before
updating shader resources, unlike on the compute path. Check
all resources manually instead.
This commit is contained in:
Philip Rebohle 2019-10-13 02:19:48 +02:00
parent 0e578adcf5
commit 950ea21b83
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -4366,7 +4366,6 @@ namespace dxvk {
bool requiresBarrier = false;
for (uint32_t i = 0; i < layout->bindingCount() && !requiresBarrier; i++) {
if (m_state.gp.state.bsBindingMask.test(i)) {
const DxvkDescriptorSlot binding = layout->binding(i);
const DxvkShaderResourceSlot& slot = m_rc[binding.slot];
@ -4381,7 +4380,8 @@ namespace dxvk {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
if (slot.bufferSlice.bufferInfo().usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) {
if (slot.bufferSlice.defined()
&& slot.bufferSlice.bufferInfo().usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) {
srcAccess = m_gfxBarriers.getBufferAccess(
slot.bufferSlice.getSliceHandle());
@ -4399,7 +4399,8 @@ namespace dxvk {
/* fall through */
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
if (slot.bufferView->bufferInfo().usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) {
if (slot.bufferView != nullptr
&& slot.bufferView->bufferInfo().usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) {
srcAccess = m_gfxBarriers.getBufferAccess(
slot.bufferView->getSliceHandle());
@ -4418,7 +4419,8 @@ namespace dxvk {
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
if (slot.imageView->imageInfo().usage & VK_IMAGE_USAGE_STORAGE_BIT) {
if (slot.imageView != nullptr
&& slot.imageView->imageInfo().usage & VK_IMAGE_USAGE_STORAGE_BIT) {
srcAccess = m_gfxBarriers.getImageAccess(
slot.imageView->image(),
slot.imageView->imageSubresources());
@ -4449,7 +4451,6 @@ namespace dxvk {
requiresBarrier = (srcAccess | dstAccess).test(DxvkAccess::Write);
}
}
// External subpass dependencies serve as full memory
// and execution barriers, so we can use this to allow