From fa6f834974d8fe69b101c19685305a4a8d9b8894 Mon Sep 17 00:00:00 2001 From: SSimco <37044560+SSimco@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:46:09 +0300 Subject: [PATCH] Disable unsupported features --- .../HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp | 13 ++++++++----- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index 07e05bc4..75c60268 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -276,7 +276,10 @@ void VulkanRenderer::GetDeviceFeatures() cemuLog_log(LogType::Force, "Vulkan: present_wait extension: {}", (pwf.presentWait && pidf.presentId) ? "supported" : "unsupported"); m_featureControl.deviceFeatures.geometry_shader = physicalDeviceFeatures2.features.geometryShader; m_featureControl.deviceFeatures.logic_op = physicalDeviceFeatures2.features.logicOp; - + m_featureControl.deviceFeatures.sampler_anisotropy = physicalDeviceFeatures2.features.samplerAnisotropy; + m_featureControl.deviceFeatures.occlusion_query_precise = physicalDeviceFeatures2.features.occlusionQueryPrecise; + m_featureControl.deviceFeatures.depth_clamp = physicalDeviceFeatures2.features.depthClamp; + m_featureControl.deviceFeatures.vertex_pipeline_stores_and_atomics = physicalDeviceFeatures2.features.vertexPipelineStoresAndAtomics; /* Get Vulkan device properties and limits */ VkPhysicalDeviceFloatControlsPropertiesKHR pfcp{}; prevStruct = nullptr; @@ -465,12 +468,12 @@ VulkanRenderer::VulkanRenderer() VkPhysicalDeviceFeatures deviceFeatures = {}; deviceFeatures.independentBlend = VK_TRUE; - deviceFeatures.samplerAnisotropy = VK_TRUE; + deviceFeatures.samplerAnisotropy = m_featureControl.deviceFeatures.sampler_anisotropy; deviceFeatures.imageCubeArray = VK_TRUE; deviceFeatures.geometryShader = m_featureControl.deviceFeatures.geometry_shader; deviceFeatures.logicOp = m_featureControl.deviceFeatures.logic_op; - deviceFeatures.occlusionQueryPrecise = VK_TRUE; - deviceFeatures.depthClamp = VK_TRUE; + deviceFeatures.occlusionQueryPrecise = m_featureControl.deviceFeatures.occlusion_query_precise; + deviceFeatures.depthClamp = m_featureControl.deviceFeatures.depth_clamp; deviceFeatures.depthBiasClamp = VK_TRUE; if (m_vendor == GfxVendor::AMD) { @@ -479,7 +482,7 @@ VulkanRenderer::VulkanRenderer() } if (m_featureControl.mode.useTFEmulationViaSSBO) { - deviceFeatures.vertexPipelineStoresAndAtomics = true; + m_featureControl.mode.useTFEmulationViaSSBO = deviceFeatures.vertexPipelineStoresAndAtomics = m_featureControl.deviceFeatures.vertex_pipeline_stores_and_atomics; } void* deviceExtensionFeatures = nullptr; diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h index 416ce242..af501b5f 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h @@ -462,6 +462,10 @@ private: { bool geometry_shader; bool logic_op; + bool sampler_anisotropy; + bool occlusion_query_precise; + bool depth_clamp; + bool vertex_pipeline_stores_and_atomics; } deviceFeatures; struct