So far I’ve been using OpenGL (4.5) and now considering switching to SDL_GPU, eventually. So far I watched some tutorials and looked at the documentation, and I do have some questions regarding buffers in SDL_GPU:
-
It looks like one cannot upload / download data without a transfer-buffer, and one can only map a transfer-buffer but not a GPU-buffer. Why is there always a need for a transfer-buffer when for example graphics on mobile use the same ram for CPU and video? Sounds to me like one could just map such buffer and write data to it directly (as long as not in use for something else).
-
Is the transfer-buffer guaranteed to be on host/CPU while the GPU-buffer on device/GPU or is it more like OpenGL where you give hints about usage and then the implementation decides (based on the hints and the actual usage and what not). Does SDL_GPUTransferBufferUsage has anything to do with that?
-
Why is there no function to map only a region of a buffer, only the entire buffer? Is it because the transfer-buffer is always in CPU-RAM and mapping does not actually copy anything from GPU-to-CPU so there is no gain in specifying some region only? Or is there some other reason?