diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-17 00:24:26 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-17 00:24:26 +0200 |
commit | 75c00c3cb07089c4aad6297cda144b33a0209be0 (patch) | |
tree | d30a79291b1d7fd12a337a4f1c77cc48fdb90deb /src/video_core | |
parent | vk_descriptor_pool: Make use of designated initializers where applicable (diff) | |
download | yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar.gz yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar.bz2 yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar.lz yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar.xz yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.tar.zst yuzu-75c00c3cb07089c4aad6297cda144b33a0209be0.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_image.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/video_core/renderer_vulkan/vk_image.cpp b/src/video_core/renderer_vulkan/vk_image.cpp index 9bceb3861..1c418ea17 100644 --- a/src/video_core/renderer_vulkan/vk_image.cpp +++ b/src/video_core/renderer_vulkan/vk_image.cpp @@ -102,21 +102,29 @@ bool VKImage::HasChanged(u32 base_layer, u32 num_layers, u32 base_level, u32 num void VKImage::CreatePresentView() { // Image type has to be 2D to be presented. - VkImageViewCreateInfo image_view_ci; - image_view_ci.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - image_view_ci.pNext = nullptr; - image_view_ci.flags = 0; - image_view_ci.image = *image; - image_view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; - image_view_ci.format = format; - image_view_ci.components = {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}; - image_view_ci.subresourceRange.aspectMask = aspect_mask; - image_view_ci.subresourceRange.baseMipLevel = 0; - image_view_ci.subresourceRange.levelCount = 1; - image_view_ci.subresourceRange.baseArrayLayer = 0; - image_view_ci.subresourceRange.layerCount = 1; - present_view = device.GetLogical().CreateImageView(image_view_ci); + present_view = device.GetLogical().CreateImageView({ + .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, + .pNext = nullptr, + .flags = 0, + .image = *image, + .viewType = VK_IMAGE_VIEW_TYPE_2D, + .format = format, + .components = + { + .r = VK_COMPONENT_SWIZZLE_IDENTITY, + .g = VK_COMPONENT_SWIZZLE_IDENTITY, + .b = VK_COMPONENT_SWIZZLE_IDENTITY, + .a = VK_COMPONENT_SWIZZLE_IDENTITY, + }, + .subresourceRange = + { + .aspectMask = aspect_mask, + .baseMipLevel = 0, + .levelCount = 1, + .baseArrayLayer = 0, + .layerCount = 1, + }, + }); } VKImage::SubrangeState& VKImage::GetSubrangeState(u32 layer, u32 level) noexcept { |