Files
egutierrez e3c8979e8d chore: auto-commit (95 archivos)
- cmd/fn/doctor.go
- cmd/fn/main.go
- cpp/apps/primitives_gallery/playground/tables/CMakeLists.txt
- cpp/apps/primitives_gallery/playground/tables/data_table.cpp
- cpp/apps/primitives_gallery/playground/tables/data_table_logic.cpp
- cpp/apps/primitives_gallery/playground/tables/data_table_logic.h
- cpp/apps/primitives_gallery/playground/tables/self_test.cpp
- cpp/apps/primitives_gallery/playground/tables/tql.cpp
- cpp/apps/primitives_gallery/playground/tables/viz.cpp
- cpp/apps/primitives_gallery/playground/tables/viz.h
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 00:50:34 +02:00

39 lines
1.7 KiB
C++

#pragma once
#include <string>
namespace fn::gfx {
// GpuCaps recopila capacidades OpenGL y CUDA del contexto activo.
// Todos los campos de cadena estan vacios ("") si el dato no esta disponible.
struct GpuCaps {
// OpenGL — requieren contexto GL activo antes de llamar gpu_check_caps.
std::string gl_vendor; // glGetString(GL_VENDOR) ej. "NVIDIA Corporation"
std::string gl_renderer; // glGetString(GL_RENDERER) ej. "NVIDIA GeForce RTX 3080/PCIe/SSE2"
std::string gl_version; // glGetString(GL_VERSION) ej. "4.6.0 NVIDIA 550.54.15"
// Compute shader limits (GL_MAX_COMPUTE_WORK_GROUP_COUNT/SIZE)
// Indice 0=X 1=Y 2=Z. Valor 0 si compute shaders no disponibles.
int max_compute_workgroup_count[3] = {0, 0, 0};
int max_compute_workgroup_size[3] = {0, 0, 0};
bool has_compute_shader = false; // GL_VERSION >= 4.3 o extension ARB_compute_shader
bool has_storage_buffer = false; // GL_VERSION >= 4.3 o extension ARB_shader_storage_buffer_object
// CUDA — vacio si CUDA runtime no detectado en compile time.
// Formato: "12.4" (major.minor) o "" si no disponible.
std::string cuda_runtime_version;
};
// gpu_check_caps rellena out con las capacidades del contexto OpenGL activo.
//
// REQUISITO: debe llamarse despues de inicializar el contexto GL y, en Windows,
// despues de fn::gfx::gl_loader_init(). Si se llama sin contexto activo el
// comportamiento es indefinido (glGetString devuelve nullptr).
//
// Retorna true si se pudo leer al menos el vendor GL (contexto activo).
// Retorna false si gl_vendor queda vacio (contexto no activo o driver defectuoso).
bool gpu_check_caps(GpuCaps& out);
} // namespace fn::gfx