Note: the array tests fail on Chrome Mac because the array_index needs to be clamped.
A few notes:
The textureLoad and textureSampleLevel changes are mostly to because as I implemented textureGather I released I could simplify those tests as well as enable a few more.
In particular:
It used to be that some formats required usage RENDER_ATTACHMENT. I change that to happen in the utilities because it seemed not so great that the test needed to know whether the needs to the functions below. So, RENDER_ATTACHMENT usage is not added by most of the tests. The exception is multisampled textures. They require RENDER_ATTACHMENT to even be created so a test would expect to have to set that used.
With some of the fixes in textureGather the reasons why a mipLevelCount of 3 was not working were fixed. To see that they were indeed fixed I went and changed these TODOs to use a mipLevelCount of 3. They pass.
textureGather uncovered a host of issues in the software renderer and in the function checkCallResults
Those checks were often converting to a TexelView and then comparing components. A TexelView might have just Stencil or just Depth. But the actual builtins return R,G,B,A and so we should be checking R,G,B,A
textureGather always returns 4 values. Even if you sample depth you get 4 depth values from 4 different pixels. This was another area that needed refactoring
Another big change is the code now makes explicit bind group layouts. This allows it to test rgba32float as an unfiterable texture. textureGather can read unfilterable-float rgba32float but the default layout: auto generated bind group layouts use a filtering sampler. Switching to manual layouts fixes that.
There was also a bunch of code related to wrapping on edged of cube maps. I originally had code that converted a texel coord + face ndx -> normalize 3d texture coord -> cube coord -> normalized 3d texture coord -> face ndx. This wasn't working which is why I had more complicated wrapping code. Whatever the exact bug was I don't remember but working through things I was able to put this simpler path back.
Requirements for PR author:
[X] All missing test coverage is tracked with "TODO" or .unimplemented().
[X] New helpers are /** documented */ and new helper files are found in helper_index.txt.
[X] Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
[X] Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)
Note: the array tests fail on Chrome Mac because the array_index needs to be clamped.
A few notes:
The
textureLoad
andtextureSampleLevel
changes are mostly to because as I implementedtextureGather
I released I could simplify those tests as well as enable a few more.In particular:
It used to be that some formats required usage
RENDER_ATTACHMENT
. I change that to happen in the utilities because it seemed not so great that the test needed to know whether the needs to the functions below. So,RENDER_ATTACHMENT
usage is not added by most of the tests. The exception is multisampled textures. They requireRENDER_ATTACHMENT
to even be created so a test would expect to have to set that used.With some of the fixes in
textureGather
the reasons why a mipLevelCount of 3 was not working were fixed. To see that they were indeed fixed I went and changed these TODOs to use a mipLevelCount of 3. They pass.textureGather
uncovered a host of issues in the software renderer and in the functioncheckCallResults
Those checks were often converting to a
TexelView
and then comparing components. A TexelView might have justStencil
or justDepth
. But the actual builtins return R,G,B,A and so we should be checking R,G,B,AtextureGather
always returns 4 values. Even if you sample depth you get 4 depth values from 4 different pixels. This was another area that needed refactoringAnother big change is the code now makes explicit bind group layouts. This allows it to test
rgba32float
as an unfiterable texture.textureGather
can read unfilterable-float rgba32float but the defaultlayout: auto
generated bind group layouts use afiltering
sampler. Switching to manual layouts fixes that.There was also a bunch of code related to wrapping on edged of cube maps. I originally had code that converted a texel coord + face ndx -> normalize 3d texture coord -> cube coord -> normalized 3d texture coord -> face ndx. This wasn't working which is why I had more complicated wrapping code. Whatever the exact bug was I don't remember but working through things I was able to put this simpler path back.
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.