Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines: workaround for WebGL/Linux bug #24

Merged
merged 2 commits into from Dec 14, 2018
Merged

Lines: workaround for WebGL/Linux bug #24

merged 2 commits into from Dec 14, 2018

Conversation

jtbandes
Copy link
Contributor

A couple users reported bugs with line rendering on certain Linux laptops. I was able to narrow it down to a problem with stride/offset when multiple vertex attributes are views on the same underlying buffer.

This pure-regl example demonstrates the problem. It renders a simple moving average of some data: https://codepen.io/anon/pen/maVppw?editors=0010

On a Mac and some other platforms, this renders as expected (green = stride of 4 bytes, red = stride of 8 bytes):
image

However on the affected hardware, the result differs:
screenshot from 2018-12-13 18-33-42

This is consistent between Chrome & Firefox, so it seems like it might a graphics driver/hardware bug.

The problem seems to occur when 3 or 4 attributes are using the same buffer, but not with only 2, so we can work around it by taking a slight perf hit to upload 2 copies of the same data into two buffers so that each has only two attributes reading from it.

Copy link
Contributor

@vidaaudrey vidaaudrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Great debugging session 🐛

Copy link
Contributor

@brianc brianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Is there a chrome/chromium bug open about this to follow anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants