src/libANGLE/renderer/gl/ContextGL.cpp


Log

Author Commit Date CI Message
Amirali Abdolrashidi 17bf6e98 2021-11-11T20:53:31 Implement GL_EXT_multi_draw_indirect * Added the validation functions for multiDrawArraysIndirect() and multiDrawElementsIndirect() according to the specs. * Added generic implementation for the two functions that can be called by back-ends. * Added unit tests for the multiDrawIndirect functions. * Added flags for back-ends so they can enable the extension. * Minor cleanup in MultiDrawTest.cpp Bug: angleproject:6439 Change-Id: I4e5f1cab05c6de330aef82d115492dcc9d2fad44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276043 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill bdc633a8 2021-10-20T12:33:42 Pass command type down to ContextImpl::syncState. This mirrors the command type passed to the object sync functions. It will be useful to determine if we're syncing for a draw or a dispatch call. Bug: angleproject:6595 Change-Id: Ia04bd14a3c2dd2eb211c47a6e55f8ddcbfedfaaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3233904 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 8bb3c827 2021-07-22T19:06:40 Fix Multithreaded eglDestroyContext()/eglTerminate() The following EGL calls can lead to a crash in eglMakeCurrent(): Thread A: eglMakeCurrent(context A) Thread B: eglDestroyContext(context A) B: eglTerminate() <<--- this release context A Thread A: eglMakeCurrent(context B) The eglMakeCurrent(context B) call will assert when attempting to unMakeCurrent(), since thread A doesn't know that context A was already destroyed by thread B. To fix this: 1.) A Context will only be released once there are no Threads that currently have a reference to it (no longer have the Context current). - Context::mIsCurrent is being removed, since it was inaccurate and not thread-safe. For example, when eglTerminate() was called, the eglTerminate()'ing-Thread would "steal" the Context that was current on another Thread to destroy it. 2.) A Display will only be fully terminated and its resources released once all Contexts have been destroyed and are no longer current. Otherwise, Display::terminate() will return if any Contexts are still in use by a Thread. EGL 1.5 Specification 3.2 Initialization If contexts or surfaces, created with respect to dpy are current (see section 3.7.3) to any thread, then they are not actually destroyed while they remain current. If other resources created with respect to dpy are in use by any current context or surface, then they are also not destroyed until the corresponding context or surface is no longer current. With this fix, the app com.netmarble.sknightsmmo can start. This also exposed an issue with GlslangFinalize(), since glslang can only be initialized/finalized once per process. Otherwise, the following EGL commands will call GlslangFinalize() without ever being able to GlslangInitialize() again, leading to crashes since GlslangFinalize() cleans up glslang for the entire process. dpy1 = eglGetPlatformDisplay() | eglInitialize(dpy1) | GlslangInitialize() dpy2 = eglGetPlatformDisplay() | eglInitialize(dpy2) | GlslangInitialize() eglTerminate(dpy2) | GlslangFinalize() eglInitialize(dpy1) | isInitialized() == true Since Display::isInitialized() == true, the rest of Display::initialize() is skipped and GlslangInitialize() is not called. Later, the next test that attempts to compile a program will crash due to glslang no longer being initialized. Finally, this exposed the following tests leaking EGLContext handles: - EGLSurfaceTest::initializeContext() - EGLContextSharingTest.DisplayShareGroupContextCreation - EGLCreateContextAttribsTest.IMGContextPriorityExtension - EGLMultiContextTest.TestContextDestroySimple Other tests were failing to reset the context, preventing the Display from being terminated since there were still references to Contexts owned by the display: eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); Bug: angleproject:6208 Bug: angleproject:6304 Bug: angleproject:6322 Test: EGLContextSharingTest.EglTerminateMultiThreaded Test: EGLContextSharingTestNoFixture.EglDestoryContextManyTimesSameContext Test: Load com.netmarble.sknightsmmo Change-Id: I160922af93db6cabe0ed396be77762fa8dfc7656 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046961 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Geoff Lang de09f8db 2021-09-02T18:21:37 Revert "GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY" This reverts commit 4b5a774e855af2493d64b0635f56053bd795c5c5. Reason for revert: broken on iOS and Skia Original change's description: > GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY > > Bug: angleproject:3020 > Change-Id: Iff460a1012d06e1c5feff84d91117de87e7c870a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123167 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: angleproject:3020 Change-Id: I54d81a7b734d007f65ff97990008f5e6eb8536f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140453 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 4b5a774e 2020-04-03T14:56:36 GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY Bug: angleproject:3020 Change-Id: Iff460a1012d06e1c5feff84d91117de87e7c870a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123167 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang f3bccd9d 2021-08-26T18:04:13 Revert "GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY" This reverts commit 8d7f4cc986778bfff0b242dbea6083346da6c54d. Reason for revert: Broke CrOS build. Original change's description: > GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY > > Bug: angleproject:3020 > Change-Id: If60448f80daaeeb1503b41db8ac309e45923fd13 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135929 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3020 Change-Id: I0930c1bdb5356d533fae563428893aa8a9f91a52 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123266 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Geoff Lang 8d7f4cc9 2020-04-03T14:56:36 GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY Bug: angleproject:3020 Change-Id: If60448f80daaeeb1503b41db8ac309e45923fd13 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135929 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang fc09350a 2021-08-18T12:24:39 GL: Update VertexArrayGL to use ANGLE_GL_TRY. Bug: angleproject:3020 Change-Id: If3409d0d4bc9fdc5c990cece92461e2526c752c9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1809058 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 222a81cf 2021-06-11T14:34:52 Reland: GL: Skip redundant flushes. Skip flushes when there is no work submitted since the last flush. Bug: chromium:1181068 Change-Id: Iab31f8949f7eb07dffb7b0930069cbb3ca69ef57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2956453 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Kenneth Russell 565bba3d 2021-05-26T17:58:18 Revert "GL: Skip redundant flushes." This reverts commit 7a38f3f50f3bb2f747ad3731d307f6af4c0552d2. Reason for revert: caused numerous test failures on FYI waterfall per http://crbug.com/1213507 . Original change's description: > GL: Skip redundant flushes. > > Skip flushes when there is no work submitted since the last > flush. > > Clone of geofflang's: > https://chromium-review.googlesource.com/2911879 > > Bug: chromium:1181068 > Change-Id: Idd8a1c61b814d746bf1e0225cfc4ca375a7bb224 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2915675 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1181068 Bug: chromium:1213507 No-Try: True Change-Id: Icd1662e4ea541375b44bddaa839a5241cdad5302 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2919503 Commit-Queue: Kenneth Russell <kbr@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 7a38f3f5 2021-05-21T15:07:44 GL: Skip redundant flushes. Skip flushes when there is no work submitted since the last flush. Clone of geofflang's: https://chromium-review.googlesource.com/2911879 Bug: chromium:1181068 Change-Id: Idd8a1c61b814d746bf1e0225cfc4ca375a7bb224 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2915675 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Peng Huang be2f7b1c 2021-04-20T13:54:47 Unbind fbo before context switching for PowerVR GPUs Imagination GL drivers are buggy with context switching. We need to ubind fbo to workaround a crash in the driver. Bug: chromium:1187513 Change-Id: Ie5142b5f43a3f23a9743ba7af0d90567fedd00d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841083 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Geoff Lang 18c6d628 2021-03-09T13:46:13 GL: Support VAOs without native VAOs. Share the default VAO state between all frontend VAO when there is no native VAO support. Forcefully sync state every time a new frontend VAO is bound. Bug: angleproject:5577, chromium:1167179 Change-Id: Ieaedb5108ad28fc78e7e58b74495639c5246bb05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665266 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shrek Shao 2b55f876 2021-01-29T18:02:21 Reland "Workaround for Mac Intel drawArraysInstanced with first > 0" This is a reland of 027bc47ca5b7b291fbda907173eefa05ad3d45a8 Original change's description: > Workaround for Mac Intel drawArraysInstanced with first > 0 > > Workaround by forcefully set instanced arrays (divisor > 0) > as streaming attributes and apply extra offset at front. Recover > those attribute bindings when first == 0 and other draw calls > (drawElementsInstanced) > > Bug: chromium:1144207, chromium:1144247, chromium:1144373 > Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095 > Commit-Queue: Shrek Shao <shrekshao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1144207 Bug: chromium:1144247 Bug: chromium:1144373 Bug: angleproject:5271 Change-Id: Id0b818b25a605376c98c2366c1f2029e2490c6cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704799 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 95584459 2021-02-18T09:32:16 Revert "Workaround for Mac Intel drawArraysInstanced with first > 0" This reverts commit 027bc47ca5b7b291fbda907173eefa05ad3d45a8. Reason for revert: InstancingTests fail on Mac FYI Release (Intel UHD 630), see https://ci.chromium.org/ui/p/chromium/builders/ci/Mac%20FYI%20Release%20(Intel%20UHD%20630)/1729/overview Original change's description: > Workaround for Mac Intel drawArraysInstanced with first > 0 > > Workaround by forcefully set instanced arrays (divisor > 0) > as streaming attributes and apply extra offset at front. Recover > those attribute bindings when first == 0 and other draw calls > (drawElementsInstanced) > > Bug: chromium:1144207, chromium:1144247, chromium:1144373 > Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095 > Commit-Queue: Shrek Shao <shrekshao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1144207 Bug: chromium:1144247 Bug: chromium:1144373 Change-Id: Ia4a6026a8c446490346b373c33fe2b1724c1761f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704052 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Shrek Shao 027bc47c 2021-01-29T18:02:21 Workaround for Mac Intel drawArraysInstanced with first > 0 Workaround by forcefully set instanced arrays (divisor > 0) as streaming attributes and apply extra offset at front. Recover those attribute bindings when first == 0 and other draw calls (drawElementsInstanced) Bug: chromium:1144207, chromium:1144247, chromium:1144373 Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 4968f6f2 2021-02-04T16:40:36 Move getRendererDescription from ContextImpl to DisplayImpl The other backend description strings are in DisplayImpl. This will help with caching the result of glGetString in the GL backend. Also Update the getters to not be const in order to allow caching. Bug: chromium:1173672 Change-Id: I43df35688762b23429f47f169c04482cf4cd089a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2676881 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis 0be050a4 2020-09-23T15:12:56 Pass GL_VERSION info through ANGLE's GL_RENDERER string Chrome needs ANGLE to pass through the underlying driver vendor and version, which cannot always be determined by the SystemInfo library. This is done by construction GL_RENDERER in the frontend through combining GL_VENDOR, GL_RENDERER, and GL_VERSION from the backends. Example changes are in the doc: https://docs.google.com/document/d/1p0dvrLlu8NKhO-RCU5gqlQ_LvcQj-ZqhvfwSk1n3Sz8/edit?usp=sharing Bug: chromium:1126526 Bug: chromium:1131248 Bug: chromium:1134669 Bug: chromium:1169861 Change-Id: Ia618ebcd7f3caaeb376b4b6a03446732efdaeecb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2427383 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang ea0f3496 2021-01-25T12:47:27 GL: Update VertexArrayGL to not store per-context state. Move StateManagerGL and FunctionsGL members out of VertexArrayGL and query them directly from the context in methods. Bug: angleproject:5577, chromium:1167179 Change-Id: I376f3eff15fbd9855c5956737064f56d54acbceb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2647868 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang a12072ca 2020-04-03T12:18:42 GL: Use ANGLE_GL_TRY for draw calls. Bug: angleproject:3020 Change-Id: Id3ff1828a9a63f4efe6e85dc938a22dc6a782a88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135926 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6d3d381e 2019-08-23T16:45:05 GL: Update BufferGL to use ANGLE_GL_TRY. Refactor the check for keeping shadow data into a feature so it's only initialized once. Bug: angleproject:3020 Change-Id: I45575c246afa7cd54e3a07d7a8464f4d4f45b3be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769064 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 96a49a48 2020-10-06T13:34:09 GLX, EGL: Support NV_robustness_video_memory_purge Chrome is showing rendering issues on Linux/Nvidia after returning from the lock screen. This could be related to the fact that Nvidia drivers are not able to guarantee conformance after certain events. By exposing this extension, we can instruct Chrome to reinitialize contexts after they are purged by the driver. If this is not explicitly requested, we can still generate an UnknownContextReset to tell apps to discard the invalid context anyway. Bug: chromium:1113040 Change-Id: Ie99b6356cc27fea33643d61b1d74f4f68a271d70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2453689 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
shrekshao 796df76c 2020-06-25T11:49:12 MultiDraw Refactor Refactor MultiDraw* from general Context to different ContextImpl. Move general multiDraw code to renderer_utils.cpp. Bug: angleproject:3402 Change-Id: I85cb4b781afa2b3a8beb382a9c735910057f2ebe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2268580 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 8cae5e19 2020-04-08T12:28:03 GL: Re-enable emulatePrimitiveRestartFixedIndex This workaround is needed when the GL driver is less than 4.3 (all MacOS). The driver will generate many errors during execution without this enabled which blocks GL driver error checking. Add additional workarounds for Intel drivers that need a sufficiently large primitive restart index when doing DrawArrays calls. BUG=angleproject:3997 Change-Id: Idd293ff1dbc0a3609b11ea1d6b30da0a99e8f5c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2141714 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Tim Van Patten 7e0699a2 2020-02-05T17:04:06 Create the ProgramExecutable Class The ProgramExecutable class is being created to collect data structures that are common to both Programs and ProgramPipelines, as well as any shared functions. This allows callers to request the current ProgramExecutable from the State and make Program-/ProgramPipeline-specific queries without needing to know exactly which responded. This will also allow the necessary data structures to only be populated and stored within the ProgramExecutable when necessary and reused as often as necessary. Bug: angleproject:3570 Change-Id: I101f08ab03421894667b4a426a04d2147489f0e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040512 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 07467b4a 2020-03-20T10:40:56 Remove GL_CHROMIUM_path_rendering Bug: chromium:1063193 Bug: angleproject:4270 Change-Id: I35b24b7d8d892181955e49dd2495655bc57cb0df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112275 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9f4ab98d 2020-02-13T12:49:05 Return angle::Result from more label functions. This is necessary for the new Vulkan implementation. Bug: angleproject:4029 Change-Id: I07ef54145252ff102c74179361436587bb330fc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2055553 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9681190d 2020-02-05T12:51:25 Make Debug marker functions return angle::Result. Allows error handling in these functions. Necessary for the Vulkan back-end. Bug: angleproject:4209 Change-Id: I2092e58e719c6ee562807e1c7e8ad26988342855 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040196 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kenneth Russell 7a37d3ac 2020-01-05T13:52:03 Work around Intel driver bug with CopyTex{Sub}Image2D/DeleteTextures. Dependencies seem to be incorrectly tracked in some Intel OpenGL drivers (on macOS specifically), causing crashes in glDeleteTextures if a GL command buffer is being constructed where those textures are destinations of CopyTexImage2D/CopyTexSubImage2D. Work around this bug by flushing before texture deletion if CopyTex{Sub}Image have been called recently. The tracking is only done on a per-context rather than a per-device basis, but seems sufficient to work around the problem as identified. Tested both with new ANGLE test on affected hardware, and in WebKit's ANGLE backend for WebGL. Works around the crash reported in https://bugs.webkit.org/show_bug.cgi?id=205707 . Bug: angleproject:4267 Change-Id: I2266a5590759f6a3f19080def08710ef4b66d463 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987932 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Ethan Lee a825eb70 2019-11-21T11:37:17 Implement BaseVertex draw calls for Vulkan, OpenGL, NULL contexts. This adds support for the following functions: - glDrawElementsBaseVertex - glDrawRangeElementsBaseVertex - glDrawElementsInstancedBaseVertex Bug: angleproject:3582 Bug: angleproject:3402 Bug: angleproject:4166 Change-Id: I83770f62e3a918c0965fd4ca8c7d9e598b8b4154 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929083 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 3a8b8908 2019-10-23T13:26:13 GL: Follow-up primitive restart emulation fixes. - Use the existing utility function for computing the primitive restart index. - Fix bad merge that removed the unfoldShortCircuits feature. BUG=1017337 BUG=angleproject:3997 Change-Id: I4ba5ada9816731bdd29a0e518ce225bdd69a762e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1876453 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0b779a7c 2019-10-10T14:54:09 GL: Emulate primitive restart when PRIMITIVE_RESTART_FIXED_INDEX is unavailable. PRIMITIVE_RESTART_FIXED_INDEX isn't available until desktop GL 4.3. When it is not available, emulate it by enabling PRIMITIVE_RESTART and set the primitive restart index before each draw call based on the index type. TEST=deqp/functional/gles3/primitiverestart/* BUG=angleproject:3997 Change-Id: Id736f1056cb07da91c6d592693406333142e6265 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1853885 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang 74f28333 2019-08-23T16:16:19 GL: Update RenderbufferGL to use ANGLE_GL_TRY. BUG=angleproject:3020 Change-Id: I9e16b651c5845412dd58b87474490fd92f69223b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769063 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 70d79b76 2019-09-11T11:43:55 GL: Add state validation functions to GL backend These functions validate that the driver's reported state matches ANGLE's internal state. Can be useful for debugging Bug: angleproject:3900 Change-Id: I35d15e991986dcab114939c551a88549f09bd263 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1797254 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao b5560486 2019-08-30T17:09:04 BaseInstance VertexAttribDivisor fix Add tests not using gl_InstanceID/gl_BaseInstance but set vertexAttribDivisor which implicitly reference base instance value. Add fixes and workarounds based on this change. Bug: chromium:891861, angleproject:3402 Change-Id: I2d93c181029f4ca1741f244363568096964d6b19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1779350 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 050b124d 2019-06-30T03:26:18 Reland "Vulkan: Debug overlay" This is a reland of e54d0f90d1a165404236fd7abd1b05ddd041a686 This was reverted due to a build failure as a result of a missing virtual destructor in the widget base class. Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3757 Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez fc58af47 2019-09-02T07:46:44 Revert "Vulkan: Debug overlay" This reverts commit e54d0f90d1a165404236fd7abd1b05ddd041a686. Reason for revert: causes compile failure on Linux CFI bot. Sample build: https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI/14810 Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903575125463586160/+/steps/compile/0/stdout?format=raw Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jmadill@chromium.org Bug: angleproject:3757 Change-Id: Ib08e2e7b1a9449ca097673acb11655df5d2bbf31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778862 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shahbaz Youssefi e54d0f90 2019-06-30T03:26:18 Vulkan: Debug overlay A debug overlay system for the Vulkan backend designed with efficiency and runtime configurability in mind. Overlay widgets are of two fundamental types: - Text widgets: A single line of text with small, medium or large font. - Graph widgets: A bar graph of data. Built on these, various overlay widget types are defined that gather statistics. Five such types are defined with one widget per type as example: - Count: A widget that counts something. VulkanValidationMessageCount is an overlay widget of this type that shows the number of validation messages received from the validation layers. - Text: A generic text. VulkanLastValidationMessage is an overlay widget of this type that shows the last validation message. - PerSecond: A value that gets reset every second automatically. FPS is an overlay widget of this type that simply gets incremented on every swap(). - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an overlay of this type. On every vkQueueSubmit, the number of nodes in the command graph is accumulated. On every present(), the value is taken as the number of nodes for the whole duration of the frame. - RunningHistogram: A histogram of last N values. Input values are in the [0, 1] range and they are ranked to N buckets for histogram calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay widget of this type. On vkQueueSubmit, the memory waste from command buffer pool allocations is recorded in the histogram. Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py processes to create an array of bits, which is processed at runtime to create the actual font image (an image with 3 layers). The overlay widget layout is defined in overlay_widgets.json which gen_overlay_widgets.py processes to generate an array of widgetss, each of its respective type, and sets their properties, such as color and bounding box. The json file allows widgets to align against other widgets as well as against the framebuffer edges. Two compute shaders are implemented to efficiently render the UI: - OverlayCull: This shader creates a bitset of Text and Graph widgets whose bounding boxes intersect a corresponding subgroup processed by OverlayDraw. This is done only when the enabled overlay widgets are changed (a feature that is not yet implemented) or the surface is resized. - OverlayDraw: Using the bitsets generated by OverlayCull, values that are uniform for each workgroup (set to be equal to hardware subgroup size), this shader loops over enabled widgets that can possibly intersect the pixel being processed and renders and blends in texts and graphs. This is done once per frame on present(). Currently, to enable overlay widgets an environment variable is used. For example: $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste $ ./hello_triangle --use-angle=vulkan Possible future work: - On Android, add settings in developer options and enable widgets based on those. - Spawn a small server in ANGLE and write an application that sends enable/disable commands remotely. - Implement overlay for other backends. Bug: angleproject:3757 Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao cd31f286 2019-06-25T14:22:41 Implement Draw base vertex and base instance functions This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Workaround for OpenGL driver on Mac: gl_VertexID on Mac with AMD GPU doesn't include baseVertex value. So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any. Workaround for Vulkan GLSL: gl_InstanceIndex on Vulkan includes baseInstance. So replace gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when angle_BaseInstance is declared. Bug: chromium:891861, angleproject:3402 Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao cdecd97c 2019-06-25T14:22:41 Add Draw base vertex and base instance function entrypoints Split from https://chromium-review.googlesource.com/c/angle/angle/+/1705035/27 This patch adds entrypoints glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Implementation will come in a later separate patch. Bug: chromium:891861, angleproject:3402 Change-Id: I18e19b850cddd79be4798b9ae7efe0680a050c7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750125 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang b3eeb2a4 2019-08-05T17:02:43 Emulate RGB textures using BGRX IOSurfaces. When the user requests an IOSurface Pbuffer with an RGB format, emulate the missing alpha channel by clearing it to 1.0 and masking reads and writes in shaders. BUG=angleproject:3766 Change-Id: I58c992bf641d9ece0f923603f32640615150e4f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1737437 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang 8b2dfa0f 2019-07-04T16:22:05 GL: Implement EXT_external_objects This allows the GL backend to import Vulkan resources. BUG=angleproject:3656 Change-Id: Ie5e55ce3e1ba05e917619e3f192c13dcc36c3739 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688507 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Clemen Deng <clemendeng@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 3fe8c3a3 2019-07-04T15:49:54 Refactor the wait/signalSemaphore entry points to be on the Semaphore object Convert the texture ID parameters into optimized vectors of Texture objects. BUG=angleproject:3656 Change-Id: Iffe824ade2a919c9771642ae501ff04712ca43ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688505 Reviewed-by: Michael Spang <spang@chromium.org>
Geoff Lang 857880e5 2019-05-27T13:39:15 GL: Add extensions to enable hardware video decode on Android. The Android SurfaceTexture API has to be initialized with a texture id which Chrome has to query from an ANGLE external texture. It also rebinds and sets the texture dimensions on calls to SurfaceTexture.updateTexImage so ANGLE must be notified about these changes so that state tracking and validation continue to function. BUG=967410 Change-Id: I92e9077f75835b088da3a8caffb3ff40e9ad0361 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1630293 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis beb0eb2d 2019-06-14T15:10:33 Clean up workarounds/features to single location. Rename all workarounds structs to features, and move the lists to a shared location in include/platform (to help with documentation, see: https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?sq=package:chromium&g=0&l=69) Bug: angleproject:1621 Change-Id: I4069f08131db5e886047a007efb5d7764dfee5f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660952 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 78a51911 2019-06-12T14:28:14 Clean up and expose frontend features to egl. gl::Workarounds was used to hold frontend features. Change ownership of this struct from Context to Display, so it can be exposed to egl. Also rename to features and clean up for consistency. Bug: angleproject:1621 Change-Id: I82e98e53873abb7a402c93e60f8a662a7263e0d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1655772 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Michael Spang ab6a59b2 2019-05-21T21:26:26 Vulkan: Submit semaphores from glWaitSemaphoreEXT & glSignalSemaphoreEXT Implement submission of client semaphores passed to glWaitSemaphoreEXT & glSignalSemaphoreEXT. This also relaxes the expectation that we will not flush() if there are no commands. Signaling semaphores in particular requires queue submission irrespective of whether there are any command buffers to submit. If there are neither commands nor semaphores, we can still skip queue submission. WebGL runs in Chrome with ANGLE & Vulkan interop as of this patch, albeit with incorrect synchronization due to texture barriers not being implemented yet. Quite a few flags are needed to try this: GN args: angle_vulkan_conformant_configs_only=true chrome \ --enable-features=UseSkiaRenderer,UiGpuRasterization \ --enable-gpu-rasterization \ --enable-oop-rasterization \ --enable-vulkan \ --use-gl=angle \ --use-angle=vulkan Bug: angleproject:3289 Change-Id: I3d49c230a2fbf0cd2a2b943b05ded0e4604cc313 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1623815 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Michael Spang 5093ba67 2019-05-14T17:36:36 Implement resource management for GL_EXT_semaphore This implements glGenSemaphoresEXT, glDeleteSemaphoresEXT, and glIsSemaphoreEXT. It's not possible to do anything useful with them yet. Bug: angleproject:3289 Change-Id: I20ad90dbcd3fc573a4650c8531d6e1b8ccf7ca9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1623811 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao 15ce8227 2019-03-18T19:25:21 Fix error report when active color buffer has no fs output Also modify or remove some tests to sync up with the expected behavior stated in spec. Related to https://github.com/KhronosGroup/WebGL/pull/2780 If any draw buffer with an attachment does not have a defined fragment shader output, draws generate INVALID_OPERATION. Also remove Framebuffer masking for inactive outputs. This workaround is no longer necessary as the WebGL spec has changed. It also was never fully working and had bugs with certain orders of calls. Bug: angleproject:2872 Bug: chromium:927908 Bug: chromium:943538 Change-Id: I73715a6ab851ae3db7096f49ea0a9fdd6f576703 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1530018 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang 057b76e1 2019-04-12T14:48:59 Implement GL_CHROMIUM_lose_context. This is useful for testing context lost behaviour. BUG=angleproject:3379 Change-Id: If0e1538553b1761e313fc36ccde5138cd495200f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1566141 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Michael Spang fb201c5e 2019-04-03T14:57:35 Implement resource management for GL_EXT_memory_object This implements glCreateMemoryObjectsEXT, glDeleteMemoryObjectsEXT, and glIsMemoryObjectEXT. It's not possible to do anything useful with them yet. Bug: angleproject:3289 Change-Id: I8882b657e9de564b5f97f8dea87838f67b1928f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552025 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 7d53c60b 2019-02-15T21:06:42 ParallelCompile: use the native extensions This enhances to use the native parallel compile extensions if available. Bug: 873724 Change-Id: I0aaed314accd75e1bfa596b322225b56d729d3a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1475234 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 4d153383 2019-02-26T15:08:11 Reland "Vulkan: Implement debug markers" This reverts commit 0c01e36783b20a0177c653490cb4f8ea4a896075. Reason for revert: Its dependency that was reverted has now relanded: https://chromium-review.googlesource.com/c/angle/angle/+/1489153 Original change's description: > Revert "Vulkan: Implement debug markers" > > This reverts commit 983e446921946734fe47217c345a8fe2f079319d. > > Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605 > > Original change's description: > > Vulkan: Implement debug markers > > > > Covers both GL_KHR_debug and GL_EXT_debug_marker. > > > > Debug markers are used to specify events or hierarchically categorize a > > set of commands within the command buffer. When debugging, this allows > > for quicker navigation to the draw calls of interest, and otherwise > > provides context to debug output. > > > > Bug: angleproject:2853 > > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 > > Reviewed-on: https://chromium-review.googlesource.com/c/1403956 > > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org > > Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: angleproject:2853 > Reviewed-on: https://chromium-review.googlesource.com/c/1470606 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> TBR=geofflang@chromium.org,jmadill@google.com,syoussefi@chromium.org Bug: angleproject:2853 Change-Id: Ie19ae103244d54dcf7108d5f61c24e318fc44057 Reviewed-on: https://chromium-review.googlesource.com/c/1489154 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@google.com>
Shahbaz Youssefi 0c01e367 2019-02-13T21:27:23 Revert "Vulkan: Implement debug markers" This reverts commit 983e446921946734fe47217c345a8fe2f079319d. Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605 Original change's description: > Vulkan: Implement debug markers > > Covers both GL_KHR_debug and GL_EXT_debug_marker. > > Debug markers are used to specify events or hierarchically categorize a > set of commands within the command buffer. When debugging, this allows > for quicker navigation to the draw calls of interest, and otherwise > provides context to debug output. > > Bug: angleproject:2853 > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 > Reviewed-on: https://chromium-review.googlesource.com/c/1403956 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2853 Reviewed-on: https://chromium-review.googlesource.com/c/1470606 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 983e4469 2019-01-18T16:04:50 Vulkan: Implement debug markers Covers both GL_KHR_debug and GL_EXT_debug_marker. Debug markers are used to specify events or hierarchically categorize a set of commands within the command buffer. When debugging, this allows for quicker navigation to the draw calls of interest, and otherwise provides context to debug output. Bug: angleproject:2853 Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 Reviewed-on: https://chromium-review.googlesource.com/c/1403956 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
jchen10 a100d8f4 2018-12-29T16:39:55 ParallelCompile: add GL backend support For GL backend, at first each worker thread must have a naitve context for its own to work in. These worker contexts have to be shared from the main context, so that all shader and program objects are seen in any context. This extends backend displays to create and destroy the worker contexts. RendererGL manages and allocates them to the worker threads. ShaderImpl has a new compile method added to do the actual glCompile work in worker thread. The ProgramGL's link method is broken down by introducing the LinkEventGL class. Bug: chromium:849576 Change-Id: Idc2c51b4b6c978781ae77810e62c480acc67ebb5 Reviewed-on: https://chromium-review.googlesource.com/c/1373015 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0c667215 2019-01-01T14:40:36 Pass ErrorSet to ContextImpl constructor. This removes the need for the setErrorSet method. Also update some egl::Error TODO bugs. Bug: angleproject:2491 Change-Id: I0aba07c4a53b579835a88c3dacae294f752e6b17 Reviewed-on: https://chromium-review.googlesource.com/c/1392393 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c3dc5d48 2018-12-30T12:12:04 Merge gl::Context and gl::ContextState. This reduces the number of indrections when accessing the Extensions or Caps structures. It will provide a small speed-up to some methods. It also cleans up the code. Bug: angleproject:2966 Change-Id: Idddac70758c42c1c2b75c885d0cacc8a5c458685 Reviewed-on: https://chromium-review.googlesource.com/c/1392391 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
Markus Tavenrath cb9609fe 2018-12-26T00:52:44 Optimize glDrawElements performance A call to glDrawElements results in a calling depth of up to 4 * glDrawElements * gl::Context::DrawElements * rx::ContextGL::DrawElements * VertexArrayGL::syncDrawState. Each function call has to save/restore a lot of registers which results in a stall in the prologue of rx::ContextGL::DrawElements due to memory bandwidth limitations. The main change is the function gl::Context::DrawElements being inlined to reduce the calling depth by one. In addition the call to ContextGL::syncDrawElementsState is now protected so that it gets called only if it's required. Finally a few small getter functions have been inlined where the calling code was bigger than the actual function. In total this change improves performance of the DrawElementsPerfBenchmark.Run/gl benchmark by 16%. Bug: angleproject:2966 Change-Id: I423d18452f2f5b520ab52850fda2054e1da86991 Reviewed-on: https://chromium-review.googlesource.com/c/1389988 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Markus Tavenrath <matavenrath@nvidia.com>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 617103ed 2018-11-22T13:18:05 GL: Implement GL_NV_fence on top of GLsync objects. When ANGLE exposes an ES2 context, there is often no way to create fence objects because GL_NV_fence is not available. BUG=882580 Change-Id: Ic18539e0243317a188545f3945f6b33d3401f1a8 Reviewed-on: https://chromium-review.googlesource.com/c/1348769 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill c1fd7376 2018-10-26T22:48:39 Move index range calculations into VertexArray. This is in preparation for removing the entire DrawCallParams struct. This struct was big enough to cause a performance hit on draw call perf tests just by virtue of initializing the fields. Also dereferencing the struct members is slower than reading function parameters since it adds an indirection. Also includes some error refactoring to enable moving code to a shared location. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ib663f2538c14ac30d4c31fd10d6350be469626e2 Reviewed-on: https://chromium-review.googlesource.com/c/1298380 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5a206950 2018-10-22T09:58:25 GL: Move draw functions from Renderer to Context. This avoids one more function call + register pushing/popping. Slight improvement in the command_buffer_perftests. Bug: angleproject:2877 Change-Id: Ia50a330e62f0bd32266c9f0999810243cbaa41e0 Reviewed-on: https://chromium-review.googlesource.com/c/1293630 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 32643cea 2018-10-19T11:38:03 Use angle::Result in front-end (Part 2) Handles the gl::Context class and its implementation. Bug: angleproject:2491 Change-Id: I7b7eb0897d131a194f6b563b7e01756fd7adb7e1 Reviewed-on: https://chromium-review.googlesource.com/c/1280742 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9d0bb3d4 2018-10-09T20:29:13 Pass bit mask to ContextImpl::syncState. This can be used to mask out inappropriate local dirty bits. Bug: angleproject:2763 Change-Id: Ie46e464df0dc719c963ff9f7066d42eb5a028262 Reviewed-on: https://chromium-review.googlesource.com/c/1264062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com>
Jamie Madill 6f755b21 2018-10-09T12:48:54 Use angle::Result in front-end. (Part 1) This covers most of the hot paths used in draw calls. Gives in the order of a 5% reduction in draw call overhead. Bug: angleproject:2491 Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa Reviewed-on: https://chromium-review.googlesource.com/c/1258149 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e39e8f46 2018-10-05T08:17:38 GL back-end error refactor. Adds explicit error handling to a few scoped state handler classes. Otherwise mostly mechanical refactoring. Bug: angleproject:2753 Change-Id: I2bf969a68f45880902b6e7902297c1340a76a1c4 Reviewed-on: https://chromium-review.googlesource.com/c/1255647 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
jchen10 3fd614d0 2018-08-13T12:21:58 Refactor Context dependency for resolveCompile The context parameter of Shader::resolveCompile method causes a bad impact that many methods in Shader, Program etc. have to have a same context parameter. By removing it, these methods can be decoupled from Context. BUG=chromium:849576 Change-Id: Ia5545ee9dce45794550f6086bc0e6c4707e1276e Reviewed-on: https://chromium-review.googlesource.com/1172202 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 5396f2a6 2018-07-12T08:24:23 Return Error from onMakeCurrent - Preliminary change for gl_PointCoords fix for Vulkan. Bug: angleproject:2673 Change-Id: Ie43e8aeccf75a8daa4a137b98292d848522ea2f0 Reviewed-on: https://chromium-review.googlesource.com/1134877 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill 189ad877 2018-07-09T13:32:37 Return an Error from ContextImpl::syncState. This will allow the Vulkan back-end to call Vulkan commands that return VkResult within syncState. Bug: angleproject:2717 Change-Id: I05e1379e71acaac56bcc9493c8561e82da000934 Reviewed-on: https://chromium-review.googlesource.com/1120150 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Geoff Lang 5da6690f 2018-06-05T12:24:06 Hold RendererGL objects with a shared_ptr. To support both virtualized and unvirtualized contexts, the RendererGL object represents the native context. Update ContexGL and the various DisplayGLs to hold RendererGL with a shared_ptr so that deletion of the renderer happens at the correct time. Update RendererGL to take ownership of FunctionsGL. BUG=angleproject:2464 Change-Id: Id040a8053973d73936c0a7ff0ab5edb1a3f16dc6 Reviewed-on: https://chromium-review.googlesource.com/1085851 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jiawei Shao d0a7d10f 2018-05-07T12:40:20 ES3.1: Set unordered access view related resource limits on D3D11 This patch sets the implementation-dependent resources limits related to unordered access views (images, shader storage blocks, atomic counter buffers and fragment shader outputs) on D3D11 back-ends. For pixel shaders, the render targets and unordered access views share the same resource slots when being written out, so we plan to allocate these slots as follows: - As there are 8 slots for UAVs and RTVs in feature level 11_0, currently we assign 1 slot for atomic counter buffer and 7 slots that are shared among images, shader storage blocks and fragment shader outputs. - As there are 64 slots for UAVs and RTVs in feature level 11_1, currently we assign 4 slots for atomic counter buffers and 60 slots that are shared among images, shader storage blocks and fragment shader outputs. We also limit the maximum number of draw buffers to 7 if we create ES 3.1 context on D3D11 feature level is 11_0 because the value of combined shader output resources is 7. This patch also labels several dEQP cases from "FAIL" to "SKIP" because since the resource limits on ssbos, atomic counter buffers and images in rendering pipeline are set in D3D11 back-ends, the GLSL programs in these cases can pass all the related link checks, thus these cases will crash due to reaching the unimplemented parts when they are running on ANGLE D3D11 back-ends. BUG=angleproject:2345 TEST=dEQP-GLES31.functional.state_query.integer.max_compute_atomic_counter_buffers_* dEQP-GLES31.functional.state_query.integer.max_compute_shader_storage_blocks_* dEQP-GLES31.functional.state_query.integer.max_atomic_counter_buffer_bindings_* dEQP-GLES31.functional.state_query.integer.max_combined_atomic_counter_buffers_* dEQP-GLES31.functional.state_query.integer.max_image_units_* dEQP-GLES31.functional.state_query.integer.max_combined_image_uniforms_* dEQP-GLES31.functional.state_query.integer.max_shader_storage_buffer_bindings_* dEQP-GLES31.functional.state_query.integer.max_combined_shader_storage_blocks_* dEQP-GLES31.functional.state_query.integer.max_combined_shader_output_resources_* Change-Id: I56a4e6c60d4f6f5bd6f238ae8ce425fb5072a4a3 Reviewed-on: https://chromium-review.googlesource.com/1046372 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 493f9571 2018-05-24T19:52:15 Add PrimitiveMode packed GLenum. Bug: angleproject:2574 Change-Id: I3d7bd7ca0d69a364a611dc04799ea34906fc4a6c Reviewed-on: https://chromium-review.googlesource.com/1067114 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 422f2ce2 2018-05-10T13:54:54 GL: Refactor ShaderGL to not hold renderer objects. BUG=angleproject:2464 Change-Id: I243c010e30d62e233411b1dab1d13a69b44e4b38 Reviewed-on: https://chromium-review.googlesource.com/1054214 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2cb7f974 2018-05-07T13:49:13 GL: Refactor TextureGL to not hold renderer objects. BUG=angleproject:2464 Change-Id: I24b07557d90988369bc8b7e4b2fe3a500ab7bc36 Reviewed-on: https://chromium-review.googlesource.com/1048115 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6110763f 2018-05-09T11:32:46 Refactor the GL surfaces and framebuffers to not hold renderer objects. BUG=angleproject:2464 Change-Id: I20aabeef3de6cf1fc13a29b6220e040aa83184d7 Reviewed-on: https://chromium-review.googlesource.com/1039986 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Corentin Wallez ad3ae90a 2018-03-09T13:40:42 Use packed enums for QueryType. BUG=angleproject:2169 Change-Id: I129a9d8e295859daa071a298dab9fe1895315cc0 Reviewed-on: https://chromium-review.googlesource.com/957318 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 3cd48fff 2017-10-03T15:37:16 Implement robust resource initialization for OpenGL. BUG=angleproject:2107 BUG=angleproject:2407 BUG=angleproject:2408 BUG=693090 Change-Id: I6444f80f9703d6341f2ec67518050adc88f71d96 Reviewed-on: https://chromium-review.googlesource.com/678482 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e703c606 2018-02-20T10:21:48 Add gl::RenderbufferState shared state helper. This shared state will be read-only visible in the RenderbufferImpl class. It mirrors existing structs for Textures, Buffers, and other classes. It allows the implementation class to have a read-only view as to the current GL state of an object. This will be useful to the Vulkan back-end, which would like to know the current Renderbuffer state before having to redefine the storage. If the current parameters match, it might not have to redefine the storage at all. The solution involves passing around the gl::RenderbufferState through various factory methods. Also name the Renderbuffer implementation pointer consistently and make it use std::unique_ptr. Bug: angleproject:2347 Change-Id: Ied6e0358e24e74a7fedbe4aea692edee909b5838 Reviewed-on: https://chromium-review.googlesource.com/922457 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia 62fcf62a 2017-11-30T16:16:12 ES31: Add DispatchComputeIndirect suport for OpenGL backend BUG=angleproject:2270 TEST=dEQP-GLES31.functional.compute.indirect_dispatch.* Change-Id: Id062a80188b2a37f28833aaae8e6d31bac382276 Reviewed-on: https://chromium-review.googlesource.com/802763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 89c422ad 2017-11-29T18:24:20 ES31: Support memoryBarrier and memoryBarrierRegion APIs BUG=angleproject:2280 TEST=dEQP-GLES31.functional.compute.basic.image_barrier_single dEQP-GLES31.functional.compute.basic.image_barrier_multiple dEQP-GLES31.functional.compute.basic.ssbo_cmd_barrier_single dEQP-GLES31.functional.compute.basic.ssbo_cmd_barrier_multiple dEQP-GLES31.functional.synchronization.* Change-Id: If14debab21247dc4b446e86d1642fbc9376b6dd7 Reviewed-on: https://chromium-review.googlesource.com/798803 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill afa02a2f 2017-11-23T12:57:38 ContextImpl: Make flush/finish take a gl::Context. This will more easily allow us to call gl::BindingPointer methods. The binding pointer will be used temporarily in the command graph. This is only temporary since we will likely not be using BindingPointer in the end result code, but it could be necessary for future work. Bug: angleproject:2264 Change-Id: I33cf40ec2a1e334c4abfdcff2ad20bbcda3c9d78 Reviewed-on: https://chromium-review.googlesource.com/789532 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5d5253a3 2017-11-22T14:51:12 Clean up usage of EXT_debug_marker and KHR_debug in the backends. In RendererGL, the EXT_debug_marker functions were calling the KHR_debug entry points, now they fall back only when EXT_debug_marker is missing. Separated the ContextImpl methods for the two extensions. BUG=781164 Change-Id: I615b5965b705e55eb730ebefa6e27e0ee6d86c31 Reviewed-on: https://chromium-review.googlesource.com/786337 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yunchao He a336b90f 2017-08-02T16:05:21 ES31: Impl program pipeline object management entries for GL backend. The program pipeline object management entries are: GenProgramPipelines DeleteProgramPipelines BindProgramPipeline IsProgramPipeline BUG:angleproject:2123 Change-Id: I114d054b90caf2ee3f9befef7439552a1c309bc4 Reviewed-on: https://chromium-review.googlesource.com/629978 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 71c88b31 2017-09-14T22:20:29 Enable [[nodiscard]] for gl::Error. This forces all return values to be checked for gl::Error. Requires quite a bit of minor refactoring. I also added a macro to swallow an error without returning from a function. We could look at storing the errors in the Context at some point, since almost always when we're generating errors that we need to discard we have access to the Context as a parameter. BUG=angleproject:2150 Change-Id: I457e48a30c002eda0993acbcd3180ba87bf169fb Reviewed-on: https://chromium-review.googlesource.com/665173 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 06ef36b9 2017-09-09T23:32:46 Add top-level state sync for Samplers. This also reformats the Sampler class to use a shared state struct with the implementation. It removes the call to sync the sampler state from the StateManagerGL::setGenericShaderState method, since it should all be handled at the front-end now. Also rename 'syncImplState' to 'syncState' methods. BUG=angleproject:1387 Change-Id: I5f0219b719aee99aaaa486ec188b2af0c9128e6a Reviewed-on: https://chromium-review.googlesource.com/648054 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 70b5bb00 2017-08-28T13:32:37 Rename gl::FenceSync to gl::Sync. The spec refers to Sync objects, FenceSyncs being a subtype. The motivation for this fix is to clear up the FenceSync_ entry point for auto-generation. BUG=angleproject:1309 Change-Id: I94c440476d701628575e7a3eea68b6dd110f41c3 Reviewed-on: https://chromium-review.googlesource.com/636516 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 5e424fae 2017-08-09T16:25:36 Handle Clear* commands for layered framebuffers The patch adds support for clearing the layers of 2D array textures attached to a multi-view framebuffer. According to the ANGLE_multiview spec, the layers which are outside of the range [baseViewIndex; baseViewIndex + numViews) should remain unmodified. Because the native Clear* commands clear all of the layers, a workaround is implemented which creates a FBO, attaches a single layer from all multi-view attachments and clears the contents. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ibf711d02046233eed16bdd3f9c96fc38f82ed0a8 Reviewed-on: https://chromium-review.googlesource.com/615242 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia 1da00653 2017-06-20T17:16:25 Remove IndexRange in DrawElements functions This change will remove IndexRange parameter in DrawElements functions. And calculate it until we truly need it. Meanwhile we add direct drawing path to avoid retrieving index range for DrawElements* functions in D3D11 backend. This change may not bring much performance improvement since we still need to retrieve index range in validation at the beginning of every DrawElements* call entry point. BUG=angleproject:1393 Change-Id: I86a8739c0893954c94eb398db62820ced7871565 Reviewed-on: https://chromium-review.googlesource.com/544634 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 318f9aa5 2017-05-17T17:47:28 Initialize ANGLE_multiview caps and workaround state The patch checks whether ANGLE_multiview can be supported in the OpenGL renderer, updates the caps and adds a workaround field to enable multiview support through the NV_viewport_array2 extension. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I99dae10564db7bcca41d7624f8de272c1d996e09 Reviewed-on: https://chromium-review.googlesource.com/567934 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 761b02c8 2017-06-23T16:27:06 Add an applyNativeWorkarounds context impl hook. This method can allow the implementation to override the Context's workarounds. Use this design pattern now that we have access to the gl::Context everywhere - we don't need to cache a local copy in the Renderer objects. This will be used to apply a Shader Program Cache workaround on the GL level, that will only be used for the GLES back-end on Qualcomm. BUG=angleproject:2088 Change-Id: I6da25c5c29c3ba01b8820c5234d1b92dd2d2121a Reviewed-on: https://chromium-review.googlesource.com/549980 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez e7557744 2017-06-01T13:09:57 WebGL compatibility: remove UB for draw buffers in the GL backend. WebGL adds two rules: - Fragment outputs declared but not written to should default to black. - FBO attachments for outputs not declared in the shader should not be written to (it is UB in OpenGL ES). Fix the first one by using the SH_INIT_OUTPUT_VARIABLES compiler options, and the second one by messing with glDrawBuffers so that the enabled draw buffers are always a subset of the ones declared by the shader. BUG=angleproject:2048 Change-Id: I1d851c190959c1acfc3e41d837e6990aec1d4086 Reviewed-on: https://chromium-review.googlesource.com/521682 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c564c070 2017-06-01T12:45:42 Pass gl::Context to impl methods instead of ContextImpl. In some cases we might have to call back into the GL layer, passing the Context, and if we just have a ContextImpl pointer this isn't possible. It also removes the need for SafeGetImpl. BUG=angleproject:2044 Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6 Reviewed-on: https://chromium-review.googlesource.com/516835 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 876429b7 2017-04-20T15:46:24 Update gl2.h and update entry points. Some method signatures were updated. Types like GLclampf and GLvoid were replaced with other equivalents. BUG=angleproject:1309 Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680 Reviewed-on: https://chromium-review.googlesource.com/475011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 2b39659d 2017-03-29T15:36:04 ES31: Implement glDispatchCompute for OpenGL backend This patch refers to https://chromium-review.googlesource.com/c/380639/ BUG=angleproject:1955 TESTCASE=angle_end2end_tests Change-Id: Iafd7a6ba2d71c0b332d9267a1260d9dbd9800c02 Reviewed-on: https://chromium-review.googlesource.com/462089 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>