Minor perf improvement on nVidia
nVidia's driver does not like you mapping a STATIC buffer, as they're
usually in parts of VRAM not directly accessible by the CPU. The driver
therefore has to migrate the buffer somewhere slower.
We initialize the object bounds buffer by mapping it and writing directly
into it. This is good where we're doing coordinate transform on the CPU:
we're changing it every frame and it can be a dynamic buffer, but we only
need to do it once if the GPU is doing coordinate transforms so we make it a
static buffer.
This change "fakes" mapping a STATIC buffer for the first time by allocating
some CPU-side memory, having the application write into that, and then initializing
the buffer with that. This removes a performance warning on nVidia when switching
to GPU-side coordinate transforms.
UCC git Repository :: git.ucc.asn.au