Minor perf improvement on nVidia
authorDavid Gow <[email protected]>
Wed, 4 Jun 2014 14:34:02 +0000 (22:34 +0800)
committerDavid Gow <[email protected]>
Wed, 4 Jun 2014 14:34:02 +0000 (22:34 +0800)
commitddf7783ce69eb619f5a6b12e779c134279aa2ac6
tree1401c5ea6ff9f69c746c627fbe1c0327caed1375
parentaf1f07330cb8f4d448cc75ee720b633338eba1e8
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.
bin/ipdf
src/graphicsbuffer.cpp
src/graphicsbuffer.h

UCC git Repository :: git.ucc.asn.au