Skip to content

Fix usages of textureDimensionAndFormatCompatible #4376

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

Merged
merged 2 commits into from
Apr 28, 2025

Conversation

greggman
Copy link
Contributor

Sorry this is so big. Most of it is relatively search and replace

Fix usages of textureDimensionAndFormatCompatible.

All of these usages were wrong as they need the device to
know if a dimension and format are compatible since
extensions enable 3d dimension with compressed textures.

So, rename textureDimensionAndFormatCompatible to
textureFormatAndDimensionAndPossiblyCompatible to
let a test filter out formats that can't possibly
be used with certain dimensions. Then, for each test,
call t.skipIfTextureFormatAndDimensionNotCompatible
which checks the extensions.

Further, a few tests needed fixing.

copyTextureToTexture validation tests needed to handle
3d compress texture size limits correctly.

createTexture needed to not skip 3d compressed textures

layout_related needed to pass dimension to createAlignedTexture
and also, several tests had dimension as a test parameter but
didn't seem to be using it anywhere so added it into at least
texture creation on those tests.

expectTextureToMatchByRendering needed to handle 3d textures

texture_zero tests were mostly indirectly affected by
changes to texture_zero_init_test.ts. Nothing interesting
changed in this PR but the params there are extremely
convoluted and I didn't bother to decode exactly what
is going on in detail. I did glance over them and I think
they aren't skipping compressed textures.

skipIfTextureFormatAndDimensionNotCompatible to GPUTestBase

This is clean up for fixing copy tests to handle compressed 3d textures
@greggman greggman requested a review from shrekshao April 28, 2025 16:29
All of these usages were wrong as they need the device to
know if a dimension and format are compatible since
extensions enable 3d dimension with compressed textures.

So, rename textureDimensionAndFormatCompatible to
textureFormatAndDimensionAndPossiblyCompatible to
let a test filter out formats that can't possibly
be used with certain dimensions. Then, for each test,
call t.skipIfTextureFormatAndDimensionNotCompatible
which checks the extensions.

Further, a few tests needed fixing.

copyTextureToTexture validation tests needed to handle
3d compress texture size limits correctly.

createTexture needed to not skip 3d compressed textures

layout_related needed to pass dimension to createAlignedTexture
and also, several tests had dimension as a test parameter but
didn't seem to be using it anywhere so added it into at least
texture creation on those tests.

expectTextureToMatchByRendering needed to handle 3d textures

texture_zero tests were mostly indirectly affected by
changes to texture_zero_init_test.ts. Nothing interesting
changed in this PR but the params there are extremely
convoluted and I didn't bother to decode exactly what
is going on in detail. I did glance over them and I think
they aren't skipping compressed textures.
@greggman greggman force-pushed the fix-3d-compressed-tests branch from c443e31 to 2d48810 Compare April 28, 2025 16:40
@greggman
Copy link
Contributor Author

@greggman
Copy link
Contributor Author

i can split this up if it's too big

Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the detailed comments on each test modification

@greggman greggman merged commit 1a47862 into gpuweb:main Apr 28, 2025
1 check passed
@greggman greggman deleted the fix-3d-compressed-tests branch April 28, 2025 20:02
@beaufortfrancois
Copy link
Collaborator

Thanks @greggman!

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