diff options
author | Eric Anholt <[email protected]> | 2014-07-18 16:29:18 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-08-08 18:59:46 -0700 |
commit | 427f934f9e75deafdc40348aad0426ea2b31515c (patch) | |
tree | 917e8c3315d6a58f640fac71bdd98a0a140444d3 /src/gallium/drivers | |
parent | db8712bcbc7875f1b7cff1cf5c6e08eed028f77f (diff) |
vc4: Fix UBO allocation when no uniforms are used.
We do rely on a real BO getting allocated, so make sure we ask for a non-zero size.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 2107ef73c1f..4755ea0db90 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -606,7 +606,8 @@ vc4_get_uniform_bo(struct vc4_context *vc4, struct vc4_shader_state *shader, uint32_t *out_offset) { struct vc4_shader_uniform_info *uinfo = &shader->uniforms[shader_index]; - struct vc4_bo *ubo = vc4_bo_alloc(vc4->screen, uinfo->count * 4, "ubo"); + struct vc4_bo *ubo = vc4_bo_alloc(vc4->screen, + MAX2(1, uinfo->count * 4), "ubo"); uint32_t *map = vc4_bo_map(ubo); for (int i = 0; i < uinfo->count; i++) { |