@@ -160,22 +160,23 @@ Instance::Instance(Frontend::WindowSDL& window, s32 physical_device_index,
160
160
161
161
// Check and log format support details.
162
162
for (const auto & format : LiverpoolToVK::SurfaceFormats ()) {
163
- if (!IsFormatSupported (GetSupportedFormat ( format.vk_format , format. flags ) , format.flags )) {
163
+ if (!IsFormatSupported (format.vk_format , format.flags )) {
164
164
LOG_WARNING (Render_Vulkan,
165
165
" Surface format data_format={}, number_format={} is not fully supported "
166
- " (vk_format={}, requested flags ={})" ,
166
+ " (vk_format={}, missing features ={})" ,
167
167
static_cast <u32 >(format.data_format ),
168
168
static_cast <u32 >(format.number_format ), vk::to_string (format.vk_format ),
169
- vk::to_string (format.flags ));
169
+ vk::to_string (format.flags & ~GetFormatFeatureFlags (format.vk_format) ));
170
170
}
171
171
}
172
172
for (const auto & format : LiverpoolToVK::DepthFormats ()) {
173
- if (!IsFormatSupported (GetSupportedFormat ( format.vk_format , format. flags ) , format.flags )) {
173
+ if (!IsFormatSupported (format.vk_format , format.flags )) {
174
174
LOG_WARNING (Render_Vulkan,
175
175
" Depth format z_format={}, stencil_format={} is not fully supported "
176
- " (vk_format={}, requested flags ={})" ,
176
+ " (vk_format={}, missing features ={})" ,
177
177
static_cast <u32 >(format.z_format ), static_cast <u32 >(format.stencil_format ),
178
- vk::to_string (format.vk_format ), vk::to_string (format.flags ));
178
+ vk::to_string (format.vk_format ),
179
+ vk::to_string (format.flags & ~GetFormatFeatureFlags (format.vk_format)));
179
180
}
180
181
}
181
182
}
@@ -546,18 +547,21 @@ void Instance::CollectToolingInfo() {
546
547
}
547
548
}
548
549
549
- bool Instance::IsFormatSupported (const vk::Format format,
550
- const vk::FormatFeatureFlags2 flags) const {
551
- if (format == vk::Format::eUndefined) [[unlikely]] {
552
- return true ;
553
- }
554
-
550
+ vk::FormatFeatureFlags2 Instance::GetFormatFeatureFlags (vk::Format format) const {
555
551
const auto it = format_properties.find (format);
556
552
if (it == format_properties.end ()) {
557
553
UNIMPLEMENTED_MSG (" Properties of format {} have not been queried." , vk::to_string (format));
558
554
}
559
555
560
- return ((it->second .optimalTilingFeatures | it->second .bufferFeatures ) & flags) == flags;
556
+ return it->second .optimalTilingFeatures | it->second .bufferFeatures ;
557
+ }
558
+
559
+ bool Instance::IsFormatSupported (const vk::Format format,
560
+ const vk::FormatFeatureFlags2 flags) const {
561
+ if (format == vk::Format::eUndefined) [[unlikely]] {
562
+ return true ;
563
+ }
564
+ return (GetFormatFeatureFlags (format) & flags) == flags;
561
565
}
562
566
563
567
static vk::Format GetAlternativeFormat (const vk::Format format) {
0 commit comments