mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 21:20:21 +01:00
draw: Handle failure to allocate aligned_constant_storage.
Also, actually update const_storage_size, therefore avoiding to unnecessarily reallocate aligned_constant_storage every single time draw_vs_set_constants() is called. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
e21c5157b6
commit
9e29cdbe95
1 changed files with 9 additions and 3 deletions
|
|
@ -69,14 +69,20 @@ draw_vs_set_constants(struct draw_context *draw,
|
|||
if (size > draw->vs.const_storage_size[slot]) {
|
||||
if (draw->vs.aligned_constant_storage[slot]) {
|
||||
align_free((void *)draw->vs.aligned_constant_storage[slot]);
|
||||
draw->vs.const_storage_size[slot] = 0;
|
||||
}
|
||||
draw->vs.aligned_constant_storage[slot] =
|
||||
align_malloc(size, alignment);
|
||||
if (draw->vs.aligned_constant_storage[slot]) {
|
||||
draw->vs.const_storage_size[slot] = size;
|
||||
}
|
||||
}
|
||||
assert(constants);
|
||||
memcpy((void *)draw->vs.aligned_constant_storage[slot],
|
||||
constants,
|
||||
size);
|
||||
if (draw->vs.aligned_constant_storage[slot]) {
|
||||
memcpy((void *)draw->vs.aligned_constant_storage[slot],
|
||||
constants,
|
||||
size);
|
||||
}
|
||||
constants = draw->vs.aligned_constant_storage[slot];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue