mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-11 01:24:12 +01:00
[dxvk] Do not commit compute barriers for unbound resources
Fixes a crash in Neptunia VII.
This commit is contained in:
parent
17cdccd1ce
commit
ba707f95b7
@ -1565,36 +1565,38 @@ namespace dxvk {
|
|||||||
auto layout = m_state.cp.pipeline->layout();
|
auto layout = m_state.cp.pipeline->layout();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
||||||
const DxvkDescriptorSlot binding = layout->binding(i);
|
if (m_state.cp.bs.isBound(i)) {
|
||||||
const DxvkShaderResourceSlot& slot = m_rc[binding.slot];
|
const DxvkDescriptorSlot binding = layout->binding(i);
|
||||||
|
const DxvkShaderResourceSlot& slot = m_rc[binding.slot];
|
||||||
if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) {
|
|
||||||
m_barriers.accessBuffer(
|
if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) {
|
||||||
slot.bufferSlice.physicalSlice(),
|
m_barriers.accessBuffer(
|
||||||
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
slot.bufferSlice.physicalSlice(),
|
||||||
VK_ACCESS_SHADER_READ_BIT |
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||||
VK_ACCESS_SHADER_WRITE_BIT,
|
VK_ACCESS_SHADER_READ_BIT |
|
||||||
slot.bufferSlice.bufferInfo().stages,
|
VK_ACCESS_SHADER_WRITE_BIT,
|
||||||
slot.bufferSlice.bufferInfo().access);
|
slot.bufferSlice.bufferInfo().stages,
|
||||||
} else if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) {
|
slot.bufferSlice.bufferInfo().access);
|
||||||
m_barriers.accessBuffer(
|
} else if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) {
|
||||||
slot.bufferView->slice(),
|
m_barriers.accessBuffer(
|
||||||
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
slot.bufferView->slice(),
|
||||||
VK_ACCESS_SHADER_READ_BIT |
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||||
VK_ACCESS_SHADER_WRITE_BIT,
|
VK_ACCESS_SHADER_READ_BIT |
|
||||||
slot.bufferView->bufferInfo().stages,
|
VK_ACCESS_SHADER_WRITE_BIT,
|
||||||
slot.bufferView->bufferInfo().access);
|
slot.bufferView->bufferInfo().stages,
|
||||||
} else if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) {
|
slot.bufferView->bufferInfo().access);
|
||||||
m_barriers.accessImage(
|
} else if (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) {
|
||||||
slot.imageView->image(),
|
m_barriers.accessImage(
|
||||||
slot.imageView->subresources(),
|
slot.imageView->image(),
|
||||||
slot.imageView->imageInfo().layout,
|
slot.imageView->subresources(),
|
||||||
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
slot.imageView->imageInfo().layout,
|
||||||
VK_ACCESS_SHADER_READ_BIT |
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||||
VK_ACCESS_SHADER_WRITE_BIT,
|
VK_ACCESS_SHADER_READ_BIT |
|
||||||
slot.imageView->imageInfo().layout,
|
VK_ACCESS_SHADER_WRITE_BIT,
|
||||||
slot.imageView->imageInfo().stages,
|
slot.imageView->imageInfo().layout,
|
||||||
slot.imageView->imageInfo().access);
|
slot.imageView->imageInfo().stages,
|
||||||
|
slot.imageView->imageInfo().access);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user