Conversation
schell
left a comment
There was a problem hiding this comment.
This looks good, thank you!
Firestar99
left a comment
There was a problem hiding this comment.
You can already fetch image texels with additional settings, like lod, bias, grad and sampleIndex. And naga for some reason requires explicitly fetching from lod 0, like below.
use spirv_std::image::sample_with::lod;
use spirv_std::image::{Image2d, ImageWithMethods};
mask_texture.fetch_with(frag_coord.xy().as_uvec2(), lod(0))Also I'd call it lod since we're following spirv / glsl naming conventions.
You may also find this thing I've been working on useful: #280
|
Not required, but it would be nice to put "level" somewhere as a doc alias (or even in the comment) so it comes up if folks search the webgpu terminology. |
schell
left a comment
There was a problem hiding this comment.
Yup, this makes sense now 👍
|
Looks like some compiletests are failing. You should be able to run them locally with |
The test I added passes on my local machine. The CI failures look unrelated to the changes I made, so I'm not sure how to fix them. The tests that are failing appear to be tests that are supposed to cause compile errors being erroneously marked as failing. |
|
It looks like the line numbers when it refers to that file changed, so it affects other tests that refer to those files with error messages. You can run |
Fixes #360
I used the terminology
levelsince that's what WGSL used, but it would also make sense to uselodsince that's what SPIR-V and GLSL'stexelFetchuse.