From b24a8465da1fb4bafa40409615d5962b2fea790e Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 23 Oct 2022 20:49:35 +0100 Subject: [PATCH] Don't require depthClamp --- app/src/main/cpp/skyline/gpu.cpp | 1 - .../skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp | 2 ++ app/src/main/cpp/skyline/gpu/trait_manager.cpp | 1 + app/src/main/cpp/skyline/gpu/trait_manager.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/gpu.cpp b/app/src/main/cpp/skyline/gpu.cpp index 6e24724f..b541bbb7 100644 --- a/app/src/main/cpp/skyline/gpu.cpp +++ b/app/src/main/cpp/skyline/gpu.cpp @@ -245,7 +245,6 @@ namespace skyline::gpu { FEAT_REQ(vk::PhysicalDeviceFeatures2, features.independentBlend); FEAT_REQ(vk::PhysicalDeviceFeatures2, features.shaderImageGatherExtended); FEAT_REQ(vk::PhysicalDeviceFeatures2, features.depthBiasClamp); - FEAT_REQ(vk::PhysicalDeviceFeatures2, features.depthClamp); FEAT_REQ(vk::PhysicalDeviceShaderDrawParametersFeatures, shaderDrawParameters); #undef FEAT_REQ diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp index 53bc6061..7b0e5e54 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp @@ -494,6 +494,8 @@ namespace skyline::gpu::interconnect::maxwell3d { rasterizationCreateInfo.frontFace = packedState.frontFaceClockwise ? vk::FrontFace::eClockwise : vk::FrontFace::eCounterClockwise; rasterizationCreateInfo.depthBiasEnable = packedState.depthBiasEnable; rasterizationCreateInfo.depthClampEnable = packedState.depthClampEnable; + if (!ctx.gpu.traits.supportsDepthClamp) + Logger::Warn("Depth clamp used on guest without host support"); rasterizationState.get().provokingVertexMode = ConvertProvokingVertex(packedState.provokingVertex); constexpr vk::PipelineMultisampleStateCreateInfo multisampleState{ diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.cpp b/app/src/main/cpp/skyline/gpu/trait_manager.cpp index 3d68d398..d1cb07af 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/trait_manager.cpp @@ -161,6 +161,7 @@ namespace skyline::gpu { FEAT_SET(vk::PhysicalDeviceFeatures2, features.fragmentStoresAndAtomics, supportsFragmentStoresAndAtomics) FEAT_SET(vk::PhysicalDeviceFeatures2, features.shaderStorageImageWriteWithoutFormat, supportsShaderStorageImageWriteWithoutFormat) FEAT_SET(vk::PhysicalDeviceFeatures2, features.wideLines, supportsWideLines) + FEAT_SET(vk::PhysicalDeviceFeatures2, features.depthClamp, supportsDepthClamp) #undef FEAT_SET diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.h b/app/src/main/cpp/skyline/gpu/trait_manager.h index d1e34d0b..5dc17646 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.h +++ b/app/src/main/cpp/skyline/gpu/trait_manager.h @@ -45,6 +45,7 @@ namespace skyline::gpu { bool supportsShaderStorageImageWriteWithoutFormat{}; //!< If the device supports the 'shaderStorageImageWriteWithoutFormat' Vulkan feature bool supportsSubgroupVote{}; //!< If subgroup votes are supported in shaders with SPV_KHR_subgroup_vote bool supportsWideLines{}; //!< If the device supports the 'wideLines' Vulkan feature + bool supportsDepthClamp{}; //!< If the device supports the 'depthClamp' Vulkan feature u32 subgroupSize{}; //!< Size of a subgroup on the host GPU std::bitset<7> bcnSupport{}; //!< Bitmask of BCn texture formats supported, it is ordered as BC1, BC2, BC3, BC4, BC5, BC6H and BC7