feat(render): Renderer with LOD selection, 3.3 and 4.3+ upload paths, headless smoke test

This commit is contained in:
Martino Ferrari committed 2026-09-27 23:03:08 +02:00
1 parent e0cdd95a3b
commit 3555ab63d7
20 files changed
+1544 -25

No files matched your search

+17
View File
@@ -59,6 +59,7 @@ enum : GLenum {
// Pixel store state.
GL_UNPACK_ALIGNMENT = 0x0CF5,
GL_PACK_ALIGNMENT = 0x0D05,
// Shaders and programs.
GL_FRAGMENT_SHADER = 0x8B30,
@@ -76,6 +77,9 @@ enum : GLenum {
GL_MAP_PERSISTENT_BIT = 0x0040 /* 4.4 */,
GL_MAP_COHERENT_BIT = 0x0080 /* 4.4 */,
// Rasterisation state (1.0).
GL_SCISSOR_TEST = 0x0C11,
// Textures.
GL_TEXTURE_2D = 0x0DE1,
GL_TEXTURE0 = 0x84C0,
@@ -120,6 +124,8 @@ enum : GLenum {
X(void, glEnable, (GLenum)) \
X(void, glBlendFunc, (GLenum, GLenum)) \
X(void, glPixelStorei, (GLenum, GLint)) \
X(void, glDisable, (GLenum)) \
X(void, glScissor, (GLint, GLint, GLsizei, GLsizei)) \
/* shaders and programs */ \
X(GLuint, glCreateShader, (GLenum)) \
X(void, glShaderSource, (GLuint, GLsizei, const GLchar* const*, const GLint*)) \
@@ -148,6 +154,8 @@ enum : GLenum {
X(void, glBindBuffer, (GLenum, GLuint)) \
X(void, glBufferData, (GLenum, GLsizeiptr, const void*, GLenum)) \
X(void, glBufferSubData, (GLenum, GLintptr, GLsizeiptr, const void*)) \
X(void*, glMapBufferRange, (GLenum, GLintptr, GLsizeiptr, GLbitfield)) \
X(GLboolean, glUnmapBuffer, (GLenum)) \
/* vertex arrays */ \
X(void, glGenVertexArrays, (GLsizei, GLuint*)) \
X(void, glDeleteVertexArrays, (GLsizei, const GLuint*)) \
@@ -182,8 +190,17 @@ enum : GLenum {
X(GLenum, glClientWaitSync, (GLsync, GLbitfield, GLuint64)) \
X(void, glDeleteSync, (GLsync))
// Entry points above the 3.3 baseline, resolved best-effort: a driver that lacks
// one leaves it null and `load()` still succeeds, so the library keeps working on
// a 3.3-only context. Every one of these is reached only after `caps()` -- or an
// explicit null check -- says the context can do it (see caps.hpp).
#define PLOT_GL_OPTIONAL_FUNCS(X) \
/* persistent buffer mapping, GL 4.4 / ARB_buffer_storage */ \
X(void, glBufferStorage, (GLenum, GLsizeiptr, const void*, GLbitfield))
#define PLOT_GL_DECL(ret, name, args) extern ret (*name) args;
PLOT_GL_FUNCS(PLOT_GL_DECL)
PLOT_GL_OPTIONAL_FUNCS(PLOT_GL_DECL)
#undef PLOT_GL_DECL
} // namespace plot::gl