mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-17 03:50:35 +01:00
lavapipe: stop allocating 0 size const buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19163>
This commit is contained in:
parent
d766093199
commit
001c8fdfbf
1 changed files with 10 additions and 8 deletions
|
|
@ -257,15 +257,17 @@ fill_ubo0(struct rendering_state *state, uint8_t *mem, enum pipe_shader_type pst
|
|||
static void
|
||||
update_pcbuf(struct rendering_state *state, enum pipe_shader_type pstage)
|
||||
{
|
||||
uint8_t *mem;
|
||||
struct pipe_constant_buffer cbuf;
|
||||
unsigned size = calc_ubo0_size(state, pstage);
|
||||
cbuf.buffer_size = size;
|
||||
cbuf.buffer = NULL;
|
||||
cbuf.user_buffer = NULL;
|
||||
u_upload_alloc(state->uploader, 0, size, 64, &cbuf.buffer_offset, &cbuf.buffer, (void**)&mem);
|
||||
fill_ubo0(state, mem, pstage);
|
||||
state->pctx->set_constant_buffer(state->pctx, pstage, 0, true, &cbuf);
|
||||
if (size) {
|
||||
uint8_t *mem;
|
||||
struct pipe_constant_buffer cbuf;
|
||||
cbuf.buffer_size = size;
|
||||
cbuf.buffer = NULL;
|
||||
cbuf.user_buffer = NULL;
|
||||
u_upload_alloc(state->uploader, 0, size, 64, &cbuf.buffer_offset, &cbuf.buffer, (void**)&mem);
|
||||
fill_ubo0(state, mem, pstage);
|
||||
state->pctx->set_constant_buffer(state->pctx, pstage, 0, true, &cbuf);
|
||||
}
|
||||
state->pcbuf_dirty[pstage] = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue