I noticed when using the SDL GPU API function:
SDL_BindGPUComputeStorageBuffers(SDL_GPUComputePass *compute_pass,
Uint32 first_slot,
SDL_GPUBuffer *const *storage_buffers,
Uint32 num_bindings);
SDL wasn’t copying the binding array I passed in (a bad assumption on my part). This left me with two questions:
- Should I expect this behaviour for all SDL GPU API calls that take in pointers to buffer/binding array
- When is it safe to free the structs pointed to by API function parameters (ex.
SDL_GPUBuffer *const *storage_buffersis a pointer to a struct, that struct cannot be freed until SDL GPU API is done with it)?