From 595f7b7ed903a16b3fe0a310fb925e8fb3953fd0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 29 Sep 2025 05:52:12 -0700 Subject: [PATCH] Revert "Fixed Vulkan validation error" This reverts commit b82b1f416ff52d0ca72404920bc87b52b6d747f3. The renderer should not be enabling depth clamping. --- src/gpu/vulkan/SDL_gpu_vulkan.c | 6 +----- src/render/gpu/SDL_pipeline_gpu.c | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 972592af31..2b32e3e5af 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -6384,11 +6384,7 @@ static SDL_GPUGraphicsPipeline *VULKAN_CreateGraphicsPipeline( rasterizationStateCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; rasterizationStateCreateInfo.pNext = NULL; rasterizationStateCreateInfo.flags = 0; - if (renderer->desiredDeviceFeatures.depthClamp) { - rasterizationStateCreateInfo.depthClampEnable = !createinfo->rasterizer_state.enable_depth_clip; - } else { - rasterizationStateCreateInfo.depthClampEnable = VK_FALSE; - } + rasterizationStateCreateInfo.depthClampEnable = !createinfo->rasterizer_state.enable_depth_clip; rasterizationStateCreateInfo.rasterizerDiscardEnable = VK_FALSE; rasterizationStateCreateInfo.polygonMode = SDLToVK_PolygonMode( renderer, diff --git a/src/render/gpu/SDL_pipeline_gpu.c b/src/render/gpu/SDL_pipeline_gpu.c index 31da279777..02242f99fb 100644 --- a/src/render/gpu/SDL_pipeline_gpu.c +++ b/src/render/gpu/SDL_pipeline_gpu.c @@ -87,6 +87,7 @@ static SDL_GPUGraphicsPipeline *MakePipeline(SDL_GPUDevice *device, GPU_Shaders pci.rasterizer_state.cull_mode = SDL_GPU_CULLMODE_NONE; pci.rasterizer_state.fill_mode = SDL_GPU_FILLMODE_FILL; pci.rasterizer_state.front_face = SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE; + pci.rasterizer_state.enable_depth_clip = true; SDL_GPUVertexBufferDescription vertex_buffer_desc; SDL_zero(vertex_buffer_desc);