From 246a6ee8f0feade1217c721d1fbb1fd16153d966 Mon Sep 17 00:00:00 2001 From: dustinspace217 Date: Wed, 4 Nov 2026 09:21:55 -0800 Subject: [PATCH] Vulkan: match OpenGL's depth bias in the shadow map pass (#7944) OpenGL's shadow pass calls gr_zbias(-1024), which sets a polygon offset of factor 1, units 1024 (gropengltnl.cpp, gropengl.cpp). The Vulkan shadow pass set a constant bias of -1024 with no slope term: the opposite sign, on a depth buffer that uses the same less-than test. Use OpenGL's values. Co-authored-by: Dustinspace217 --- code/graphics/vulkan/VulkanDraw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/graphics/vulkan/VulkanDraw.cpp b/code/graphics/vulkan/VulkanDraw.cpp index b828dcc807..1dcc2428e5 100644 --- a/code/graphics/vulkan/VulkanDraw.cpp +++ b/code/graphics/vulkan/VulkanDraw.cpp @@ -748,7 +748,7 @@ void VulkanDrawManager::renderShadowDraw(gr_buffer_handle ubo_handle, size_t ubo } stateTracker->bindPipeline(pipeline, pipelineManager->getPipelineLayout()); - stateTracker->setDepthBias(-1024.0f, 0.0f); + stateTracker->setDepthBias(1024.0f, 1.0f); // GL shadow pass: gr_zbias(-1024) = polygon offset factor 1, units 1024 // Bind descriptor sets: shadowMapData (per-draw) and shadowCascadeParams // (bound separately, per-frame, via shadow_cascade_params_bind) both live in