Closed Bug 1772197 Opened 3 years ago Closed 3 years ago

WebGL2 texSubImage2D generates invalid INVALID_OPERATION error

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 101
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: mozilla2, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Steps to reproduce:

Ran this test

https://jsgist.org/?src=cce4c62ef5e85d4b84d738337add4b48

Actual results:

I created a texture using texStorage2D then tried to fill out all the mips manually and got an error on the last mip

Expected results:

No error

There's no error if I use texImage2D instead

https://jsgist.org/?src=7e72a166f1518e35416da4ece3ee85ee

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core
Component: Graphics: WebRender → Canvas: WebGL

The severity field is not set for this bug.
:jgilbert, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jgilbert)

Ah, this is a test issue.

  const maxLODs = Math.log2(maxTextureSize) | 0 + 1;

This is parsed as Math.log2(maxTextureSize) | (0 + 1), but I bet you meant (Math.log2(maxTextureSize) | 0) + 1. Firefox and Chrome have different maxTextureSizes here:

  • Firefox: 8192 (log2: 13)
  • Chrome: 16384 (log2: 14)

Because one is even and the other odd, the ambiguous parse looks like it works fine on chrome, but the +1 might seem like it is dropped in Firefox.

Fixed test: https://jsgist.org/?src=cb64%2CeJyFVQ1v2zYQ_Ss3oYDlWdMcYxgKB-6QDyMIkHZD7GDdYiOWJVpmS1EGRSfOXP333ZGULKktGsQ2eXz37viOPB49GWXMG3t_s_XNHWh2mOlcRSkbXcMv78x8v77NjMELvIJpzWVaeONjGXgbLhi54_TR4zJhh3CrM4E4O4mLoh5_Kryl9SB0HbblFedSM6nR7JVBB2K5ToidYnCELFIpl2MYnkP5tQ_GbLps9jLWPJcg8vQqF7nyY_oOIAxD5Cn6cFxIAHQoNDDBMphAksf7DN3DWLFIsylaceb3MHyvf05wAoaok76ygdCJyMJPOZd-D5qoQr8KFpqgiDK_ZrEOss6T1zDa7ZhMrrZcJD65EUG5kAvZzN9v51zvqMfllimue6ddVe6CaZD7bKpUrgqMP8SFmpKRtUM6GNRwk-YpiGLJNwLUZFmEW2-pmYrva7nw4kg-R8XC64cpszIeUOIXtk7FyOhHRHwD_k-pcLSWOEc5beYLTzKWgPVBJpMwgGJ6r6SZmBSrfLLoMMcge8Vm_D-GuaWCYv8VKTw_mikf5-8vPj7Npx_nD_fTp9ntv1PLWfvf_XlNKvrvI70NUZqR3ybtwxcY9mEAZ20_B0H3Sx4Rww9CI_Dp8vZiVulAxV-1Q43hzbFtKVc22wpMyToUDbvL7ZzadM5oXU47wRrZ3G0xHdi3vGhe4xWsjDitdjO6Dsi1Ed76k5Gw8ML1tpEoZHwHgj0zUbickazZpbrkzjEg3P3N5cVbY2pIE8CZJXLniK6FCeCuBNk2eEF9WnjhCaYz6VCcO_s76jsVxP7-CiNbd8deybXjB9wCwiR7gQcu9dsLpaJX33r9DGf4-a06teDgIbZLgXlQcniOTstGOGOnWplBGdgMyGAGaHiOxN4cDkv3OFyisXAHxoXADp4i2IlLf07guu13FTbhAhiafxMKJa31NoOHD7Pbmw9TPLj_zKeB280pQrxl8eebO9NakP20MBgYcjcvoXFv6frX7aiWt7r8mwgflqS69yW22wKfB1dgFGvh7aKiaCC6LSsVU2Sf5zOt8H3zjXKtDvaZvVL5HpfG3xyQegG4BPN-ju6xc2P7ldgoTRerE6X0vw15RIIlTCYTW67GyaGQ4W5fbH0cVSJh2u7L9jaLslWEP-zMPT1f8PGBMayGhzdHwx3qan9nv_fL1Vd9u1uX1nuo6M2yvcoCbEa0MVzrVGSFDd-M6KR1tCV0dd6qOtgX49wrl-X_U-vZQA%3D%3D

"RESOLVED INVALID" is our "NOTABUG". Thanks for the report!

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(jgilbert)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.