SDL_GPUGra...eTargetInfo(3type)
π SDL_GPUGraphicsPipelineTargetInfo(3type) π
okay bestie, welcome to the datatypes section of the SDL3 manual β this one's the <rainbow>SDL_GPUGraphicsPipelineTargetInfo</rainbow> page, and it's genuinely not as scary as the name makes it look, i promise π«Ά
β¨ NAME β¨
SDL_GPUGraphicsPipelineTargetInfo β a struct that spells out the descriptions of the render targets your graphics pipeline is gonna draw into. like, it's the "hey here's what i'm painting on" form you fill out π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPUGraphicsPipelineTargetInfo
{
const SDL_GPUColorTargetDescription *color_target_descriptions; /**< A pointer to an array of color target descriptions. */
Uint32 num_color_targets; /**< The number of color target descriptions in the above array. */
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. */
bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
} SDL_GPUGraphicsPipelineTargetInfo;
π¦ DESCRIPTION π¦
okay so. this struct is the lil info packet that tells a graphics pipeline what its render targets actually are. let's go field by field, no skips, no cap π₯
color_target_descriptionsβ a pointer to an array of color target descriptions. it's giving "here's my whole palette, bestie" π¨num_color_targetsβ how many color target descriptions live in that array up there. the count, the receipts, theUint32of it all.depth_stencil_formatβ the pixel format of the depth-stencil target. and listen, this one's got a lil asterisk: it gets ignored ifhas_depth_stencil_targetisfalse. so don't be out here setting it and expecting it to do something when the flag says no πhas_depth_stencil_targetβtruemeans the pipeline uses a depth-stencil target. that's the whole job.true= yes we have one,false= nope, and then that format field above is just vibing in the void πpadding1,padding2,padding3β three<purple>Uint8</purple>padding bytes. they're just there, holding space, iconic in their own quiet way. do not touch them, they're not for you π
heads up bestie: the order and the exact types of every single one of these fields matter. copy the struct exactly, don't get creative. this is not the moment for main character energy in your struct layout β¨
π AVAILABILITY π
this struct has been around since SDL 3.2.0 β so it's not brand new new, it's established. a seasoned queen π
β SEE ALSO β
go read these next, they're the whole friend group:
SDL_GPUGraphicsPipelineCreateInfo(3type)SDL_GPUColorTargetDescription(3type)SDL_GPUTextureFormat(3type)
and that's the page, bestie!! π this was Simple Directmedia Layer, SDL 3.4.18, and this datatype page is out here doing its thing. now go forth and describe your render targets correctly, ily, mwah πβ¨π¦
π¦ 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