-
Notifications
You must be signed in to change notification settings - Fork 668
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
Verify that WebGL's implicit clears obey the rasterizer discard state. #3183
Verify that WebGL's implicit clears obey the rasterizer discard state. #3183
Conversation
@jdarpinian or @shrekshao or @jdashg : please review. Test passes on Firefox; fails on Chrome and Safari. Patches incoming for both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. (learn webgl implicit clearing from greggman's answer: https://stackoverflow.com/questions/54947518/requestanimationframe-readpixel-and-implicit-clear)
(If a readpixels test needs adding as well together with drawArrays, as James points out in the CL review) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a test so it's fine, but I do have some nits.
sdk/tests/conformance2/rendering/rasterizer-discard-and-implicit-clear.html
Outdated
Show resolved
Hide resolved
sdk/tests/conformance2/rendering/rasterizer-discard-and-implicit-clear.html
Outdated
Show resolved
Hide resolved
sdk/tests/conformance2/rendering/rasterizer-discard-and-implicit-clear.html
Show resolved
Hide resolved
sdk/tests/conformance2/rendering/rasterizer-discard-and-implicit-clear.html
Outdated
Show resolved
Hide resolved
sdk/tests/conformance2/rendering/rasterizer-discard-and-implicit-clear.html
Outdated
Show resolved
Hide resolved
Thanks everyone for your comments. Addressed @jdashg 's review feedback. Added a test of implicit clears, rasterizer discard and readPixels based on @jdarpinian 's review feedback on the Chromium review request https://chromium-review.googlesource.com/2542770 . The Travis CI system is slow for some reason right now. Squashing and merging this in order to get it in sooner. |
WebGL conformance test for this is incoming in KhronosGroup/WebGL#3183 . Bug: 1149176 Change-Id: I805ae3dfc63af6afa926599ccc606d11e2e3e20e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542770 Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#829527}
https://bugs.webkit.org/show_bug.cgi?id=219061 Patch by Kenneth Russell <kbr@chromium.org> on 2020-11-30 Reviewed by Dean Jackson. When rasterizer discard is enabled, user-level draw calls and clears skip the implicit clear since they have no effect. Readbacks and copies still perform the implicit clear. A new WebGL conformance test has been added for this in KhronosGroup/WebGL#3183 which passes with this fix. WebKit's TestRunner doesn't run the composite phase as the browser or MiniBrowser do, so wouldn't pass this test as integrated as a layout test. Per discussion with dino and kkinnunen on Slack, will address this in follow-on work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::ScopedDisableRasterizerDiscard::ScopedDisableRasterizerDiscard): (WebCore::ScopedDisableRasterizerDiscard::~ScopedDisableRasterizerDiscard): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::clearIfComposited): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData): (WebCore::WebGLRenderingContextBase::clear): (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): (WebCore::WebGLRenderingContextBase::disable): (WebCore::WebGLRenderingContextBase::drawArrays): (WebCore::WebGLRenderingContextBase::drawElements): (WebCore::WebGLRenderingContextBase::enable): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::drawArraysInstanced): (WebCore::WebGLRenderingContextBase::drawElementsInstanced): * html/canvas/WebGLRenderingContextBase.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@270253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=219061 Patch by Kenneth Russell <kbr@chromium.org> on 2020-11-30 Reviewed by Dean Jackson. When rasterizer discard is enabled, user-level draw calls and clears skip the implicit clear since they have no effect. Readbacks and copies still perform the implicit clear. A new WebGL conformance test has been added for this in KhronosGroup/WebGL#3183 which passes with this fix. WebKit's TestRunner doesn't run the composite phase as the browser or MiniBrowser do, so wouldn't pass this test as integrated as a layout test. Per discussion with dino and kkinnunen on Slack, will address this in follow-on work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::ScopedDisableRasterizerDiscard::ScopedDisableRasterizerDiscard): (WebCore::ScopedDisableRasterizerDiscard::~ScopedDisableRasterizerDiscard): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::clearIfComposited): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData): (WebCore::WebGLRenderingContextBase::clear): (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): (WebCore::WebGLRenderingContextBase::disable): (WebCore::WebGLRenderingContextBase::drawArrays): (WebCore::WebGLRenderingContextBase::drawElements): (WebCore::WebGLRenderingContextBase::enable): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::drawArraysInstanced): (WebCore::WebGLRenderingContextBase::drawElementsInstanced): * html/canvas/WebGLRenderingContextBase.h: Canonical link: https://commits.webkit.org/231962@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebGL conformance test for this is incoming in KhronosGroup/WebGL#3183 . Bug: 1149176 Change-Id: I805ae3dfc63af6afa926599ccc606d11e2e3e20e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542770 Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#829527} GitOrigin-RevId: 29f71568490de8f3a420580e8497c4a5e73600fb
Regression test for http://crbug.com/1149176 .