Functional render graph frontend #95
Replies: 1 comment 2 replies
-
This functionality could be built using Screen-13 as a dependency, but it is not the target audience I am building for. I would be happy to help either adapt Screen-13 to fit this use case or explain how it currently builds a dependency graph and how this could form the basis of a new project. I have some questions:
With a full description of what these passes are actually doing I am sure the existing resource aliasing and pass re-ordering logic would support the BackgroundThe name Screen-13 comes from the BASIC language syntax for entering a specific low-resolution, high (for the era) color mode: ' This is QBasic code
CLS
SCREEN 13
DRAW "R10D10L10U10"The above example is exactly the ethos I want this crate to deliver on. The command "DRAW R10 D10 ..." is a concrete list of instructions which draw a box. Other graphics programmers will have different boxes to draw, and this crate should support those uses without imposing restrictions on the type or way boxes are drawn. OpenGLAnother inspiration is OpenGL. Using the API it provides is widely regarded as easy and allows programmers to work on graphics algorithms and ignore things like memory caching. Unfortunately, like BASIC, OpenGL is increasingly unsupported and not appropriate for new projects in 2025. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Abstract
If we see this project as a compiler that generates the actual graphics program, the current render graph is more like a kind of intermediate language and its backend. Maybe a functional render graph that use "operator", "slot", "connection" that compiles to current render graph is useful as a choice of its frontend.
Analyse
With a functional programing view, let's write a graphics program:
which is filled with allocations.
Functional proggram can be compiled to an un-functional version that reduce allocation like:
where only one allocation exists.
The automation provided by the current render graph is more like a furthur optimization for the un-functional program. I think the functional program will be prefered for users considering code simplicity, robustness and procedural graph building.
Multiple unordered modify
An example: multiple operators try to modify one resource expecting no other modification ahead. Users have to clone that resource in need.
Write in functional form:
If we want to write this program in un-functional form,
ashould be modified by one of the operators infs, the left operators should be fed with a clone ofa. Like:Which is quite indirect and error prone.
Mixed modify and read
Furthur more for the previous example: there are both operators try to modify and operators try to read one resource.
In functional form, we don't care if an operator will modify or just read an resource.
Write in un-functional form:
Since
gonly reada, we must callgahead offto avoid allocating intermediate resource, which furthur burdening the user.Proposal
A higher level render graph that write in functional form, compile to current render graph.
Details
Beta Was this translation helpful? Give feedback.
All reactions