svga: optimize constant buffer uploads

Graphics / Mesa 3D Graphics Library / Mesa - Charmaine Lee [vmware.com] - 21 March 2016 13:58 UTC

When a constant buffer slot is allocated in the upload buffer, the allocated slot size is always in multiple of 256. But the actual buffer size might not be in multiple of 256. This causes a gap between the ending offset of a slot and the starting offset of the next slot. The gap will prevent the two slots to be updated in a single update command. In order to maximize the chance of merging the contiguous dirty ranges, when a slot is to be allocated in the constant upload buffer, specify a buffer size in multiple of 256.

There is about 10% performance improvement with Lightsmark2008 and 30% with Cinebench R11.

b45b47c svga: optimize constant buffer uploads
src/gallium/drivers/svga/svga_state_constants.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share