1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxvk] Add initializeImage helper

Allows us to use TOP_OF_PIPE -> xxx barriers more often.
This commit is contained in:
Philip Rebohle 2020-05-02 19:54:38 +02:00
parent a208f45fe4
commit bbd5762d3d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 27 additions and 0 deletions

View File

@ -4742,6 +4742,26 @@ namespace dxvk {
}
void DxvkContext::initializeImage(
const Rc<DxvkImage>& image,
const VkImageSubresourceRange& subresources,
VkImageLayout dstLayout,
VkPipelineStageFlags dstStages,
VkAccessFlags dstAccess) {
if (m_execBarriers.isImageDirty(image, subresources, DxvkAccess::Write))
m_execBarriers.recordCommands(m_cmd);
VkPipelineStageFlags srcStages = 0;
if (image->isInUse())
srcStages = dstStages;
m_execAcquires.accessImage(image, subresources,
VK_IMAGE_LAYOUT_UNDEFINED, srcStages, 0,
dstLayout, dstStages, dstAccess);
}
VkDescriptorSet DxvkContext::allocateDescriptorSet(
VkDescriptorSetLayout layout) {
if (m_descPool == nullptr)

View File

@ -1223,6 +1223,13 @@ namespace dxvk {
VkPipelineStageFlags dstStages,
VkAccessFlags dstAccess);
void initializeImage(
const Rc<DxvkImage>& image,
const VkImageSubresourceRange& subresources,
VkImageLayout dstLayout,
VkPipelineStageFlags dstStages,
VkAccessFlags dstAccess);
VkDescriptorSet allocateDescriptorSet(
VkDescriptorSetLayout layout);