mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
render/vulkan: use initializer in vulkan_change_layout_queue()
This commit is contained in:
parent
74e8fd8a9a
commit
62e60ba889
1 changed files with 13 additions and 12 deletions
|
@ -62,18 +62,19 @@ void vulkan_change_layout_queue(VkCommandBuffer cb, VkImage img,
|
||||||
VkImageLayout ol, VkPipelineStageFlags srcs, VkAccessFlags srca,
|
VkImageLayout ol, VkPipelineStageFlags srcs, VkAccessFlags srca,
|
||||||
VkImageLayout nl, VkPipelineStageFlags dsts, VkAccessFlags dsta,
|
VkImageLayout nl, VkPipelineStageFlags dsts, VkAccessFlags dsta,
|
||||||
uint32_t src_family, uint32_t dst_family) {
|
uint32_t src_family, uint32_t dst_family) {
|
||||||
VkImageMemoryBarrier barrier = {0};
|
VkImageMemoryBarrier barrier = {
|
||||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
|
||||||
barrier.oldLayout = ol;
|
.oldLayout = ol,
|
||||||
barrier.newLayout = nl;
|
.newLayout = nl,
|
||||||
barrier.image = img;
|
.image = img,
|
||||||
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||||
barrier.subresourceRange.layerCount = 1;
|
.subresourceRange.layerCount = 1,
|
||||||
barrier.subresourceRange.levelCount = 1;
|
.subresourceRange.levelCount = 1,
|
||||||
barrier.srcAccessMask = srca;
|
.srcAccessMask = srca,
|
||||||
barrier.dstAccessMask = dsta;
|
.dstAccessMask = dsta,
|
||||||
barrier.srcQueueFamilyIndex = src_family;
|
.srcQueueFamilyIndex = src_family,
|
||||||
barrier.dstQueueFamilyIndex = dst_family;
|
.dstQueueFamilyIndex = dst_family,
|
||||||
|
};
|
||||||
|
|
||||||
vkCmdPipelineBarrier(cb, srcs, dsts, 0, 0, NULL, 0, NULL, 1, &barrier);
|
vkCmdPipelineBarrier(cb, srcs, dsts, 0, 0, NULL, 0, NULL, 1, &barrier);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue