Comfy-Org / Comfy-Org/ComfyUI_frontend
GLSL live preview: resolve boundary-crossing float/int uniforms through SubgraphNode outer inputs
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
In `src/renderer/glsl/useGLSLPreview.ts`, the `extractUniformSources()` function intentionally skips inputs whose origin is `SUBGRAPH_INPUT_ID` (i.e. uniforms fed through the subgraph boundary from the parent SubgraphNode's outer inputs). As a result, when a GLSL shader's `floats.*` / `ints.*` inputs are wired to the SubgraphNode's external inputs rather than internal PrimitiveFloat/Int nodes, live preview passes no uniforms at all.
## Expected Behaviour
Boundary-crossing `floats.*` / `ints.*` uniform inputs should be traced back through the SubgraphNode's outer inputs (similar to how `getImageThroughSubgraphBoundary` handles IMAGE inputs), so their values are correctly resolved and passed to the GLSL renderer.
## Work Needed
- Detect when a uniform input's origin is `SUBGRAPH_INPUT_ID`.
- Resolve the corresponding outer input on the owning SubgraphNode (using `ownerSubgraphNode.getInputNode(link.origin_slot)` or equivalent).
- Extract the float/int value from the outer upstream node's widget.
- Handle mixed sources where some uniforms are internal and some cross the boundary.
## Context
Tracked from PR #10349 (GLSL live preview support) — comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10349#discussion_r2968318988
Requested by @jtydhr88.
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10353-GLSL-live-preview-resolve-boundary-crossing-float-int-uniforms-through-SubgraphNode--3296d73d365081e788adda00e50512fb) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.