mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-06 04:46:17 +01:00
[dxvk] Add helpers to flush pending execution barriers if needed
This commit is contained in:
parent
318e79c2ad
commit
bbe7767475
@ -6986,6 +6986,94 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::accessBuffer(
|
||||||
|
DxvkCmdBuffer cmdBuffer,
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
VkPipelineStageFlags2 srcStages,
|
||||||
|
VkAccessFlags2 srcAccess) {
|
||||||
|
accessBuffer(cmdBuffer,
|
||||||
|
*bufferView.buffer(),
|
||||||
|
bufferView.info().offset,
|
||||||
|
bufferView.info().size,
|
||||||
|
srcStages, srcAccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::accessBuffer(
|
||||||
|
DxvkCmdBuffer cmdBuffer,
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
VkPipelineStageFlags2 srcStages,
|
||||||
|
VkAccessFlags2 srcAccess,
|
||||||
|
VkPipelineStageFlags2 dstStages,
|
||||||
|
VkAccessFlags2 dstAccess) {
|
||||||
|
accessBuffer(cmdBuffer,
|
||||||
|
*bufferView.buffer(),
|
||||||
|
bufferView.info().offset,
|
||||||
|
bufferView.info().size,
|
||||||
|
srcStages, srcAccess,
|
||||||
|
dstStages, dstAccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushPendingAccesses(
|
||||||
|
DxvkBuffer& buffer,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size,
|
||||||
|
DxvkAccess access) {
|
||||||
|
if (m_execBarriers.isBufferDirty(buffer.getSliceHandle(offset, size), access))
|
||||||
|
m_execBarriers.recordCommands(m_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushPendingAccesses(
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
DxvkAccess access) {
|
||||||
|
flushPendingAccesses(*bufferView.buffer(),
|
||||||
|
bufferView.info().offset,
|
||||||
|
bufferView.info().size,
|
||||||
|
access);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushPendingAccesses(
|
||||||
|
DxvkImage& image,
|
||||||
|
const VkImageSubresourceRange& subresources,
|
||||||
|
DxvkAccess access) {
|
||||||
|
if (m_execBarriers.isImageDirty(&image, subresources, access))
|
||||||
|
m_execBarriers.recordCommands(m_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushPendingAccesses(
|
||||||
|
DxvkImageView& imageView,
|
||||||
|
DxvkAccess access) {
|
||||||
|
flushPendingAccesses(*imageView.image(),
|
||||||
|
imageView.imageSubresources(), access);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushBarriers() {
|
||||||
|
m_execBarriers.recordCommands(m_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DxvkContext::resourceHasAccess(
|
||||||
|
DxvkBuffer& buffer,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size,
|
||||||
|
DxvkAccess access) {
|
||||||
|
return m_execBarriers.getBufferAccess(buffer.getSliceHandle(offset, size)).test(access);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DxvkContext::resourceHasAccess(
|
||||||
|
DxvkImageView& imageView,
|
||||||
|
DxvkAccess access) {
|
||||||
|
return m_execBarriers.getImageAccess(imageView.image(),
|
||||||
|
imageView.imageSubresources()).test(access);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DxvkContext::formatsAreCopyCompatible(
|
bool DxvkContext::formatsAreCopyCompatible(
|
||||||
VkFormat imageFormat,
|
VkFormat imageFormat,
|
||||||
VkFormat bufferFormat) {
|
VkFormat bufferFormat) {
|
||||||
|
@ -1850,6 +1850,55 @@ namespace dxvk {
|
|||||||
VkPipelineStageFlags2 dstStages,
|
VkPipelineStageFlags2 dstStages,
|
||||||
VkAccessFlags2 dstAccess);
|
VkAccessFlags2 dstAccess);
|
||||||
|
|
||||||
|
void accessBuffer(
|
||||||
|
DxvkCmdBuffer cmdBuffer,
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
VkPipelineStageFlags2 srcStages,
|
||||||
|
VkAccessFlags2 srcAccess);
|
||||||
|
|
||||||
|
void accessBuffer(
|
||||||
|
DxvkCmdBuffer cmdBuffer,
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
VkPipelineStageFlags2 srcStages,
|
||||||
|
VkAccessFlags2 srcAccess,
|
||||||
|
VkPipelineStageFlags2 dstStages,
|
||||||
|
VkAccessFlags2 dstAccess);
|
||||||
|
|
||||||
|
void flushPendingAccesses(
|
||||||
|
DxvkBuffer& buffer,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
void flushPendingAccesses(
|
||||||
|
DxvkBufferView& bufferView,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
void flushPendingAccesses(
|
||||||
|
DxvkImage& image,
|
||||||
|
const VkImageSubresourceRange& subresources,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
void flushPendingAccesses(
|
||||||
|
DxvkImageView& imageView,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
void flushBarriers();
|
||||||
|
|
||||||
|
bool resourceHasAccess(
|
||||||
|
DxvkBuffer& buffer,
|
||||||
|
VkDeviceSize offset,
|
||||||
|
VkDeviceSize size,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
bool resourceHasAccess(
|
||||||
|
DxvkBufferView& buffer,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
|
bool resourceHasAccess(
|
||||||
|
DxvkImageView& imageView,
|
||||||
|
DxvkAccess access);
|
||||||
|
|
||||||
static bool formatsAreCopyCompatible(
|
static bool formatsAreCopyCompatible(
|
||||||
VkFormat imageFormat,
|
VkFormat imageFormat,
|
||||||
VkFormat bufferFormat);
|
VkFormat bufferFormat);
|
||||||
|
Loading…
Reference in New Issue
Block a user