mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 21:38:42 +02:00
Prevent the allocation of 0 size buffers
This commit is contained in:
parent
42dcae72cb
commit
9ed1a5980a
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ class GL45Buffer : public gl::GLBuffer {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GL45Buffer(const std::weak_ptr<gl::GLBackend>& backend, const Buffer& buffer, GLBuffer* original) : Parent(backend, buffer, allocate()) {
|
GL45Buffer(const std::weak_ptr<gl::GLBackend>& backend, const Buffer& buffer, GLBuffer* original) : Parent(backend, buffer, allocate()) {
|
||||||
glNamedBufferStorage(_buffer, _size, nullptr, GL_DYNAMIC_STORAGE_BIT);
|
glNamedBufferStorage(_buffer, _size == 0 ? 256 : _size, nullptr, GL_DYNAMIC_STORAGE_BIT);
|
||||||
if (original && original->_size) {
|
if (original && original->_size) {
|
||||||
glCopyNamedBufferSubData(original->_buffer, _buffer, 0, 0, std::min(original->_size, _size));
|
glCopyNamedBufferSubData(original->_buffer, _buffer, 0, 0, std::min(original->_size, _size));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue