mirror of https://github.com/AxioDL/metaforce.git
Buffer overflow fixes
This commit is contained in:
parent
db542135df
commit
e9dc6787ce
|
@ -66,6 +66,7 @@ class UniformBufferPool
|
|||
|
||||
void updateBuffer()
|
||||
{
|
||||
if (buffer)
|
||||
buffer->unmap();
|
||||
cpuBuffer = nullptr;
|
||||
dirty = false;
|
||||
|
|
|
@ -66,6 +66,7 @@ class VertexBufferPool
|
|||
|
||||
void updateBuffer()
|
||||
{
|
||||
if (buffer)
|
||||
buffer->unmap();
|
||||
cpuBuffer = nullptr;
|
||||
dirty = false;
|
||||
|
@ -106,7 +107,7 @@ public:
|
|||
assert(count <= pool.m_countPerBucket && "unable to fit in bucket");
|
||||
auto& freeSpaces = pool.m_freeElements;
|
||||
auto& buckets = pool.m_buckets;
|
||||
int idx = freeSpaces.find_first_contiguous(count);
|
||||
int idx = freeSpaces.find_first_contiguous(count, pool.m_countPerBucket);
|
||||
if (idx == -1)
|
||||
{
|
||||
buckets.emplace_back();
|
||||
|
|
Loading…
Reference in New Issue