-
Notifications
You must be signed in to change notification settings - Fork 86
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
Expand textureStorage tests #4039
Conversation
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.
Post some questions first
src/webgpu/shader/execution/expression/call/builtin/textureStore.spec.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
@fragment fn fs(v: VOut) -> @location(0) vec4f { | ||
setValue(vec3u(u32(v.pos.x), u32(v.pos.y), v.z)); |
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.
v.pos.xy is in -1, 1 range. I think you want is uint coord here (something like gl_FragCoord from 0 to tex wdith/height)?
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.
v.pos.xy is in texel coordinates (it is gl_FragCoord
)
0.5, 0.5 1.5, 0.5 2.5, 0.5
0.5, 1.5 1.5, 1.5 2.5, 1.5
0.5, 2.5 1.5, 2.5 2.5, 2.5
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's confusing because
struct VOut {
@builtin(position) pos: vec4f;
...
};
In the vertex shader this is normalized coord used to computing triangle vertices.
In the fragment shader it's gl_FragCoord
.
* test 2d, 2d-array, 3d textures * test fragment stages * test out of range values
1c3b760
to
9f3ca8a
Compare
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.
Thanks for the answer. LGTM
Requirements for PR author:
.unimplemented()
./** documented */
and new helper files are found inhelper_index.txt
.Requirements for reviewer sign-off:
When landing this PR, be sure to make any necessary issue status updates.