Repository navigation
Fix WebGPU compressed texture uploads and mip chains - #4204
Conversation
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no outstanding findings remain. SummaryFixes compressed texture uploads and preserves valid supplied mip chains down to 1×1.
Reviews (3) · Last reviewed commit: "Use valid ASTC blocks in the mip regress..." · Reviewed by Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 75dca1e. Configure here.
ibgreen
left a comment
There was a problem hiding this comment.
Keep physical mip-edge rounding without widening interior buffer updates.
| }, | ||
| {width, height, depthOrArrayLayers} | ||
| { | ||
| width: Math.ceil(width / blockWidth) * blockWidth, |
There was a problem hiding this comment.
Unconditional rounding silently widens an interior region: BC1 8×4 at origin (0,0), writeBuffer({width: 5, height: 4}) now submits 8×4 instead of failing native block validation on 5×4, so a valid submission can overwrite the three columns outside the documented region. I captured the base/head encoder arguments with the exact method bodies and normalized-options stubs. The intended 7×4 logical edge → 8×4 physical, 1×1 mip → 4×4, and aligned 4×4 → 4×4 controls also behaved as expected. No GPU readback.
Please reject an unaligned extent unless origin + extent equals the logical mip size on that axis. Then round only the valid logical edge. writeData already rounds this way without the interior guard, so a shared check can keep both paths consistent.

Goals
Make compressed texture uploads consistent and expose the WebGPU opt-in for non-block-aligned textures.
Changes
texture-compression-unalignedto the typed device feature list and document it alongside 3D BC and ASTC.Verification
yarn lint fix,yarn build,yarn bundle-size, andyarn test-node(5,544 passed)