mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Introduce checkGfxBufferBarrier
This commit is contained in:
parent
2b812f07c1
commit
7a78852776
@ -4560,14 +4560,8 @@ namespace dxvk {
|
|||||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
||||||
if (slot.bufferSlice.defined()
|
if (slot.bufferSlice.defined()
|
||||||
&& slot.bufferSlice.bufferInfo().usage & storageBufferUsage) {
|
&& slot.bufferSlice.bufferInfo().usage & storageBufferUsage) {
|
||||||
srcAccess = m_gfxBarriers.getBufferAccess(
|
srcAccess = this->checkGfxBufferBarrier(slot.bufferSlice,
|
||||||
slot.bufferSlice.getSliceHandle());
|
binding.stages, binding.access);
|
||||||
|
|
||||||
m_gfxBarriers.accessBuffer(
|
|
||||||
slot.bufferSlice.getSliceHandle(),
|
|
||||||
binding.stages, binding.access,
|
|
||||||
slot.bufferSlice.bufferInfo().stages,
|
|
||||||
slot.bufferSlice.bufferInfo().access);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4579,14 +4573,8 @@ namespace dxvk {
|
|||||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
|
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
|
||||||
if (slot.bufferView != nullptr
|
if (slot.bufferView != nullptr
|
||||||
&& slot.bufferView->bufferInfo().usage & storageBufferUsage) {
|
&& slot.bufferView->bufferInfo().usage & storageBufferUsage) {
|
||||||
srcAccess = m_gfxBarriers.getBufferAccess(
|
srcAccess = this->checkGfxBufferBarrier(slot.bufferView->slice(),
|
||||||
slot.bufferView->getSliceHandle());
|
binding.stages, binding.access);
|
||||||
|
|
||||||
m_gfxBarriers.accessBuffer(
|
|
||||||
slot.bufferView->getSliceHandle(),
|
|
||||||
binding.stages, binding.access,
|
|
||||||
slot.bufferView->bufferInfo().stages,
|
|
||||||
slot.bufferView->bufferInfo().access);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4638,6 +4626,22 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DxvkAccessFlags DxvkContext::checkGfxBufferBarrier(
|
||||||
|
const DxvkBufferSlice& slice,
|
||||||
|
VkPipelineStageFlags stages,
|
||||||
|
VkAccessFlags access) {
|
||||||
|
auto srcAccess = m_gfxBarriers.getBufferAccess(slice.getSliceHandle());
|
||||||
|
|
||||||
|
m_gfxBarriers.accessBuffer(
|
||||||
|
slice.getSliceHandle(),
|
||||||
|
stages, access,
|
||||||
|
slice.bufferInfo().stages,
|
||||||
|
slice.bufferInfo().access);
|
||||||
|
|
||||||
|
return srcAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::emitMemoryBarrier(
|
void DxvkContext::emitMemoryBarrier(
|
||||||
VkDependencyFlags flags,
|
VkDependencyFlags flags,
|
||||||
VkPipelineStageFlags srcStages,
|
VkPipelineStageFlags srcStages,
|
||||||
|
@ -1185,6 +1185,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
void commitGraphicsBarriers();
|
void commitGraphicsBarriers();
|
||||||
|
|
||||||
|
DxvkAccessFlags checkGfxBufferBarrier(
|
||||||
|
const DxvkBufferSlice& slice,
|
||||||
|
VkPipelineStageFlags stages,
|
||||||
|
VkAccessFlags access);
|
||||||
|
|
||||||
void emitMemoryBarrier(
|
void emitMemoryBarrier(
|
||||||
VkDependencyFlags flags,
|
VkDependencyFlags flags,
|
||||||
VkPipelineStageFlags srcStages,
|
VkPipelineStageFlags srcStages,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user