-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Ref/Value behavior tracking #1755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pkg.pr.new packages
benchmark commit |
reference to something define in that function)
the value proxies
Something weird happened to the vaporrave example, some of the effects seem to have disappeared. Also, Slime Mold 3D throws when switching to another example, but this might have been the case before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks really promising!! 🧑🚒🇹🇻
I didn't have time to review everything yet
apps/typegpu-docs/src/examples/simulation/stable-fluid/simulation.ts
Outdated
Show resolved
Hide resolved
apps/typegpu-docs/src/examples/simulation/stable-fluid/simulation.ts
Outdated
Show resolved
Hide resolved
|
||
type AnyFn = (...args: never[]) => unknown; | ||
|
||
function shallowEqualSchemas(a: AnyData, b: AnyData): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different structs will be equal. I'd rename this, though I have no ideas right now
Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com>
Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com>
} | ||
|
||
return this.#value; | ||
return schemaCallWrapper(this.dataType, this.#value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about the performance of this. Sometimes these constants are not insignificant in size, e.g. in cube-marching, I use a tgpu.const(d.arrayOf(d.u32, 256), ...)
. I don't use it on JS side, but still, if we allow that, it should not be unnecessarily slow.
|
||
ctx.addDeclaration(`${fnAttribute}fn ${id}${header}${body}`); | ||
return snip(id, returnType); | ||
return snip(id, returnType, /* ref */ 'runtime'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little hesitant about calling everything 'runtime' bu default, maybe we could find a more fitting name, like 'unknown'?
return data; | ||
} | ||
|
||
export function toStorable(schema: AnyData): AnyData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some docs to this? At a glance, I don't know what it does e.g. to atomic types.
Docs have TGSL that is no longer valid |
Changes:
const
statements be pointers if they take in a referential type (let statements)const
statements with naturally non-referential types to be WGSLconst
🎉Reference assignment errors:
Invalid 'let' statement errors:
