SDL_GPUDep...lTargetInfo(3type)
β¨ SDL_GPUDepthStencilTargetInfo β¨
okay so bestie, welcome to the SDL3 DATATYPES section of the manual π this whole page is about one little struct and honestly? it's giving backstage pass to your render pass. no cap.
πΈ NAME πΈ
SDL_GPUDepthStencilTargetInfo β a structure specifying the parameters of a depth-stencil target used by a render pass. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPUDepthStencilTargetInfo
{
SDL_GPUTexture *texture; /**< The texture that will be used as the depth stencil target by the render pass. */
float clear_depth; /**< The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
SDL_GPULoadOp load_op; /**< What is done with the depth contents at the beginning of the render pass. */
SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */
SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */
SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */
bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */
Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
Uint8 mip_level; /**< The mip level to use as the depth stencil target. */
Uint8 layer; /**< The layer index to use as the depth stencil target. */
} SDL_GPUDepthStencilTargetInfo;
like. look at her. ten fields. an icon. π
π DESCRIPTION π
so the load_op field decides what happens to the depth contents of the texture at the beginning of the render pass. the options are:
- LOAD β loads the depth values currently in the texture. keeping what was already there, periodt. β¨
- CLEAR β clears the texture to a single depth.
- DONT_CARE β the driver will do whatever it wants with the memory π this is a good option if you know that every single pixel will be touched in the render pass. (the way that's such a vibe when you're covering the whole screen anyway)
and the store_op field decides what happens to the depth results of the render pass:
- STORE β stores the depth results in the texture.
- DONT_CARE β the driver will do whatever it wants with the depth results. this is often a good option for depth/stencil textures that don't need to be reused again. π bye bye data, we never needed you.
now for the stencil half, because she has her own whole setup π
the stencil_load_op field decides what happens to the stencil contents of the texture at the beginning of the render pass:
- LOAD β loads the stencil values currently in the texture.
- CLEAR β clears the stencil values to a single value.
- DONT_CARE β the driver will do whatever it wants with the memory. this is a good option if you know that every single pixel will be touched in the render pass. π₯
and the stencil_store_op field decides what happens to the stencil results of the render pass:
- STORE β stores the stencil results in the texture.
- DONT_CARE β the driver will do whatever it wants with the stencil results. this is often a good option for depth/stencil textures that don't need to be reused again. π¦
β οΈ note that depth/stencil targets do not support multisample resolves. not a thing. don't ask. π
β οΈ also, due to ABI limitations, depth textures with more than 255 layers are not supported. so like, 255 layers max bestie, that's the ceiling. π§
π AVAILABILITY π
this struct has been available since SDL 3.2.0. she's not new new, but she's ours. π
β SEE ALSO β
Simple Directmedia Layer π«Ά SDL 3.4.18 π«Ά SDL_GPUDep...lTargetInfo(3type) β that's the whole page bestie, you ate, go render something iconic πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms