vk_image: Make use of designated initializers where applicable

This commit is contained in:
Lioncash 2020-07-16 18:24:26 -04:00
parent 6d165481ad
commit 75c00c3cb0
1 changed files with 23 additions and 15 deletions

View File

@ -102,21 +102,29 @@ bool VKImage::HasChanged(u32 base_layer, u32 num_layers, u32 base_level, u32 num
void VKImage::CreatePresentView() { void VKImage::CreatePresentView() {
// Image type has to be 2D to be presented. // Image type has to be 2D to be presented.
VkImageViewCreateInfo image_view_ci; present_view = device.GetLogical().CreateImageView({
image_view_ci.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
image_view_ci.pNext = nullptr; .pNext = nullptr,
image_view_ci.flags = 0; .flags = 0,
image_view_ci.image = *image; .image = *image,
image_view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; .viewType = VK_IMAGE_VIEW_TYPE_2D,
image_view_ci.format = format; .format = format,
image_view_ci.components = {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, .components =
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}; {
image_view_ci.subresourceRange.aspectMask = aspect_mask; .r = VK_COMPONENT_SWIZZLE_IDENTITY,
image_view_ci.subresourceRange.baseMipLevel = 0; .g = VK_COMPONENT_SWIZZLE_IDENTITY,
image_view_ci.subresourceRange.levelCount = 1; .b = VK_COMPONENT_SWIZZLE_IDENTITY,
image_view_ci.subresourceRange.baseArrayLayer = 0; .a = VK_COMPONENT_SWIZZLE_IDENTITY,
image_view_ci.subresourceRange.layerCount = 1; },
present_view = device.GetLogical().CreateImageView(image_view_ci); .subresourceRange =
{
.aspectMask = aspect_mask,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1,
},
});
} }
VKImage::SubrangeState& VKImage::GetSubrangeState(u32 layer, u32 level) noexcept { VKImage::SubrangeState& VKImage::GetSubrangeState(u32 layer, u32 level) noexcept {