SDL_UploadToGPUBuffer(3)

πŸ’– SDL_UploadToGPUBuffer πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_UploadToGPUBuffer ✨ she's a whole function and she's here to move your data where it needs to go 🫢


✨ NAME ✨

SDL_UploadToGPUBuffer β€” uploads data from a transfer buffer to a buffer. that's it, that's the vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

void SDL_UploadToGPUBuffer(
    SDL_GPUCopyPass *copy_pass,
    const SDL_GPUTransferBufferLocation *source,
    const SDL_GPUBufferRegion *destination,
    bool cycle);

like. look at her. four little params and she's serving πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

the upload happens on the GPU timeline, okay? so the timing is giving async but make it graphics. and the best part: you may assume that the upload has finished in subsequent commands. no cap. so you don't have to sit there stressing about whether it landed β€” by the time your next commands roll around, it's done. slay πŸ”₯


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • copy_pass β€” a copy pass handle. she's the pass doing the copying, obviously πŸ’…
  • source β€” the source transfer buffer, with offset. iykyk, offset included, don't forget it πŸ™ˆ
  • destination β€” the destination buffer, with offset and size. yes bestie, size too, she's not like the others πŸ‘‘
  • cycle β€” if true, it cycles the buffer if it's already bound. otherwise it overwrites the data. so like, cycling vs. straight-up overwriting, pick your fighter 🌈

⭐ AVAILABILITY ⭐

this function has been available since SDL 3.2.0. iconic behavior, honestly πŸ‘‘


and that's the whole page, bestie!! this one comes to you from Simple Directmedia Layer, version SDL 3.4.18 πŸ’– go forth and upload responsibly, ily, bye!! πŸŒΈβœ¨πŸŽ€πŸ¦‹πŸ’…πŸ«Ά

πŸ“¦ where this page comes from