feat(framework): bump OpenGL 3.3 → 4.3 core context

Cierra 0049b. El context de fn::run_app pide ahora GL 4.3 core con
forward-compat global, habilitando compute shaders, SSBOs, image
load/store y atomic counters — bloques esenciales del graph_renderer GPU
del proyecto osint_graph (issues 0049f y 0049h).

Cambios:

- cpp/framework/app_base.cpp: 4.3 core + forward-compat. Comentario
  marcando que es backward-compatible con shaders #version 330.
- cpp/apps/primitives_gallery/capture.cpp: deja explicitamente 3.3 core
  porque WSL Mesa no entrega 4.3 offscreen (GLXBadFBConfig); ImGui +
  ImPlot funcionan igual en 3.3 para los goldens.
- primitives_gallery: nuevo demo Gfx > gl_info que muestra
  Vendor/Renderer/Version/GLSL en runtime + status 4.3 (verde) +
  limites (MAX_TEXTURE_SIZE, MAX_VERTEX_ATTRIBS, MAX_UNIFORM_BLOCK_SIZE
  y, si 4.3+, MAX_SHADER_STORAGE_BUFFER_BINDINGS y compute shared mem).
  Solo glGetString/glGetIntegerv — sin loader extra.
- About bumped a 0.4.0 con la nota del nuevo demo y de GL 4.3.
- cpp/tests/test_visual.cpp: usa LIBGL_ALWAYS_SOFTWARE=1 al lanzar el
  capture para alinear el driver con update_goldens.sh; sin esto las
  diferencias de strings (llvmpipe vs d3d12) hacen que gl_info supere
  el 1% de tolerancia.
- cpp/tests/golden/gl_info.png: nuevo golden.

Build verificado en Linux (cmake build OK) + Windows cross-compile
(cmake build OK). Las 27 pruebas pasan (incluida test_visual con 42
demos comparadas).
This commit is contained in:
2026-04-29 21:23:15 +02:00
parent 4f25564132
commit 492e6b59cd
9 changed files with 92 additions and 8 deletions
+4
View File
@@ -47,6 +47,10 @@ bool run_capture(const CaptureConfig& cfg, const std::vector<CaptureItem>& items
return false;
}
// Capture mode usa GL 3.3 deliberadamente: WSL Mesa no entrega contexto
// 4.3 offscreen (GLXBadFBConfig). Las pruebas visuales no necesitan
// compute/SSBO — ImGui+ImPlot funciona en 3.3 core. La build interactiva
// (app_base.cpp) si pide 4.3.
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+1
View File
@@ -50,5 +50,6 @@ void demo_voronoi(); // issue 0034
// --- Gfx ---
void demo_shader_canvas();
void demo_gl_texture(); // wave 1, issue 0026
void demo_gl_info(); // issue 0049b — runtime GL version + 4.3 caps
} // namespace gallery
+73
View File
@@ -120,4 +120,77 @@ void demo_shader_canvas() {
);
}
// Issue 0049b — Mostrar la version de OpenGL del contexto y un puñado de
// limites 4.3 que confirman que compute shaders / SSBO / image load-store
// estan disponibles. No es codigo del registry, solo introspeccion del
// driver — sin estado, sin side effects: solo glGetString + glGetIntegerv.
#ifndef GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS
#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
#endif
#ifndef GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS
#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
#endif
#ifndef GL_MAX_COMPUTE_SHARED_MEMORY_SIZE
#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
#endif
void demo_gl_info() {
demo_header("gl_info", "v1.0.0",
"Introspeccion del contexto OpenGL activo (issue 0049b). El framework "
"ahora pide GL 4.3 core, lo que habilita compute shaders, SSBOs, image "
"load/store y atomic counters — bloques esenciales del graph_renderer "
"GPU del proyecto osint_graph.");
auto gl_str = [](GLenum e) -> const char* {
const GLubyte* s = glGetString(e);
return s ? reinterpret_cast<const char*>(s) : "(null)";
};
section("Driver");
ImGui::Text("Vendor: %s", gl_str(GL_VENDOR));
ImGui::Text("Renderer: %s", gl_str(GL_RENDERER));
ImGui::Text("Version: %s", gl_str(GL_VERSION));
ImGui::Text("GLSL: %s", gl_str(GL_SHADING_LANGUAGE_VERSION));
GLint major = 0, minor = 0;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
const bool has_43 = (major > 4) || (major == 4 && minor >= 3);
section("Capabilities");
ImGui::Text("Context: %d.%d core", major, minor);
if (has_43) {
ImGui::TextColored(ImVec4(0.40f, 0.85f, 0.40f, 1.0f),
"OpenGL 4.3+ — compute shaders, SSBOs, image load/store, atomic counters: AVAILABLE");
} else {
ImGui::TextColored(ImVec4(0.95f, 0.55f, 0.30f, 1.0f),
"OpenGL < 4.3 — compute shaders / SSBOs NOT available on this driver");
}
section("Limits");
GLint v = 0;
auto row = [&](const char* label, GLenum e) {
v = 0;
glGetIntegerv(e, &v);
ImGui::Text("%-44s %d", label, v);
};
row("GL_MAX_TEXTURE_SIZE", GL_MAX_TEXTURE_SIZE);
row("GL_MAX_VERTEX_ATTRIBS", GL_MAX_VERTEX_ATTRIBS);
row("GL_MAX_UNIFORM_BLOCK_SIZE", GL_MAX_UNIFORM_BLOCK_SIZE);
if (has_43) {
row("GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS", GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS);
row("GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS", GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS);
row("GL_MAX_COMPUTE_SHARED_MEMORY_SIZE", GL_MAX_COMPUTE_SHARED_MEMORY_SIZE);
}
code_block(
"// Solo glGetString + glGetIntegerv — sin loader extra.\n"
"GLint major = 0, minor = 0;\n"
"glGetIntegerv(GL_MAJOR_VERSION, &major);\n"
"glGetIntegerv(GL_MINOR_VERSION, &minor);\n"
"bool has_compute = (major > 4) || (major == 4 && minor >= 3);"
);
}
} // namespace gallery
+3 -2
View File
@@ -78,6 +78,7 @@ static const DemoEntry k_demos[] = {
// Gfx (shaders_lab core)
{"shader_canvas", "shader_canvas", "Gfx", &gallery::demo_shader_canvas},
{"gl_texture", "gl_texture_load", "Gfx", &gallery::demo_gl_texture}, // wave 1
{"gl_info", "gl_info", "Gfx", &gallery::demo_gl_info}, // issue 0049b
};
static constexpr int k_demo_count = sizeof(k_demos) / sizeof(k_demos[0]);
@@ -205,8 +206,8 @@ int main(int argc, char** argv) {
.height = 900,
.viewports = true,
.about = {.name = "Primitives Gallery",
.version = "0.3.0",
.description = "Visual catalog of fn_registry C++ UI primitives. Modo --capture para golden screenshots, sidebar via tree_view, candlestick fix."},
.version = "0.4.0",
.description = "Visual catalog of fn_registry C++ UI primitives. Now on OpenGL 4.3 core (compute, SSBOs, image load/store) — ver demo gl_info."},
.init_gl_loader = true},
render
);
+4 -4
View File
@@ -33,13 +33,13 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
return 1;
}
// OpenGL 3.3 core
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
// OpenGL 4.3 core (issue 0049b) — habilita compute shaders, SSBOs, image
// load/store, atomic counters y debug output. Backward-compatible con
// shaders #version 330 y con todo lo escrito para 3.3 core.
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifdef __APPLE__
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#endif
GLFWwindow* window = glfwCreateWindow(config.width, config.height, config.title, nullptr, nullptr);
if (!window) {
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

+6 -1
View File
@@ -94,7 +94,12 @@ TEST_CASE("primitives_gallery visual goldens", "[visual]") {
// Ejecutar binario en modo --capture desde la raiz del repo. Algunas
// demos resuelven paths relativos (p.ej. sql_workbench busca registry.db);
// correr desde la raiz garantiza determinismo entre maquinas.
std::string cmd = std::string("cd '") + FN_TEST_REPO_ROOT + "' && '"
//
// LIBGL_ALWAYS_SOFTWARE=1 fuerza llvmpipe igual que update_goldens.sh, asi
// demos que muestran strings del driver (gl_info) no fallan por diferencias
// entre llvmpipe / d3d12 / drivers vendor.
std::string cmd = std::string("cd '") + FN_TEST_REPO_ROOT + "' && "
+ "LIBGL_ALWAYS_SOFTWARE=1 '"
+ gallery_bin + "' --capture '" + tmp_dir + "' 2>&1";
INFO("capture cmd: " << cmd);
const int rc = std::system(cmd.c_str());
+1 -1
View File
@@ -56,7 +56,7 @@
| [0048](completed/0048-cpp-visual-tests-ci-gate.md) | Visual tests via primitives_gallery + CI gate tested:true | completado | media | feature | — |
| [0049](0049-osint-graph-viewer.md) | OSINT graph viewer + GPU graph rendering system (multi-issue) | pendiente | alta | feature | — |
| [0049a](completed/0049a-osint-graph-setup.md) | Setup proyecto osint_graph + sub-repo graph_explorer | completado | alta | infra | parte de 0049 |
| [0049b](0049b-cpp-bump-gl-43.md) | Bump OpenGL 3.3 → 4.3 core en cpp/framework | pendiente | alta | infra | parte de 0049 |
| [0049b](completed/0049b-cpp-bump-gl-43.md) | Bump OpenGL 3.3 → 4.3 core en cpp/framework | completado | alta | infra | parte de 0049 |
| [0049c](0049c-graph-renderer-tier1.md) | graph_renderer Tier 1: RGBA8, orphan, frustum cull, auto-pause | pendiente | alta | perf | parte de 0049 |
| [0049d](0049d-graph-edges-vertex-pulling.md) | Aristas via vertex pulling con TBO | pendiente | alta | perf | parte de 0049 |
| [0049e](0049e-graph-types-extended.md) | graph_types modelo extendido + EntityType/RelationType | pendiente | alta | feature | parte de 0049 |