summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2015-06-18 15:47:00 +0100
committerJose Fonseca <[email protected]>2015-06-19 07:21:06 +0100
commitafeb92220690c8f27cdc56c30e109ca175d51d83 (patch)
tree3a0b93389b34d796066d2e27cb59cabb8aad62c7 /src/gallium/drivers/llvmpipe/lp_setup.c
parentf734d2556013e9239e91f43b563b5b1d8f03ada4 (diff)
llvmpipe: Truncate the binned constants to max const buffer size.
Tested with Ilia Mirkin's gzdoom.trace and "arb_uniform_buffer_object-maxuniformblocksize fsexceed" piglit test without my earlier fix to fail linkage when UBO exceeds GL_MAX_UNIFORM_BLOCK_SIZE. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 56292c68c5f..4c8167a9e7d 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -1069,10 +1069,13 @@ try_update_scene_state( struct lp_setup_context *setup )
if (setup->dirty & LP_SETUP_NEW_CONSTANTS) {
for (i = 0; i < Elements(setup->constants); ++i) {
struct pipe_resource *buffer = setup->constants[i].current.buffer;
- const unsigned current_size = setup->constants[i].current.buffer_size;
+ const unsigned current_size = MIN2(setup->constants[i].current.buffer_size,
+ LP_MAX_TGSI_CONST_BUFFER_SIZE);
const ubyte *current_data = NULL;
int num_constants;
+ STATIC_ASSERT(DATA_BLOCK_SIZE >= LP_MAX_TGSI_CONST_BUFFER_SIZE);
+
if (buffer) {
/* resource buffer */
current_data = (ubyte *) llvmpipe_resource_data(buffer);