Closed Bug 1665935 Opened 4 years ago Closed 3 years ago

WebGL2 bindBufferRange(gl.UNIFORM_BUFFER) misbehaves for offsets over 64kB

Categories

(Core :: Graphics: CanvasWebGL, defect)

80 Branch
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bqqbarbhg, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

Steps to reproduce:

On Firefox+Windows+Nvidia using gl.bindBufferRange() to bind an uniform buffer with offset of greater than or equal to 64kB fetches invalid data from the uniform buffer. This matches the size of GL_MAX_UNIFORM_BLOCK_SIZE on this platform, but in my experience no other GL implementation has restricted the backing uniform buffer size (vs the actual bound size).

I created a small repro case here: https://github.com/bqqbarbhg/ff-ubo-offset-repro

Online demo: https://bqqbarbhg.github.io/ff-ubo-offset-repro/

Actual results:

With UBO offset of 0x10000 or greater the lower blue triangle is rendered white on Firefox so the resulting image is green/white.

Expected results:

On other browsers and native GL(ES) implementations binding an uniform buffer with larger offset works as it's supposed to and the resulting image is green/blue.

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

Is this still happening?

Severity: -- → S3
Flags: needinfo?(bqqbarbhg)

Seems like it has been fixed at least on my setup, nice! The online demo (https://bqqbarbhg.github.io/ff-ubo-offset-repro/) is quite staightforward: Just open the page and see if it's green/blue and not green/red, so it might be worth trying it with a couple of different configurations before closing this issue. But at least Windows 10 / Nvidia / 93.0 works for me.

Flags: needinfo?(bqqbarbhg)

I tested on my Win+Amd machine, but that's great to hear!

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.