Skip to content

Conversation

@DavidPeicho
Copy link
Contributor

@DavidPeicho DavidPeicho commented Nov 28, 2025

Using compressedTexSubImage3D on a layered texture with a non-null y offset is currently raising an INVALID_VALUE on Meta Quest 2.

This PR adds a test that ensures using an offset works as expected.

EDIT: Looks like the behavior is broken on a lot of Qualcomm chips. Test fails on Browserstack for Samsung Galaxy Z Fold / S25, as well as OnePlus phones

@CLAassistant
Copy link

CLAassistant commented Nov 28, 2025

CLA assistant check
All committers have signed the CLA.


// Upload with offsets
tex = setupEmptyTexture(gl.TEXTURE_2D, false);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating empty compressed texture array via compressedTexImage3D");
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect message

// ASTC block size is always 16 bytes (128 bits)
const offset = (width / blockSize.width + height / blockSize.height - 1) * 16;

gl.compressedTexSubImage2D(target, 0, x, y, blitWidth, blitHeight, format, data, offset);
Copy link
Member

Choose a reason for hiding this comment

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

For completeness, please also test the length override parameter like

compressedTexSubImage2D(target, 0, x, y, blitWidth, blitHeight, format, data,
                        0, data.length - offset)

checkResult(target, [gl.NO_ERROR, gl.INVALID_ENUM, gl.INVALID_ENUM ], "2D", true);

if (useES3) {
gl.compressedTexSubImage3D(target, 0, x, y, 0, blitWidth, blitHeight, 1, format, data, offset);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

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