docs(issues): marcar 0025 y 0026 como completados + WIP master
Wave 1 de parallel-fix-issues integrada a master: - 0025: text_editor_cpp_core + file_watcher_cpp_core - 0026: gl_texture_load_cpp_gfx (vendor: stb_image v2.30) Ademas se commitea WIP previo de master que estaba sin commitear (cambios en shaders_lab, dag_*, framework, tokens, kpi_card, gl_loader.md, etc.) para dejar HEAD buildable. Notas: - Algunos deps del gallery (button.cpp, toolbar.cpp, modal_dialog.cpp...) siguen UNTRACKED — gating con FN_BUILD_GALLERY=ON (default OFF) para que master build (sin flag) no los necesite. - Build OK con y sin flag. fn index registra 904 functions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,27 +1,38 @@
|
||||
#include "gfx/dag_uniforms.h"
|
||||
#include "gfx/dag_compile.h"
|
||||
#include "gfx/dag_catalog.h"
|
||||
#include "gfx/gl_loader.h"
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
namespace fn::gfx {
|
||||
|
||||
static constexpr int MAX_NODES = 16;
|
||||
static constexpr int MAX_PARAM_VEC4S = 64;
|
||||
|
||||
void dag_uniforms_apply(const std::vector<DagStep>& pipeline, unsigned int program) {
|
||||
float data[MAX_NODES * 4];
|
||||
float data[MAX_PARAM_VEC4S * 4];
|
||||
std::memset(data, 0, sizeof(data));
|
||||
|
||||
const int n = static_cast<int>(std::min(pipeline.size(), static_cast<size_t>(MAX_NODES)));
|
||||
for (int i = 0; i < n; ++i) {
|
||||
const auto& step = pipeline[static_cast<size_t>(i)];
|
||||
data[i * 4 + 0] = step.params[0];
|
||||
data[i * 4 + 1] = step.params[1];
|
||||
data[i * 4 + 2] = step.params[2];
|
||||
data[i * 4 + 3] = step.params[3];
|
||||
std::vector<int> base = dag_param_layout(pipeline);
|
||||
|
||||
for (size_t i = 0; i < pipeline.size(); ++i) {
|
||||
const DagStep& step = pipeline[i];
|
||||
const DagNodeDef* def = dag_find(step.name);
|
||||
if (!def) continue;
|
||||
int pc = static_cast<int>(def->param_defaults.size());
|
||||
int b = base[i] * 4;
|
||||
for (int k = 0; k < pc && b + k < MAX_PARAM_VEC4S * 4; ++k) {
|
||||
data[b + k] = (k < static_cast<int>(step.params.size())) ? step.params[static_cast<size_t>(k)] : 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
GLint loc = glGetUniformLocation(program, "u_params");
|
||||
if (loc >= 0) glUniform4fv(loc, MAX_NODES, data);
|
||||
if (loc >= 0) glUniform4fv(loc, MAX_PARAM_VEC4S, data);
|
||||
|
||||
// Default render path: ensure preview branch in the compiled DAG shader is
|
||||
// disabled (per-node previews override this transiently in dag_previews_render).
|
||||
GLint loc_pt = glGetUniformLocation(program, "u_preview_target");
|
||||
if (loc_pt >= 0) glUniform1i(loc_pt, -1);
|
||||
}
|
||||
|
||||
} // namespace fn::gfx
|
||||
|
||||
Reference in New Issue
Block a user