Closed Bug 1541396 Opened 5 years ago Closed 5 years ago

WebGL 2 Transform Feedback Broken (generic bind point blocking non-TF use)

Categories

(Core :: Graphics: CanvasWebGL, defect, P1)

66 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla69
Tracking Status
firefox69 --- verified

People

(Reporter: tareksherif, Assigned: jgilbert)

References

Details

(Whiteboard: [good first verify])

Attachments

(2 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

Go to this page: https://tsherif.github.io/webgl2bugs/firefox/transform-feedback-unbind.html

Actual results:

Point doesn't animate

Expected results:

Point should animate.

The problem seems to be that when a buffer is bound to TRANSFORM_FEEDBACK_BUFFER it gets bound to the current transform feedback object as well as the default one. The TRANSFORM_FEEDBACK_BUFFER on the default transform feedback object then has to be explicitly unbound. See comments in the source code for details: https://github.com/tsherif/webgl2bugs/blob/master/firefox/transform-feedback-unbind.html

Broken on both Windows 10 and Ubuntu 16.04. Works in Chrome on both.

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

ni?jgilbert to confirm we're misimplementing semantics here

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jgilbert)
Priority: -- → P3

(In reply to tareksherif from comment #0)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

Go to this page: https://tsherif.github.io/webgl2bugs/firefox/transform-feedback-unbind.html

Actual results:

Point doesn't animate

Expected results:

Point should animate.

The problem seems to be that when a buffer is bound to TRANSFORM_FEEDBACK_BUFFER it gets bound to the current transform feedback object as well as the default one. The TRANSFORM_FEEDBACK_BUFFER on the default transform feedback object then has to be explicitly unbound. See comments in the source code for details: https://github.com/tsherif/webgl2bugs/blob/master/firefox/transform-feedback-unbind.html

Broken on both Windows 10 and Ubuntu 16.04. Works in Chrome on both.

The TF Buffer object is probably still bound to the TRANSFORM_FEEDBACK_BUFFER non-indexed bind point, which Firefox still treats as "bound for transform feedback".

A workaround is to call bindBuffer(TRANSFORM_FEEDBACK_BUFFER, null) after bindBufferBase/Range(TRANSFORM_FEEDBACK_BUFFER, ...).

Flags: needinfo?(jgilbert)
Priority: P3 → P1
Priority: P1 → P2
  • Remove WebGLBuffer::SetSlot
  • Make most bindBuffer calls lazy.
  • Replace nsTArray with std::vector in WebGLVertexArray.
Assignee: nobody → jgilbert

This lets us dodge an "unexpected GL error" assert due to differences in handling
between GLES3 and GL410 and below. (macOS)

This lets us dodge an "unexpected GL error" assert due to differences in handling
between GLES3 and GL410 and below. (macOS)

Summary: WebGL 2 Transform Feedback Broken → WebGL 2 Transform Feedback Broken (generic bind point blocking non-TF use)
Priority: P2 → P1

BindBufferBase/Range will fail (on some drivers) if the buffer name has never been bound.
(GenBuffers makes a name, but BindBuffer initializes that name as a real buffer object)

Attachment #9074904 - Attachment is obsolete: true
Attachment #9074930 - Attachment is obsolete: true
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c28fedb2c6a
Refactor (non-)transform-feedback binding/use checks. r=lsalzman
https://hg.mozilla.org/integration/autoland/rev/979f1395a70c
Add GLBuffer prebind workaround. r=lsalzman
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Whiteboard: [qa-69b-p2]
Whiteboard: [qa-69b-p2] → [good first verify]

Following the STR from the description, I reproduced this issue using Fx 68.0a1(2018-04-03) on Ubuntu 18.04 LTS and on Windows 10 using the same Fx version. I can confirm that this issue is fixed using Fx 69.0b13 on the same environments.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: