mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[dxvk] Add explicit buffer/image memory barrier methods
Useful for interop.
This commit is contained in:
parent
9bdad71dc6
commit
5595844f75
@ -1607,6 +1607,44 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::emitBufferBarrier(
|
||||
const Rc<DxvkBuffer>& resource,
|
||||
VkPipelineStageFlags srcStages,
|
||||
VkAccessFlags srcAccess,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess) {
|
||||
this->spillRenderPass(true);
|
||||
|
||||
m_execBarriers.accessBuffer(resource->getSliceHandle(),
|
||||
srcStages, srcAccess, dstStages, dstAccess);
|
||||
|
||||
m_cmd->trackResource<DxvkAccess::Write>(resource);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::emitImageBarrier(
|
||||
const Rc<DxvkImage>& resource,
|
||||
VkImageLayout srcLayout,
|
||||
VkPipelineStageFlags srcStages,
|
||||
VkAccessFlags srcAccess,
|
||||
VkImageLayout dstLayout,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess) {
|
||||
this->spillRenderPass(true);
|
||||
this->prepareImage(resource, resource->getAvailableSubresources());
|
||||
|
||||
if (m_execBarriers.isImageDirty(resource, resource->getAvailableSubresources(), DxvkAccess::Write))
|
||||
m_execBarriers.recordCommands(m_cmd);
|
||||
|
||||
m_execBarriers.accessImage(
|
||||
resource, resource->getAvailableSubresources(),
|
||||
srcLayout, srcStages, srcAccess,
|
||||
dstLayout, dstStages, dstAccess);
|
||||
|
||||
m_cmd->trackResource<DxvkAccess::Write>(resource);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::generateMipmaps(
|
||||
const Rc<DxvkImageView>& imageView,
|
||||
VkFilter filter) {
|
||||
|
@ -873,6 +873,46 @@ namespace dxvk {
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess);
|
||||
|
||||
/**
|
||||
* \brief Emits buffer barrier
|
||||
*
|
||||
* Can be used to transition foreign resources
|
||||
* into a state that DXVK can work with.
|
||||
* \param [in] resource Buffer resource
|
||||
* \param [in] srcStages Source pipeline stages
|
||||
* \param [in] srcAccess Source access
|
||||
* \param [in] dstStages Destination pipeline stages
|
||||
* \param [in] dstAccess Destination access
|
||||
*/
|
||||
void emitBufferBarrier(
|
||||
const Rc<DxvkBuffer>& resource,
|
||||
VkPipelineStageFlags srcStages,
|
||||
VkAccessFlags srcAccess,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess);
|
||||
|
||||
/**
|
||||
* \brief Emits image barrier
|
||||
*
|
||||
* Can be used to transition foreign resources
|
||||
* into a state that DXVK can work with.
|
||||
* \param [in] resource Image resource
|
||||
* \param [in] srcLayout Current image layout
|
||||
* \param [in] srcStages Source pipeline stages
|
||||
* \param [in] srcAccess Source access
|
||||
* \param [in] dstLayout New image layout
|
||||
* \param [in] dstStages Destination pipeline stages
|
||||
* \param [in] dstAccess Destination access
|
||||
*/
|
||||
void emitImageBarrier(
|
||||
const Rc<DxvkImage>& resource,
|
||||
VkImageLayout srcLayout,
|
||||
VkPipelineStageFlags srcStages,
|
||||
VkAccessFlags srcAccess,
|
||||
VkImageLayout dstLayout,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess);
|
||||
|
||||
/**
|
||||
* \brief Generates mip maps
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user