software-mansion / software-mansion/TypeGPU
[RFC] feat: Immediates
Open
Nobody has claimed this yet.
- #2812 by @reczkok — closed without merging
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
API sketch:
const Props = d.struct({
color: d.vec3f,
});
// DEFINITION
const props = tgpu.immediateVar(Props);
// USAGE
const renderPipeline = root.createRenderPipeline({
vertex: common.fullScreenTriangle,
fragment: () => {
'use gpu';
return d.vec4f(props.$.color);
},
});
// SUPPLYING
renderPipeline
.withImmediates(props, { color: d.vec3f(1, 0, 0) })
.draw(3);
Additional TypeGPU niceities:
- Our immediates can be used to provide an accessor, meaning a library can indirectly use an immediate through the user's decision.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked “Intro to immediates” and compare it with the API sketch in this issue. The work is done when the proposed immediateVar and withImmediates flow is implemented, including accessor support for indirect library use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100