mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-01 12:46:01 +00:00
vulkan: Report only missing format feature flags. (#1420)
This commit is contained in:
parent
8e08756b6e
commit
7654a08d9a
|
@ -160,22 +160,23 @@ Instance::Instance(Frontend::WindowSDL& window, s32 physical_device_index,
|
||||||
|
|
||||||
// Check and log format support details.
|
// Check and log format support details.
|
||||||
for (const auto& format : LiverpoolToVK::SurfaceFormats()) {
|
for (const auto& format : LiverpoolToVK::SurfaceFormats()) {
|
||||||
if (!IsFormatSupported(GetSupportedFormat(format.vk_format, format.flags), format.flags)) {
|
if (!IsFormatSupported(format.vk_format, format.flags)) {
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
"Surface format data_format={}, number_format={} is not fully supported "
|
"Surface format data_format={}, number_format={} is not fully supported "
|
||||||
"(vk_format={}, requested flags={})",
|
"(vk_format={}, missing features={})",
|
||||||
static_cast<u32>(format.data_format),
|
static_cast<u32>(format.data_format),
|
||||||
static_cast<u32>(format.number_format), vk::to_string(format.vk_format),
|
static_cast<u32>(format.number_format), vk::to_string(format.vk_format),
|
||||||
vk::to_string(format.flags));
|
vk::to_string(format.flags & ~GetFormatFeatureFlags(format.vk_format)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& format : LiverpoolToVK::DepthFormats()) {
|
for (const auto& format : LiverpoolToVK::DepthFormats()) {
|
||||||
if (!IsFormatSupported(GetSupportedFormat(format.vk_format, format.flags), format.flags)) {
|
if (!IsFormatSupported(format.vk_format, format.flags)) {
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
"Depth format z_format={}, stencil_format={} is not fully supported "
|
"Depth format z_format={}, stencil_format={} is not fully supported "
|
||||||
"(vk_format={}, requested flags={})",
|
"(vk_format={}, missing features={})",
|
||||||
static_cast<u32>(format.z_format), static_cast<u32>(format.stencil_format),
|
static_cast<u32>(format.z_format), static_cast<u32>(format.stencil_format),
|
||||||
vk::to_string(format.vk_format), vk::to_string(format.flags));
|
vk::to_string(format.vk_format),
|
||||||
|
vk::to_string(format.flags & ~GetFormatFeatureFlags(format.vk_format)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,18 +547,21 @@ void Instance::CollectToolingInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Instance::IsFormatSupported(const vk::Format format,
|
vk::FormatFeatureFlags2 Instance::GetFormatFeatureFlags(vk::Format format) const {
|
||||||
const vk::FormatFeatureFlags2 flags) const {
|
|
||||||
if (format == vk::Format::eUndefined) [[unlikely]] {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto it = format_properties.find(format);
|
const auto it = format_properties.find(format);
|
||||||
if (it == format_properties.end()) {
|
if (it == format_properties.end()) {
|
||||||
UNIMPLEMENTED_MSG("Properties of format {} have not been queried.", vk::to_string(format));
|
UNIMPLEMENTED_MSG("Properties of format {} have not been queried.", vk::to_string(format));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((it->second.optimalTilingFeatures | it->second.bufferFeatures) & flags) == flags;
|
return it->second.optimalTilingFeatures | it->second.bufferFeatures;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Instance::IsFormatSupported(const vk::Format format,
|
||||||
|
const vk::FormatFeatureFlags2 flags) const {
|
||||||
|
if (format == vk::Format::eUndefined) [[unlikely]] {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return (GetFormatFeatureFlags(format) & flags) == flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static vk::Format GetAlternativeFormat(const vk::Format format) {
|
static vk::Format GetAlternativeFormat(const vk::Format format) {
|
||||||
|
|
|
@ -275,6 +275,9 @@ private:
|
||||||
void CollectDeviceParameters();
|
void CollectDeviceParameters();
|
||||||
void CollectToolingInfo();
|
void CollectToolingInfo();
|
||||||
|
|
||||||
|
/// Gets the supported feature flags for a format.
|
||||||
|
[[nodiscard]] vk::FormatFeatureFlags2 GetFormatFeatureFlags(vk::Format format) const;
|
||||||
|
|
||||||
/// Determines if a format is supported for a set of feature flags.
|
/// Determines if a format is supported for a set of feature flags.
|
||||||
[[nodiscard]] bool IsFormatSupported(vk::Format format, vk::FormatFeatureFlags2 flags) const;
|
[[nodiscard]] bool IsFormatSupported(vk::Format format, vk::FormatFeatureFlags2 flags) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue