feat(render): Renderer with LOD selection, 3.3 and 4.3+ upload paths, headless smoke test
This commit is contained in:
1 parent
e0cdd95a3b
commit
3555ab63d7
20 files changed
+1544
-25
No files matched your search
@@ -109,6 +109,25 @@ void Buffer::upload_sub(const void* data, usize bytes, usize offset) const noexc
|
||||
data);
|
||||
}
|
||||
|
||||
void Buffer::storage(usize bytes, GLbitfield flags) const noexcept {
|
||||
if (glBufferStorage == nullptr) {
|
||||
return; // not resolved on this driver: the caller checked caps() first
|
||||
}
|
||||
bind();
|
||||
glBufferStorage(GL_ARRAY_BUFFER, static_cast<GLsizeiptr>(bytes), nullptr, flags);
|
||||
}
|
||||
|
||||
void* Buffer::map_range(usize offset, usize bytes, GLbitfield access) const noexcept {
|
||||
bind();
|
||||
return glMapBufferRange(GL_ARRAY_BUFFER, static_cast<GLintptr>(offset),
|
||||
static_cast<GLsizeiptr>(bytes), access);
|
||||
}
|
||||
|
||||
bool Buffer::unmap() const noexcept {
|
||||
bind();
|
||||
return glUnmapBuffer(GL_ARRAY_BUFFER) == GL_TRUE;
|
||||
}
|
||||
|
||||
void Buffer::destroy(GLuint id) noexcept { glDeleteBuffers(1, &id); }
|
||||
|
||||
// -------------------------------------------------------------- VertexArray
|
||||
|
||||
Reference in new issue
Block a user