Repository navigation
Add webgl draw buffers support - #144
Conversation
There was a problem hiding this comment.
First off, thank you for your hard work! Much appreciated. Looking forward to having this land and include you and your support on this repo. But first…
I pulled down the repo, built, and ran the tests locally (after making some quick fixes to the multiple-render-targets test script).
While the draw_buffer and multiple-render-targets tests pass, there are 44 tests that don't seem to pass.
Namely these suites:
- renderbuffers_framebuffer-object-attachment
- rendering_gl-scissor-fbo-test
- state_state-uneffected-after-compositing
- textures_mipmap-fbo
Are you getting these results, or are all your tests passing?
|
Will resolve this AM. |
|
I started to look at failures from enabling "extensions_webgl-draw-buffers" from conformance tests, and we have a bit to go to satisfy those, fyi. As far as the other failures, I only get the following failures:
But the tests to seem to die early with: |
|
I'm getting errors with the in multiple-render-targets.js, |
|
Just reproduced, will have a fix momentarily. |
|
It was the inclusion of the |
|
The size of the graphical output was simply me trying to find one of the simplest outputs that I hadn't written so to re-emulate. The original "test" was from here: https://stackoverflow.com/questions/51793336/webgl-2-0-multiple-output-textures-from-the-same-program/51798078#51798078 , which was just me counting the pixels, and yes they are |
|
Interesting! I wonder if foreground or background is being lost? How far do we need to go to get this merged in? Does it have to be full on unit tests compliant, or can we go in stages? |
|
Doing some basic math: …I don't how that's significant (or if it's just coincidence), but I would guess that one of the colour's channels values is 0? Are you getting this result when you run the tests? (btw - you can write |
|
If I may propose: This unit test is too complex. We just need a few pixels to know the output, in-fact, was from multi targets. We can then start to address bugs as they are found, like this one. |
|
That is as well a good point, perhaps we should ensure none of them are zero, before checking if they are zero 😛 |
Unfortunately for us (but fortunate for the project) we can have no regression in the tests in order to land something in master and push a release. Which means all the tests must pass as the current pass rate is 100%. Fortunately, it's only a few suites that are failing, and the source of the errors likely lies in a single point of the new code. Find that source, and the tests will likely pass. |
|
That isn't what I mean, of course this PR cannot introduce new bugs. What I mean is, for example, this entire feature isn't being tested as it has been black listed here: headless-gl/test/extensions.js Line 6 in e558e99 What I should have clarified is: Does that entire blacklisted suite need to pass before this lands? |
|
btw, I think I found the source of the zeros: |
Good question. I'll have to think about that. My inclination is that the test should no longer be black listed if we're adding this functionality in. However, it may have been blacklisted for other reasons. |
|
Then I'll get to work on unit tests asap. |
|
Was failing 130 or so tests, now down to 18 with extension tests on, fyi. |
FF passes fine for me! There has to be something I'm missing then. |
|
Ok, I don't think it (broadcasting the color from gl_FragColor) is supported in the version of google angle we are on. The missing feature implementation from google angle: https://github.com/google/angle/blob/7c37ca1836402b654dbbf5f00007e09bdf2a7051/src/compiler/translator/tree_ops/EmulateGLFragColorBroadcast.cpp We could shim in something like this, but ultimately I'd like to keep our stuff as vanilla as possible. Neither the feature or the unit test are in our version, fyi. |
|
Yes, let's keep it as-is and not shim it. Hopefully in the future if/when we upgrade the angle implementation, we can expect behaviour more consistent with the spec and have those tests pass. Other than the Also, I believe the multiple render targets test you added needs some fixing up to have the correct expected vs. actual zeros quantities. |
I don't think so, (also, already built an upgrade script for google angle for later on down the road, he he) looking into other tests and the new test I added. Ty @dhritzkiv ! |
|
I run into some funny business with the following tests: They cause a |
|
Hmm, I don't have an issue with those suites on my machine… |
|
It is probably either my node version (10) or operating system (osx 10.13.3 (17D47)). Regards "15". I forgot to account for the missing pixel you pointed out, the one that is "0". Fixing it, will have it updated momentarily. |
|
Hmm. I'm running the exact same environment. I imagine our GFX cards are different (but that also shouldn't matter). Mine is the NVIDIA GeForce GTX 675MX 1024 MB (from 2011, 2012) |
|
I'm running the Intel stock, don't know the details this moment. |
|
Regardless, it is a separate issue to those raised by this PR. What needs to happen next with this PR to be merge worthy? |
|
My GFX is an: Intel Iris Pro 1536 MB |
|
I'll do at least one more review of this PR's code, tests, and README over the next few days, and I'll invite the other maintainer of the repo to do so as well. Overall, it's looking to be in a good place. After that, we'll merge into master, and then cut a new release for npm (along with generating prebuilt files for easy install). |
|
@mourner Hey! Could you look over this PR quick? I need to do another pass over soon, myself, but overall it looks good. Summary of the state of this:
† †† my rationale for continuing to ignore the webgl-draw-buffers extension suite: 1) this is a non-breaking change; 2) the tests for that extension never worked and are outdated/diverged from the Khronos conformance tests suite (which themselves don't pass in every browser). Robert here has been working super hard on this PR in order to support his awesome gpujs/gpu.js project and by extension BrainJS/brain.js. Both highly successful and impressive works. He's been working on this since well before this PR's creation. He and I have been talking behind the scenes and he's expressed an interest in becoming a maintainer on this repo. Given his excellent work on this PR, his authorship of the two aforementioned products, and his overall enthusiasm for this project, I would recommend him as a maintainer. Robert also has started on other potential headless-gl improvements, such as updating angle which includes the support of webgl-2. |
|
@robertleeplummerjr FYI: I added a small stylistic commit to the PR in order to trigger a CI build |
Remove superfluous // eslint-disable-line and simplify return
|
I'll wait until midday tomorrow for the other maintainer to chime in. After that, I'll merge, version bump, and release on npm. |
mourner
left a comment
There was a problem hiding this comment.
This looks pretty good to me — thanks a lot for working on this! My only nitpick is the amount of repetition with those 0–16 attachments/etc., but I'm not sure how easy it is to DRY up — we can leave that for a follow-up.
|
@robertleeplummerjr Just invited you as a collaborator. Thanks again for taking on this — I'm excited! |
|
Ty guys. Invite accepted! |


Closes #142
The unit test I ported from webgl2, to webgl1, to headlessgl, and then as well to google angle, to see how is would hold up across layers. They are here: https://github.com/proxy/gist.github.com/robertleeplummerjr/3313587571dd2a8fa3c3907e451b5564