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
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace plot::gl {
|
||||
// The one definition of the entry point table declared in api.hpp.
|
||||
#define PLOT_GL_DEF(ret, name, args) ret (*name) args = nullptr;
|
||||
PLOT_GL_FUNCS(PLOT_GL_DEF)
|
||||
PLOT_GL_OPTIONAL_FUNCS(PLOT_GL_DEF)
|
||||
#undef PLOT_GL_DEF
|
||||
|
||||
namespace {
|
||||
@@ -171,6 +172,11 @@ bool load(ProcLoader loader) noexcept {
|
||||
|
||||
PLOT_GL_FUNCS(PLOT_GL_RESOLVE)
|
||||
|
||||
// Above-baseline entries: resolved the same way, but a name the driver does not
|
||||
// have leaves its pointer null instead of failing the load, so a 3.3-only
|
||||
// context keeps working. Callers gate them on caps() (see api.hpp).
|
||||
PLOT_GL_OPTIONAL_FUNCS(PLOT_GL_RESOLVE)
|
||||
|
||||
#undef PLOT_GL_RESOLVE
|
||||
|
||||
// The table may have changed, so whatever caps() cached for the old one is
|
||||
|
||||
Reference in new issue
Block a user