GPU: Add enable_depth_clip to RasterizerState (#10964)

This commit is contained in:
Caleb Cornett authored and GitHub committed 2024-09-27 11:18:54 -05:00
1 parent 04bb105d09
commit 5ff6e8d522
5 files changed
+22 -4

No files matched your search

+6 -1
View File
@@ -1355,6 +1355,11 @@ typedef struct SDL_GPUTransferBufferCreateInfo
* A structure specifying the parameters of the graphics pipeline rasterizer
* state.
*
* NOTE: Some backend APIs (D3D11/12) will enable depth clamping even if
* enable_depth_clip is true. If you rely on this clamp+clip behavior,
* consider enabling depth clip and then manually clamping depth in your
* fragment shaders on Metal and Vulkan.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUGraphicsPipelineCreateInfo
@@ -1368,9 +1373,9 @@ typedef struct SDL_GPURasterizerState
float depth_bias_clamp; /**< The maximum depth bias of a fragment. */
float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */
bool enable_depth_bias; /**< true to bias fragment depth values. */
bool enable_depth_clip; /**< true to enable depth clip, false to enable depth clamp. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
} SDL_GPURasterizerState;
/**