Downgrade Vulkan requirement to 1.2 with extensions.

This commit is contained in:
squidbus 2024-07-12 00:20:23 -07:00 committed by TheTurtle
parent d9231b239c
commit 35d629a730
2 changed files with 11 additions and 6 deletions

View File

@ -180,6 +180,8 @@ bool Instance::CreateDevice() {
color_write_en = add_extension(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME); color_write_en = add_extension(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME);
color_write_en &= add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME); color_write_en &= add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME);
const auto calibrated_timestamps = add_extension(VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME); const auto calibrated_timestamps = add_extension(VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME);
add_extension(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
add_extension(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME);
const auto family_properties = physical_device.getQueueFamilyProperties(); const auto family_properties = physical_device.getQueueFamilyProperties();
if (family_properties.empty()) { if (family_properties.empty()) {
@ -210,7 +212,6 @@ bool Instance::CreateDevice() {
}; };
const auto vk12_features = feature_chain.get<vk::PhysicalDeviceVulkan12Features>(); const auto vk12_features = feature_chain.get<vk::PhysicalDeviceVulkan12Features>();
const auto vk13_features = feature_chain.get<vk::PhysicalDeviceVulkan13Features>();
vk::StructureChain device_chain = { vk::StructureChain device_chain = {
vk::DeviceCreateInfo{ vk::DeviceCreateInfo{
.queueCreateInfoCount = 1u, .queueCreateInfoCount = 1u,
@ -244,10 +245,14 @@ bool Instance::CreateDevice() {
.hostQueryReset = vk12_features.hostQueryReset, .hostQueryReset = vk12_features.hostQueryReset,
.timelineSemaphore = vk12_features.timelineSemaphore, .timelineSemaphore = vk12_features.timelineSemaphore,
}, },
vk::PhysicalDeviceVulkan13Features{ vk::PhysicalDeviceMaintenance4FeaturesKHR{
.shaderDemoteToHelperInvocation = vk13_features.shaderDemoteToHelperInvocation, .maintenance4 = true,
.dynamicRendering = vk13_features.dynamicRendering, },
.maintenance4 = vk13_features.maintenance4, vk::PhysicalDeviceDynamicRenderingFeaturesKHR{
.dynamicRendering = true,
},
vk::PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT{
.shaderDemoteToHelperInvocation = true,
}, },
vk::PhysicalDeviceCustomBorderColorFeaturesEXT{ vk::PhysicalDeviceCustomBorderColorFeaturesEXT{
.customBorderColors = true, .customBorderColors = true,

View File

@ -17,7 +17,7 @@ class WindowSDL;
namespace Vulkan { namespace Vulkan {
constexpr u32 TargetVulkanApiVersion = VK_API_VERSION_1_3; constexpr u32 TargetVulkanApiVersion = VK_API_VERSION_1_2;
vk::SurfaceKHR CreateSurface(vk::Instance instance, const Frontend::WindowSDL& emu_window); vk::SurfaceKHR CreateSurface(vk::Instance instance, const Frontend::WindowSDL& emu_window);