software-mansion / software-mansion/TypeGPU

impr: Auto `@interpolate(flat)` when integer field encountered in varyings struct

Open
#2,147 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For example, when we define vertex output struct like the following

const ModelVertexOutput = {
  worldPosition: d.vec3f,
  worldNormal: d.vec3f,
  applySeaFog: d.u32, 
};

We will get the error, that integer fields must be marked with explicit @interpolate(flat)

Image

I think, it won't be harmful to do it automatically for integer types.

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 with the TypeScript varying-struct handling illustrated by the ModelVertexOutput example, focusing on the integer applySeaFog field and the validation that currently requires explicit @interpolate(flat). The work is complete when integer fields automatically receive flat interpolation without requiring the annotation, while the existing example no longer produces the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.