Skip to content

webgl: Validate dimensions in TexImage3D properly with level#44367

Merged
yezhizhen merged 1 commit intoservo:mainfrom
simartin:per_level_dimension_checks
Apr 20, 2026
Merged

webgl: Validate dimensions in TexImage3D properly with level#44367
yezhizhen merged 1 commit intoservo:mainfrom
simartin:per_level_dimension_checks

Conversation

@simartin
Copy link
Copy Markdown
Contributor

The tex-3d-size-limit.html test verifies that TexImage3D errors out with gl.INVALID_VALUE if the width / height / depth parameters are greater than gl.MAX_3D_TEXTURE_SIZE / 2 ** level, in accordance with the mipmap levels definition.

This patch adds this checks, and fixes a s/depth/level/ typo, and should stabilize tex-3d-size-limit.html: all its sub-tests will succeed until the first call to (not implemented) TexSubImage3D, that will end the test.

It's still possible for the test to fail on environments where gl.MAX_3D_TEXTURE_SIZE is not 8192 (because the numbering of tests will be different), and this will have to be until we make all sub-tests pass, i.e. TexSubImage3D is implemented.

Testing: A bunch of expected failures are removed.
Fixes: #44280

@simartin simartin requested a review from gterzian as a code owner April 20, 2026 07:47
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 20, 2026
Copy link
Copy Markdown
Member

@yezhizhen yezhizhen left a comment

Choose a reason for hiding this comment

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

errors out with gl.INVALID_VALUE if the width / height / depth parameters are greater than gl.MAX_3D_TEXTURE_SIZE / 2 ** level

Can you give spec/wikipedia link for this and add the link as code comment?

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 20, 2026
@yezhizhen yezhizhen changed the title webgl: properly validate dimensions in TexImage3D webgl: Validate dimensions in TexImage3D properly with level Apr 20, 2026
The tex-3d-size-limit.html test verifies that TexImage3D errors out with
gl.INVALID_VALUE if the width / height / depth parameters are greater
than gl.MAX_3D_TEXTURE_SIZE / 2 ** level, in accordance with the mipmap
levels definition.

This patch adds this checks, and fixes a s/depth/level/ typo, and should
stabilize tex-3d-size-limit.html: all its sub-tests will succeed until
the first call to (not implemented) TexSubImage3D, that will end the
test.

It's still possible for the test to fail on environments where
gl.MAX_3D_TEXTURE_SIZE is not 8192 (because the numbering of tests will
be different), and this will have to be until we make all sub-tests
pass, i.e. TexSubImage3D is implemented.

Testing: A bunch of expected failures are removed.
Fixes: servo#44280
Signed-off-by: Simon Martin <simon@nasilyan.com>
@simartin simartin force-pushed the per_level_dimension_checks branch from 83e3530 to b2f93be Compare April 20, 2026 14:11
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 20, 2026
@simartin
Copy link
Copy Markdown
Contributor Author

Thanks @yezhizhen for the suggestion; I have just pushed a new version with the relevant information added.

Copy link
Copy Markdown
Member

@yezhizhen yezhizhen left a comment

Choose a reason for hiding this comment

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

Thanks!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 20, 2026
@yezhizhen yezhizhen enabled auto-merge April 20, 2026 14:17
@yezhizhen yezhizhen added this pull request to the merge queue Apr 20, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 20, 2026
Merged via the queue into servo:main with commit d4a63f8 Apr 20, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 20, 2026
@simartin simartin deleted the per_level_dimension_checks branch April 20, 2026 15:52
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.

Intermittent failures in /_webgl/conformance2/textures/misc/tex-3d-size-limit.html

3 participants