SDL_BeginGPURenderPass(3)
π SDL_BeginGPURenderPass π
okay bestie, welcome to the SDL3 FUNCTIONS page for SDL_BeginGPURenderPass β she's the one who opens the render pass and honestly? main character energy fr fr. π
β¨ NAME β¨
SDL_BeginGPURenderPass β begins a render pass on a command buffer. that's it, that's the whole job, and she does it flawlessly π
π SYNOPSIS π
#include <SDL3/SDL_gpu.h>
SDL_GPURenderPass * SDL_BeginGPURenderPass(
SDL_GPUCommandBuffer *command_buffer,
const SDL_GPUColorTargetInfo *color_target_infos,
Uint32 num_color_targets,
const SDL_GPUDepthStencilTargetInfo *depth_stencil_target_info);
π¦ DESCRIPTION π¦
so a render pass is basically a lil friend group of texture subresources β or, when we're in 3D texture territory, depth slices π β and those are the things you're gonna be rendering to during the pass. each one comes with its own clear values and load/store operations, like everybody brought their own snacks.
every single operation related to graphics pipelines has to happen inside a render pass. no sneaking around outside it, okay? π«
the moment you call this, a default viewport and scissor state get set for you automatically. cute, convenient, slay. β¨
and the rule: you cannot begin another render pass, or begin a compute pass, or begin a copy pass, until you've ended the render pass. one at a time, bestie. patience is a virtue π«Ά
β οΈ okay important one, listen up: using SDL_GPU_LOADOP_LOAD before any contents have been written to the texture subresource will result in undefined behavior. like, we do not go there. π
SDL_GPU_LOADOP_CLEAR sets the contents of the texture subresource to a single value before any rendering is performed. π§Ό
it's fine to do an empty render pass using SDL_GPU_STOREOP_STORE to clear a texture β totally legal, no notes. but in general, it's better to think of clearing not as an independent operation, but as something that's done as the beginning of a render pass. like, clearing isn't a solo artist, she's the opening act π€
πΈ FUNCTION PARAMETERS πΈ
command_bufferβ a command buffer. yes, the one you're gonna do the thing on. πcolor_target_infosβ an array of texture subresources with corresponding clear values and load/store ops. the whole squad, assembled. πnum_color_targetsβ the number of color targets in thecolor_target_infosarray. count them. be accurate. π’depth_stencil_target_infoβ a texture subresource with corresponding clear value and load/store ops. may beNULL. optional king, we respect it π«‘
β RETURN VALUE β
Returns a render pass handle. hold onto it, she's important π
π AVAILABILITY π
This function is available since SDL 3.2.0. (vintage, but make it fresh β¨)
π₯ SEE ALSO π₯
SDL_EndGPURenderPass(3)β the other half of the duo. you literally cannot have one without the other, they're a package deal fr fr π
and that's the page!! brought to you by the Simple Directmedia Layer girlies, SDL 3.4.18 era, dated right there in the footer alongside SDL_BeginGPURenderPass(3) β so if anyone asks, that's the version and that's the vibe. now go end that render pass, bestie, you got this πππ¦
π¦ 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