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, the Uint32 of 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 if has_depth_stencil_target is false. so don't be out here setting it and expecting it to do something when the flag says no πŸ™ˆ
  • has_depth_stencil_target β€” true means 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:


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