llvmpipe: support pipe_resource-based constant buffers
authorBrian Paul <brianp@vmware.com>
Mon, 10 Dec 2012 19:31:46 +0000 (12:31 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 11 Dec 2012 19:48:06 +0000 (12:48 -0700)
commit3427466e6dbbb8db7c1ecda6b3859ca1cc5827a3
tree0ab7a2dca11aad6b000c75220bec7fa554ba04f3
parent4c6053dc519aecd93c12c383b4cdc0c159b3d9b3
llvmpipe: support pipe_resource-based constant buffers

Before this we only supported user-based constant buffers.

First, we basically plumb pipe_constant_buffer objects through llvmpipe
rather than pipe_resource objects.

Second, update llvmpipe_set_constant_buffer() and try_update_scene_state()
so they understand both resource- and user-based constant buffers.

The problem with user constant buffers is the potential for use-after-free,
as seen in some WebGL tests.  The next patch will flip the switch for
resource-based const buffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup.h
src/gallium/drivers/llvmpipe/lp_setup_context.h
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_texture.c