New issue
Advanced search Search tips

Issue 722060 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

UNIFORM_BUFFER generic binding point reset every frame

Reported by tshe...@gmail.com, May 13 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce the problem:
1. Open the attached test case
2. 
3. 

What is the expected behavior?
Red triangle should move across the screen from left to right

What went wrong?
Triangle flashes red and then turns white. Does not move.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.110  Channel: stable
OS Version: Ubuntu 16.04
Flash Version: 

I've included 4 variations of ways to bind to the UNIFORM_BUFFER generic binding point for a data update via bufferSubData on lines 115-128. 
1. Bind to generic UNIFORM_BUFFER binding point (bindBuffer) outside the render loop. Works in Firefox 53, not Chrome 58.
2. Bind to UNIFORM_BUFFER at a specific index (bindBufferBase) outside the render loop. Works in Firefox 53, not Chrome 58.
3. Bind to generic UNIFORM_BUFFER binding point (bindBuffer) inside the render loop. Works in Firefox 53, not Chrome 58.
4. Bind to UNIFORM_BUFFER at a specific index (bindBufferBase) inside the render loop. Works in both Firefox 53 and Chrome 58.

The first frame draws correctly, but then it appears that the data updates are being done on the wrong uniform buffer (they're being done on colorUniformBuffer, defined on line 104, instead of offsetUniformBuffer, defined on line 100).
 
ubo-bindbuffer.html
4.8 KB View Download
Labels: Needs-Triage-M58
Labels: -OS-Linux -Needs-Triage-M58 OS-All
Status: Available (was: Unconfirmed)
Reproduced on macOS 10.12.4, HD 6000, Chrome 60.0.3100.0. Behavior is not exactly as described but definitely different from Firefox.
FWIW the behavior IS exactly as described on Android/Qualcomm.
> Triangle flashes red and then turns white. Does not move.

Comment 4 by kbr@chromium.org, May 16 2017

Are there bugs in Chrome's virtualization of uniform buffers, too?

What happens with --use-gl=angle ?

Broken for me on Linux with --use-gl=angle.
Owner: kainino@chromium.org
Status: Assigned (was: Available)
It does seem to be a virtualization issue, though. Using --use_virtualized_gl_contexts=1 works around the issue.
correction: --use_virtualized_gl_contexts=0
It also works with --use-gl=angle --use-passthrough-cmd-decoder
Status: Started (was: Assigned)
I've identified the issue; potential fix at
https://chromium-review.googlesource.com/506948

The problem is that in state restoration, indexed and general buffer bindings are restored in the wrong order (glBindBufferBase restorations are called after glBindBuffer restorations).

Not 100% sure yet if this fix is correct or if it needs to be slightly different.
Project Member

Comment 11 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6400c720a346d268183f659158691adfdeeb7a7a

commit 6400c720a346d268183f659158691adfdeeb7a7a
Author: Kai Ninomiya <kainino@chromium.org>
Date: Thu May 18 03:24:12 2017

Fix order of state restoration of indexed and general UBO bindings

Test: https://github.com/KhronosGroup/WebGL/pull/2402
Bug:  722060 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I198882569e7d3e58627578957bd0a275fc7ed7e2
Reviewed-on: https://chromium-review.googlesource.com/506948
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#472628}
[modify] https://crrev.com/6400c720a346d268183f659158691adfdeeb7a7a/gpu/command_buffer/service/context_state.cc

Status: Fixed (was: Started)

Sign in to add a comment