SDL_SetGPUBufferName(3)

πŸ’… SDL_SetGPUBufferName(3) β€” the SDL3 FUNCTIONS girlies know

okay so bestie, this one lives in the SDL3 FUNCTIONS family and it's literally just "give your buffer a nickname". That's it. That's the whole vibe. πŸŽ€


✨ NAME ✨

SDL_SetGPUBufferName β€” sets an arbitrary string constant to label a buffer. 🏷️


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_gpu.h>

void SDL_SetGPUBufferName(
    SDL_GPUDevice *device,
    SDL_GPUBuffer *buffer,
    const char *text);

no cap, that's the whole signature. void. it returns nothing. it just labels. πŸ‘‘


🌸 DESCRIPTION 🌸

okay so here's the tea, and it's important tea: you should use SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING with SDL_CreateGPUBuffer instead of this function to avoid thread safety issues. 😭

like, I know, I know, you found a naming function and you're obsessed (same), but the grown-up move is to name it at creation time. this one is the "oh no I forgot to name it" emergency option. πŸ™ˆ


πŸ’– FUNCTION PARAMETERS πŸ’–

  • device β€” a GPU Context. ✨
  • buffer β€” a buffer to attach the name to. it's getting a glow-up and a name, iconic. πŸ’…
  • text β€” a UTF-8 string constant to mark as the name of the buffer. yes bestie, constant, keep it in mind. πŸ“

πŸ’€ THREAD SAFETY πŸ’€

this function is not thread safe. you must make sure the buffer is not simultaneously used by any other thread. fr fr, do not let two threads touch this buffer at the same time, that's giving undefined chaos and we don't do that here. 🫢

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, sorry babe, no naming for you. πŸ’œ


🧚 SEE ALSO 🧚


and that's the page!! mwah πŸ’‹ this manual page came to you from Simple Directmedia Layer, rockin' SDL 3.4.18. stay hydrated, name your buffers at creation, and go slay βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from