Otherwise, making a CS using the memory will use the uninitialized .map
value (when checking the size of the CS in in begin's tu_cs_is_empty()
check), causing valgrind noise in
dEQP-VK.binding_model.descriptorset_random.sets4.dynindexed.ubolimitlow.sbolimitlow.sampledimghigh.lowimgsingletex.iublimitlow.nouab.vert.noia.0
(thanks to vi_info->vertexBindingDescriptionCount==0).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20173>
assert(cs->mode == TU_CS_MODE_SUB_STREAM);
assert(size && size <= 1024);
- if (!count)
+ if (!count) {
+ /* If you allocated no memory, you'd better not use the iova for anything
+ * (but it's left aligned for sanity).
+ */
+ memory->map = NULL;
+ memory->iova = 0xdead0000;
return VK_SUCCESS;
+ }
/* TODO: smarter way to deal with alignment? */