-
Notifications
You must be signed in to change notification settings - Fork 344
Description
Related to #4841
These are the results I'm getting from the existing textureGather tests
Pixel 4 (flame):
all good
Pixel 6 (oriole):
2d_coord: broken offsets
2d_array_coords: broken offsets
Mac AMD
sint/uint formats all broken
2d_array_coords: stencil 8 broken and/or crashes (see below)
Mac Intel Coffee Lake H UHD Graphics 630
2d_array_coords: stencil8 returns 0
3d_array_coords (cube-array): broken (always returns array layer 0)
Mac M1
all good
Windows: Intel Alder Lake S UHD Graphics 770
Intel Comet Lake S UHD Graphics 630
3d_coords (cube): all broken
3d_array_coords (cube-array) : all broken
Windows NVidia NVIDIA GeForce GTX 1660
all good
Linux NVIDIA GeForce GTX 1660
all good
Linux AMD
sampled_3d_coords: (cube) sint/uint formats all broken
sampled_array_3d_coords: (cube-array) sint/uint formats all broken
stencil8 broken
Linux Intel Comet Lake S UHD Graphics 630
crashes on every textureGather test (might be a chrome bug but it's not
crashing on other texture builtin tests
which are effectively the same test)
For the broken cubemap issue I tried implementing an emulation for f32 formats with cube maps. The emulation works on M1 but fails on Intel (the place it's needed). It seems impossible to emulate for sint/uint formats because the only two builtins that read sint/uint formats are textureGather and textureLoad. textureLoad doesn't work with cubemaps. Although maybe the native APIs have other functions?
I think my suggestion would be to:
- disallow
texture_cubeandtexture_cube_arraywithtextureGather(or move to a feature) - disallow offsets with
textureGather(or move to a feature) - disallow sint/uint textures with
textureGather(or move to a feature)
That seems like it would be the solution that favors portability.
webgpu:shader,execution,expression,call,builtin,textureGather:sampled_array_2d_coords:format="stencil8";minFilter="nearest" at the current version of the CTS seems to hang the GPU process on Mac AMD on all browsers. It's not doing anything crazy AFAIK
I'm not sure what to do about that. Get rid of it too? Does anyone call textureGather on a stencil? Also, it's possible there are more depth texture issues. I'll have to go back over the tests again
It's also possible I'm doing something wrong in the tests but, you can see an example below of the cube map textureGather being broken on Intel
The thing to notice is the cube map coordinate converts to texel coordinate (7.76, 4.016) in face 3 (the -Y face). That makes texel 7 in X, and 0.76 means it's ~3/4s to texel 8 so it should wrap to the next face. It wraps to the next face in "expected" but not in "got" (from the GPU). Effectively, the texel labeled d in the "expected" diagram is the texel pointed at by the cube coordinate. From that texel we should go right one texel (because 7.76 is well past the center of d) and up (because 4.016 is near the top of d). You can see it choose the same texel for d in both expected and got but then didn't go to the right of d like it's supposed to. I'm pretty sure that's incorrect behavior.
--> EXPECTATION FAILED: subcase: C="i32";samplePoints="cube-edges";addressMode="clamp-to-edge"
result was not as expected:
size: [8, 8, 6]
mipCount: 3
call: textureGather(component: i32(0), texture: T, sampler: S, coords: vec3f(0.6854506397689122, -0.7281135426590934, -0.002844193526012084)) // #0
: as 3D texture coord: (0.970703125, 0.501953125, 0.5833333333333334)
: as texel coord mip level[0]: (7.766, 4.016), face: 3(-y)
: as texel coord mip level[1]: (3.883, 2.008), face: 3(-y)
: as texel coord mip level[2]: (1.941, 1.004), face: 3(-y)
got: 0.47843, 0.12157, 0.67451, 0.38039
expected: 0.12157, 0.75294, 0.30588, 0.67451
max diff: 0
abs diffs: 0.35686, 0.63137, 0.36863, 0.29412
rel diffs: 74.59%, 83.85%, 54.65%, 43.60%
ulp diffs: 91, 161, 94, 75
sample points:
expected: | got:
|
layer: 0 (+x) | layer: 0 (+x) un-sampled
0 1 2 3 4 5 6 7 |
┌───┬───┬───┬───┬───┬───┬───┬───┐ | layer: 1 (-x) un-sampled
0 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ | layer: 2 (+y) un-sampled
1 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ | layer: 3 (-y)
2 │ │ │ │ │ │ │ │ │ | 0 1 2 3 4 5 6 7
├───┼───┼───┼───┼───┼───┼───┼───┤ | ┌───┬───┬───┬───┬───┬───┬───┬───┐
3 │ │ │ │ │ │ │ │ │ | 0 │ │ │ │ │ │ │ │ │
├───┼───┼───┼───┼───┼───┼───┼───┤ | ├───┼───┼───┼───┼───┼───┼───┼───┤
4 │ │ │ │ │ │ │ │ │ | 1 │ │ │ │ │ │ │ │ │
├───┼───┼───┼───┼───┼───┼───┼───┤ | ├───┼───┼───┼───┼───┼───┼───┼───┤
5 │ │ │ │ │ │ │ │ │ | 2 │ │ │ │ │ │ │ │ │
├───┼───┼───┼───┼───┼───┼───┼───┤ | ├───┼───┼───┼───┼───┼───┼───┼───┤
6 │ │ │ │ │ │ │ │ │ | 3 │ │ │ │ │ │ │ a │ b │
├───┼───┼───┼───┼───┼───┼───┼───┤ | ├───┼───┼───┼───┼───┼───┼───┼───┤
7 │ │ │ │ a │ b │ │ │ │ | 4 │ │ │ │ │ │ │ c │ d │
└───┴───┴───┴───┴───┴───┴───┴───┘ | ├───┼───┼───┼───┼───┼───┼───┼───┤
a: mip(0) at: [ 3, 7, 0], weights: [R: 0.00000, G: 0.00000, B: 1.00000, A: 0.00000] | 5 │ │ │ │ │ │ │ │ │
b: mip(0) at: [ 4, 7, 0], weights: [R: 0.00000, G: 1.00000, B: 0.00000, A: 0.00000] | ├───┼───┼───┼───┼───┼───┼───┼───┤
| 6 │ │ │ │ │ │ │ │ │
layer: 1 (-x) un-sampled | ├───┼───┼───┼───┼───┼───┼───┼───┤
| 7 │ │ │ │ │ │ │ │ │
layer: 2 (+y) un-sampled | └───┴───┴───┴───┴───┴───┴───┴───┘
| a: mip(0) at: [ 6, 3, 3], weights: [R: 0.00000, G: 0.00000, B: 0.00000, A: 1.00000]
layer: 3 (-y) | b: mip(0) at: [ 7, 3, 3], weights: [R: 0.00000, G: 0.00000, B: 1.00000, A: 0.00000]
0 1 2 3 4 5 6 7 | c: mip(0) at: [ 6, 4, 3], weights: [R: 1.00000, G: 0.00000, B: 0.00000, A: 0.00000]
┌───┬───┬───┬───┬───┬───┬───┬───┐ | d: mip(0) at: [ 7, 4, 3], weights: [R: 0.00000, G: 1.00000, B: 0.00000, A: 0.00000]
0 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ | layer: 4 (+z) un-sampled
1 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ | layer: 5 (-z) un-sampled
2 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ |
3 │ │ │ │ │ │ │ │ c │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ |
4 │ │ │ │ │ │ │ │ d │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ |
5 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ |
6 │ │ │ │ │ │ │ │ │ |
├───┼───┼───┼───┼───┼───┼───┼───┤ |
7 │ │ │ │ │ │ │ │ │ |
└───┴───┴───┴───┴───┴───┴───┴───┘ |
c: mip(0) at: [ 7, 3, 3], weights: [R: 0.00000, G: 0.00000, B: 0.00000, A: 1.00000] |
d: mip(0) at: [ 7, 4, 3], weights: [R: 1.00000, G: 0.00000, B: 0.00000, A: 0.00000] |
|
layer: 4 (+z) un-sampled |
|
layer: 5 (-z) un-sampled |
Note: To see these diagrams you might have to turn on debugging in the CTS with debug=1 in the URL