nv50,nvc0: optimize coherent buffer checking at draw time
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 9 Dec 2015 18:53:18 +0000 (19:53 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 3 Jan 2016 11:17:05 +0000 (12:17 +0100)
commit53dddab78c9bc7fbfd78bf23284ec6d92b70e93b
tree91724b558e504d80dba49c0ab68c8d9f8bd2cca8
parent28dea2662699072715f67ef34e910d278f88f3b1
nv50,nvc0: optimize coherent buffer checking at draw time

Instead of iterating over all the buffer resources looking for coherent
buffers, we keep track of a context-wide count. This will save some
iterations (and CPU cycles) in 99.99% case because usually coherent
buffers are not so used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv50_context.h
src/gallium/drivers/nouveau/nv50/nv50_state.c
src/gallium/drivers/nouveau/nv50/nv50_vbo.c
src/gallium/drivers/nouveau/nvc0/nvc0_context.h
src/gallium/drivers/nouveau/nvc0/nvc0_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c