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