@@ -17,7 +17,7 @@ Swapchain::Swapchain(const Instance& instance_, const Frontend::WindowSDL& windo
17
17
FindPresentFormat ();
18
18
19
19
Create (window.GetWidth (), window.GetHeight ());
20
- ImGui::Core::Initialize (instance, window, image_count, view_format );
20
+ ImGui::Core::Initialize (instance, window, image_count, surface_format. format );
21
21
}
22
22
23
23
Swapchain::~Swapchain () {
@@ -57,17 +57,7 @@ void Swapchain::Create(u32 width_, u32 height_) {
57
57
const u32 queue_family_indices_count = exclusive ? 1u : 2u ;
58
58
const vk::SharingMode sharing_mode =
59
59
exclusive ? vk::SharingMode::eExclusive : vk::SharingMode::eConcurrent;
60
- const vk::Format view_formats[2 ] = {
61
- surface_format.format ,
62
- view_format,
63
- };
64
- const vk::ImageFormatListCreateInfo format_list = {
65
- .viewFormatCount = 2 ,
66
- .pViewFormats = view_formats,
67
- };
68
60
const vk::SwapchainCreateInfoKHR swapchain_info = {
69
- .pNext = &format_list,
70
- .flags = vk::SwapchainCreateFlagBitsKHR::eMutableFormat,
71
61
.surface = surface,
72
62
.minImageCount = image_count,
73
63
.imageFormat = surface_format.format ,
@@ -157,22 +147,20 @@ void Swapchain::FindPresentFormat() {
157
147
// If there is a single undefined surface format, the device doesn't care, so we'll just use
158
148
// RGBA sRGB.
159
149
if (formats[0 ].format == vk::Format::eUndefined) {
160
- surface_format.format = vk::Format::eR8G8B8A8Srgb ;
150
+ surface_format.format = vk::Format::eR8G8B8A8Unorm ;
161
151
surface_format.colorSpace = vk::ColorSpaceKHR::eSrgbNonlinear;
162
- view_format = FormatToUnorm (surface_format.format );
163
152
return ;
164
153
}
165
154
166
155
// Try to find a suitable format.
167
156
for (const vk::SurfaceFormatKHR& sformat : formats) {
168
157
vk::Format format = sformat.format ;
169
- if (format != vk::Format::eR8G8B8A8Srgb && format != vk::Format::eB8G8R8A8Srgb ) {
158
+ if (format != vk::Format::eR8G8B8A8Unorm && format != vk::Format::eB8G8R8A8Unorm ) {
170
159
continue ;
171
160
}
172
161
173
162
surface_format.format = format;
174
163
surface_format.colorSpace = sformat.colorSpace ;
175
- view_format = FormatToUnorm (surface_format.format );
176
164
return ;
177
165
}
178
166
@@ -274,7 +262,7 @@ void Swapchain::SetupImages() {
274
262
auto [im_view_result, im_view] = device.createImageView (vk::ImageViewCreateInfo{
275
263
.image = images[i],
276
264
.viewType = vk::ImageViewType::e2D,
277
- .format = FormatToUnorm ( surface_format.format ) ,
265
+ .format = surface_format.format ,
278
266
.subresourceRange =
279
267
{
280
268
.aspectMask = vk::ImageAspectFlagBits::eColor,
0 commit comments