diff --git a/renderdoc/api/replay/basic_types.h b/renderdoc/api/replay/basic_types.h index e0fd53b69..c7f1897de 100644 --- a/renderdoc/api/replay/basic_types.h +++ b/renderdoc/api/replay/basic_types.h @@ -176,7 +176,11 @@ public: if(s <= capacity()) return; - // for now, just resize exactly to what's needed. + // either double, or allocate what's needed, whichever is bigger. ie. by default we double in + // size but we don't grow exponentially in 2^n to cover a single really large resize + if(size_t(allocatedCount) * 2 > s) + s = size_t(allocatedCount) * 2; + T *newElems = allocate(null_terminator::allocCount(s)); // copy the elements to new storage