Skip to content

Conversation

@greggman
Copy link
Contributor

Chromium CQ test here

kainino0x
kainino0x previously approved these changes Nov 11, 2025
@greggman greggman force-pushed the fix-texture-component-swizzle-typo branch from 1b893d6 to 4d68eae Compare November 12, 2025 02:39
@greggman
Copy link
Contributor Author

greggman commented Nov 12, 2025

This turned into a bigger change than just fixing the typo.
With the typo fixed, a bunch of tests started failing.
One issue in particular is that out of bounds textureLoad
needs to take swizzle into account since its allowed to
return any value inside the texture. I'm making the assuption
that the spec would say it can return any swizzled value in
the texture and filed gpuweb/gpuweb#5437
though with that assumption the test pass again.

This comes up with depth textures because if texture-component-swizzle
is enabled then we check RGBA for depth textures instead of just R
and we expcet GBA to be 001. Before this change, if the texel address
was invalid we'd get a texel from the software texture and GBA would
be wrong and so no texels would match.

Theoretically, with this change, the software sampler code supports
swizzles but, that path is not really be exercised. Only the fact that
depth textures go from R??? to R001 when 'texture-component-swizzle'
is enabled is exercised.

It seems to be passing now. The failure there seem related to #4495

@greggman greggman force-pushed the fix-texture-component-swizzle-typo branch 2 times, most recently from 03201f4 to 10022b1 Compare November 14, 2025 00:25
@greggman greggman enabled auto-merge (squash) November 14, 2025 00:26
This turned into a bigger change than just fixing the typo.
With the typo fixed, a bunch of tests started failing.
One issue in particular is that out of bounds `textureLoad`
needs to take swizzle into account since its allowed to
return any value inside the texture. I'm making the assuption
that the spec would say it can return any swizzled value in
the texture.

This comes up with depth textures because if texture-component-swizzle
is enabled then we check RGBA for depth textures instead of just R
and we expcet GBA to be 001. Before this change, if the texel address
was invalid we'd get a texel from the software texture and GBA would
be wrong and so no texels would match.

Theoretically, with this change, the software sampler code supports
swizzles but, that path is not really be exercised. Only the fact that
depth textures go from R??? to R001 is used.
@greggman greggman force-pushed the fix-texture-component-swizzle-typo branch from 10022b1 to e857101 Compare November 14, 2025 02:50
@greggman greggman merged commit 452bd98 into gpuweb:main Nov 14, 2025
1 check passed
@greggman greggman deleted the fix-texture-component-swizzle-typo branch November 14, 2025 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants