SDL_DownloadFromGPUTexture(3)

πŸ’– SDL_DownloadFromGPUTexture πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the docs, where we're talking about SDL_DownloadFromGPUTexture ✨


🌸 NAME 🌸

SDL_DownloadFromGPUTexture β€” copies data from a texture to a transfer buffer on the GPU timeline. it's giving "move that pixel data, queen" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_gpu.h>

void SDL_DownloadFromGPUTexture(
    SDL_GPUCopyPass *copy_pass,
    const SDL_GPUTextureRegion *source,
    const SDL_GPUTextureTransferInfo *destination);

no return value, no drama, it just does the thing πŸ¦‹


✨ DESCRIPTION ✨

so like, this pulls data out of a texture and drops it into a transfer buffer β€” and it all happens on the GPU timeline, which is the whole point, iykyk 😌

but here's the tea, and it's important: this data is not guaranteed to be copied until the command buffer fence is signaled. fr fr. do not go reading that buffer before the fence says it's good and ready, or you will be in your flop era πŸ’€


🫢 FUNCTION PARAMETERS 🫢

  • copy_pass β€” a copy pass handle. this is the little passport your copy gets stamped with 🎫
  • source β€” the source texture region. this is the bit of texture we're grabbing from πŸ‘‘
  • destination β€” the destination transfer buffer with image layout information. this is where the data lands, layout info and all πŸ“¦

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0 β€” so if you're on anything older, bestie, it's not you, it's the version 😭


⭐ SEE ALSO ⭐

nothing else listed here, so just vibe with what we've got 🧚


and that's the whole page, no notes πŸ’– brought to you by Simple Directmedia Layer, rocking SDL 3.4.18 β€” stay iconic, go signal that fence, and slay your downloads πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from