software-mansion / software-mansion/TypeGPU

Accessors should be allowed to work in "normal" mode

Open
#2,007 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
122
Avg merge
3d 5h
Merged PRs (30d)
34

Description

Simplest example

const timeAccess = tgpu.accessor(d.f32, 5);

const doubleTime = () => {
  // Should access the default value
  return timeAccess.$ * 2;
};

// In JS
doubleTime();

Harder example (requires adhoc contexts in normal mode):

const timeAccess = tgpu.accessor(d.f32);

const doubleTime = () => {
  return timeAccess.$ * 2;
};

// In JS
tgpu.fn(doubleTime).with(timeAccess, 5)();

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the accessor and tgpu.fn().with() entry points shown in the issue, then trace how normal-mode accessors and adhoc contexts are handled. Done means both examples work: an accessor with a default value can be read directly, and an accessor without one can receive a value through .with().

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.