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

Test both alpha:true and alpha:false in webgl_canvas tests. #3071

Merged
merged 3 commits into from
May 13, 2020

Conversation

kenrussell
Copy link
Member

Remove explicit use of Promises in the inner loop, and change to use
async/await, to provide better control of the execution order of the
test cases.

Verified in Chrome, Firefox and Safari on macOS. ToT of all browsers
pass the new tests; Firefox has a couple of preexisting failures with
the RGBA10_A2/RGBA/UNSIGNED_INT_2_10_10_10_REV combination.

Remove explicit use of Promises in the inner loop, and change to use
async/await, to provide better control of the execution order of the
test cases.

Verified in Chrome, Firefox and Safari on macOS. ToT of all browsers
pass the new tests; Firefox has a couple of preexisting failures with
the RGBA10_A2/RGBA/UNSIGNED_INT_2_10_10_10_REV combination.
@kenrussell
Copy link
Member Author

@jdashg and perhaps @jdarpinian or @shrekshao could you please review?

This does increase the run time of this subset of the conformance2/ tests, but it's a fairly small subset, so shouldn't have a large impact.

Note that these new tests actually pass in all current WebGL 2.0 implementations. It could be argued that they don't catch any new bugs, but on the other hand, it's probably a good idea to increase testing coverage of alpha:false.

@@ -67,7 +69,7 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource
runTest();
Copy link
Member

Choose a reason for hiding this comment

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

Do we need an await here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point and good question. I just tested both with and without the await and the tests seem to behave the same. The Promise returned by init() is explicitly waited on in the anonymous function returned at the bottom of the file.

One behavioral difference with this change is that the intermediate results aren't displayed any more. I tried changing "await wtu.dispatchPromise(...)" to "await wtu.dispatchRAFPromise(...)", and doing a requestAnimationFrame inside it. Still no difference - the web page only displays the final results, not the intermediate ones.

I'm not an expert in Promises. Can you think of any improvements to make here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Figured it out - needed to await wtu.dispatchPromise() after every test case. Thanks for your catch; please re-review.

@kenrussell
Copy link
Member Author

Update: these new alpha:false tests actually do catch a bug in ToT WebKit on iOS! Will appreciate your reviews to get these in. Thanks.

@kenrussell
Copy link
Member Author

@grorg FYI please see above comment! :)

Copy link
Member

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

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

LGTM overall.

let visibleCtx = wtu.create3DContext(null, { preserveDrawingBuffer:true, alpha:alpha });
if (!visibleCtx) {
testFailed("context does not exist");
finishTest();
Copy link
Member

Choose a reason for hiding this comment

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

I believe when returned it would run finishTest anyway. So it's duplicate here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thanks, that and another finishTest() can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed in the current version.

@kenrussell
Copy link
Member Author

New tests have caught bugs, so merging now.

@kenrussell kenrussell merged commit 203efb4 into KhronosGroup:master May 13, 2020
@kenrussell kenrussell deleted the expand-webgl-canvas-tests branch May 13, 2020 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants