summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 957bbe5..bc1c90b 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -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];
}