From 950438bf58fc27c762bd21e4f4bb71b37a19c4b2 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Tue, 20 Dec 2022 15:54:50 +0100 Subject: [PATCH] Enable `VK_KHR_image_format_list` during device init `VK_KHR_image_format_list` is a requirement for `VK_KHR_imageless_framebuffer`, which we use. --- app/src/main/cpp/skyline/gpu/trait_manager.cpp | 9 +++++---- app/src/main/cpp/skyline/gpu/trait_manager.h | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.cpp b/app/src/main/cpp/skyline/gpu/trait_manager.cpp index bcd1c5ae..dde27adb 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/trait_manager.cpp @@ -46,7 +46,8 @@ namespace skyline::gpu { EXT_SET("VK_EXT_provoking_vertex", hasProvokingVertexExt); EXT_SET("VK_EXT_vertex_attribute_divisor", hasVertexAttributeDivisorExt); EXT_SET_COND("VK_KHR_push_descriptor", supportsPushDescriptors, !quirks.brokenPushDescriptors); - EXT_SET("VK_KHR_imageless_framebuffer", hasImagelessFramebuffersExt); + EXT_SET("VK_KHR_image_format_list", supportsImageFormatList); + EXT_SET_COND("VK_KHR_imageless_framebuffer", hasImagelessFramebuffersExt, supportsImageFormatList); EXT_SET("VK_EXT_global_priority", supportsGlobalPriority); EXT_SET("VK_EXT_shader_viewport_index_layer", supportsShaderViewportIndexLayer); EXT_SET("VK_KHR_spirv_1_4", supportsSpirv14); @@ -61,6 +62,7 @@ namespace skyline::gpu { EXT_SET("VK_EXT_robustness2", hasRobustness2Ext); } + #undef EXT_SET_COND #undef EXT_SET #undef EXT_SET_V } @@ -85,7 +87,6 @@ namespace skyline::gpu { else enabledFeatures2.unlink(); - if (hasExtendedDynamicStateExt) FEAT_SET(vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT, extendedDynamicState, supportsExtendedDynamicState) else @@ -156,9 +157,9 @@ namespace skyline::gpu { } if (hasImagelessFramebuffersExt) { - FEAT_SET(vk::PhysicalDeviceImagelessFramebufferFeatures, imagelessFramebuffer, supportsImagelessFramebuffers) + FEAT_SET(vk::PhysicalDeviceImagelessFramebufferFeaturesKHR, imagelessFramebuffer, supportsImagelessFramebuffers) } else { - enabledFeatures2.unlink(); + enabledFeatures2.unlink(); } if (hasTransformFeedbackExt) { diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.h b/app/src/main/cpp/skyline/gpu/trait_manager.h index 0eeae221..873da075 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.h +++ b/app/src/main/cpp/skyline/gpu/trait_manager.h @@ -23,6 +23,7 @@ namespace skyline::gpu { bool supportsVertexAttributeDivisor{}; //!< If the device supports a divisor for instance-rate vertex attributes (with VK_EXT_vertex_attribute_divisor) bool supportsVertexAttributeZeroDivisor{}; //!< If the device supports a zero divisor for instance-rate vertex attributes (with VK_EXT_vertex_attribute_divisor) bool supportsPushDescriptors{}; //!< If the device supports push descriptors (with VK_KHR_push_descriptor) + bool supportsImageFormatList{}; //!< If the device supports providing a list of formats that can be used with an image (with VK_KHR_image_format_list) bool supportsImagelessFramebuffers{}; //!< If the device supports imageless framebuffers (with VK_KHR_imageless_framebuffer) bool supportsGlobalPriority{}; //!< If the device supports global priorities for queues (with VK_EXT_global_priority) bool supportsMultipleViewports{}; //!< If the device supports more than one viewport @@ -112,7 +113,7 @@ namespace skyline::gpu { vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT, vk::PhysicalDeviceRobustness2FeaturesEXT>; - TraitManager(const DeviceFeatures2 &deviceFeatures2, DeviceFeatures2 &enabledFeatures2, const std::vector &deviceExtensions, std::vector> &enabledExtensions, const DeviceProperties2 &deviceProperties2, const vk::raii::PhysicalDevice& physicalDevice); + TraitManager(const DeviceFeatures2 &deviceFeatures2, DeviceFeatures2 &enabledFeatures2, const std::vector &deviceExtensions, std::vector> &enabledExtensions, const DeviceProperties2 &deviceProperties2, const vk::raii::PhysicalDevice &physicalDevice); /** * @brief Applies driver specific binary patches to the driver (e.g. BCeNabler)