svga: round UBO constant buffer size up/down to multiple of 16 bytes
authorBrian Paul <brianp@vmware.com>
Tue, 6 Oct 2015 22:55:39 +0000 (16:55 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 7 Oct 2015 14:45:56 +0000 (08:45 -0600)
commit2bad030ac9c47c316f615db83c52cf0391f64f3f
treefeae519f228825aff316901742cd1ade051a8a29
parent4ea5ed9f51c2ec851ac2d81108035bf7046bbc69
svga: round UBO constant buffer size up/down to multiple of 16 bytes

The svga3d device requires constant buffers to be a multiple of 16 bytes
in size.  OpenGL UBOs may not fit that restriction.  As a work-around,
round the size up if possible, else round down.

Note that this patch only effects UBO constant buffers (index 1 or higher),
not the 0th/default constant buffer.

Fixes the game Grim Fandango Remastered.  VMware bug 1510130.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/svga/svga_state_constants.c