Merge pull request #13830 from CrossVR/broken-depth-clamp-control

DriverDetails: Disable depth_clamp_control on official AMD drivers
This commit is contained in:
Tilka 2025-07-31 01:06:00 +01:00 committed by GitHub
commit 812c6c2ea4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View file

@ -380,7 +380,7 @@ std::unique_ptr<VKPipeline> VKPipeline::Create(const AbstractPipelineConfig& con
static const VkRect2D scissor = {{0, 0}, {1, 1}}; static const VkRect2D scissor = {{0, 0}, {1, 1}};
static const VkPipelineViewportStateCreateInfo viewport_state = { static const VkPipelineViewportStateCreateInfo viewport_state = {
VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
&depth_clamp_state, g_backend_info.bSupportsUnrestrictedDepthRange ? &depth_clamp_state : nullptr,
0, // VkPipelineViewportStateCreateFlags flags; 0, // VkPipelineViewportStateCreateFlags flags;
1, // uint32_t viewportCount 1, // uint32_t viewportCount
&viewport, // const VkViewport* pViewports &viewport, // const VkViewport* pViewports

View file

@ -664,7 +664,7 @@ bool VulkanContext::SelectDeviceExtensions(bool enable_surface)
AddExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, false); AddExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, false);
AddExtension(VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, false); AddExtension(VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, false);
if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_D32F_CLEAR)) if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_DEPTH_CLAMP_CONTROL))
{ {
// Unrestricted depth range is one of the few extensions that changes the behavior // Unrestricted depth range is one of the few extensions that changes the behavior
// of Vulkan just by being enabled, so we rely on lazy evaluation to ensure it is // of Vulkan just by being enabled, so we rely on lazy evaluation to ensure it is

View file

@ -158,6 +158,8 @@ constexpr BugInfo m_known_bugs[] = {
BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING, -1.0, -1.0, true}, BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING, -1.0, -1.0, true},
{API_VULKAN, OS_ANDROID, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, {API_VULKAN, OS_ANDROID, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY, -1.0, -1.0, true}, BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY, -1.0, -1.0, true},
{API_VULKAN, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_DEPTH_CLAMP_CONTROL,
-1.0, -1.0, true},
}; };
static std::map<Bug, BugInfo> m_bugs; static std::map<Bug, BugInfo> m_bugs;
@ -297,6 +299,7 @@ static const char* to_string(Bug bug)
case BUG_BROKEN_DISCARD_WITH_EARLY_Z: return "broken-discard-with-early-z"; case BUG_BROKEN_DISCARD_WITH_EARLY_Z: return "broken-discard-with-early-z";
case BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING: return "broken-dynamic-sampler-indexing"; case BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING: return "broken-dynamic-sampler-indexing";
case BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY: return "slow-optimal-image-to-buffer-copy"; case BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY: return "slow-optimal-image-to-buffer-copy";
case BUG_BROKEN_DEPTH_CLAMP_CONTROL: return "broken-depth-clamp-control";
} }
return "Unknown"; return "Unknown";
} }

View file

@ -342,7 +342,14 @@ enum Bug
// Affected devices: Adreno // Affected devices: Adreno
// Started Version: -1 // Started Version: -1
// Ended Version: -1 // Ended Version: -1
BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY,
// BUG: Incorrect implementation of VK_EXT_depth_clamp_control causes incorrect depth values to
// be written to the depth buffer.
// Affected devices: Official AMD (RADV is unaffected)
// Started Version: -1
// Ended Version: -1
BUG_BROKEN_DEPTH_CLAMP_CONTROL
}; };
// Initializes our internal vendor, device family, and driver version // Initializes our internal vendor, device family, and driver version