mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-29 11:06:07 +00:00
vulkan: Upgrade format queries to use format feature flags 2. (#941)
Some checks are pending
Reuse / reuse (push) Waiting to run
Clang Format / clang-format (push) Waiting to run
Linux-Qt / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS-Qt / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows-Qt / build (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
Reuse / reuse (push) Waiting to run
Clang Format / clang-format (push) Waiting to run
Linux-Qt / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS-Qt / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows-Qt / build (push) Waiting to run
Windows / build (push) Waiting to run
This commit is contained in:
parent
c3d5824279
commit
eaa92b5a65
|
@ -33,11 +33,16 @@ std::vector<std::string> GetSupportedExtensions(vk::PhysicalDevice physical) {
|
|||
return supported_extensions;
|
||||
}
|
||||
|
||||
std::unordered_map<vk::Format, vk::FormatProperties> GetFormatProperties(
|
||||
std::unordered_map<vk::Format, vk::FormatProperties3> GetFormatProperties(
|
||||
vk::PhysicalDevice physical) {
|
||||
std::unordered_map<vk::Format, vk::FormatProperties> format_properties;
|
||||
std::unordered_map<vk::Format, vk::FormatProperties3> format_properties;
|
||||
for (const auto& format : LiverpoolToVK::GetAllFormats()) {
|
||||
format_properties.emplace(format, physical.getFormatProperties(format));
|
||||
vk::FormatProperties3 properties3{};
|
||||
vk::FormatProperties2 properties2 = {
|
||||
.pNext = &properties3,
|
||||
};
|
||||
physical.getFormatProperties2(format, &properties2);
|
||||
format_properties.emplace(format, properties3);
|
||||
}
|
||||
return format_properties;
|
||||
}
|
||||
|
@ -496,9 +501,9 @@ bool Instance::IsImageFormatSupported(const vk::Format format) const {
|
|||
UNIMPLEMENTED_MSG("Properties of format {} have not been queried.", vk::to_string(format));
|
||||
}
|
||||
|
||||
constexpr vk::FormatFeatureFlags optimal_flags = vk::FormatFeatureFlagBits::eTransferSrc |
|
||||
vk::FormatFeatureFlagBits::eTransferDst |
|
||||
vk::FormatFeatureFlagBits::eSampledImage;
|
||||
constexpr vk::FormatFeatureFlags2 optimal_flags = vk::FormatFeatureFlagBits2::eTransferSrc |
|
||||
vk::FormatFeatureFlagBits2::eTransferDst |
|
||||
vk::FormatFeatureFlagBits2::eSampledImage;
|
||||
return (it->second.optimalTilingFeatures & optimal_flags) == optimal_flags;
|
||||
}
|
||||
|
||||
|
@ -512,7 +517,7 @@ bool Instance::IsVertexFormatSupported(const vk::Format format) const {
|
|||
UNIMPLEMENTED_MSG("Properties of format {} have not been queried.", vk::to_string(format));
|
||||
}
|
||||
|
||||
constexpr vk::FormatFeatureFlags optimal_flags = vk::FormatFeatureFlagBits::eVertexBuffer;
|
||||
constexpr vk::FormatFeatureFlags2 optimal_flags = vk::FormatFeatureFlagBits2::eVertexBuffer;
|
||||
return (it->second.bufferFeatures & optimal_flags) == optimal_flags;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ private:
|
|||
vk::Queue graphics_queue;
|
||||
std::vector<vk::PhysicalDevice> physical_devices;
|
||||
std::vector<std::string> available_extensions;
|
||||
std::unordered_map<vk::Format, vk::FormatProperties> format_properties;
|
||||
std::unordered_map<vk::Format, vk::FormatProperties3> format_properties;
|
||||
TracyVkCtx profiler_context{};
|
||||
u32 queue_family_index{0};
|
||||
bool image_view_reinterpretation{true};
|
||||
|
|
Loading…
Reference in a new issue