src/libANGLE/Display.cpp


Log

Author Commit Date CI Message
Ian Elliott 4e87659e 2019-03-12T16:23:55 Fix eglChooseConfig for attributes that have exact default values. The implementation of eglChooseConfig does not match the specification for attributes not provided by the calling function. It is supposed to use the default value and match semantics, per the specification. This is fine for many attributes (where the value in the EGLConfig doesn't matter). Currently, this affects the following attributes: - EGL_COLOR_BUFFER_TYPE - EGL_LEVEL - EGL_RENDERABLE_TYPE - EGL_SURFACE_TYPE - EGL_TRANSPARENT_TYPE - EGL_OPTIMAL_SURFACE_ORIENTATION_ANGLE - EGL_COLOR_COMPONENT_TYPE_EXT This change causes 55 of 65 of the dEQP-EGL.functional.choose_config.* tests to start passing. Bug: angleproject:3172 Change-Id: I287af5ba7d296694d9a78ded5d1e3bc4e7043d03 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1506696 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
jchen10 23ed69cb 2019-01-23T10:36:34 Make WARN() and ERR() thread safe This adds a global mutex lock to protect logging messages from worker threads. BUG=922936 Change-Id: I42e2a7b560da6f6a8b120b74252adce115ccda20 Reviewed-on: https://chromium-review.googlesource.com/c/1429479 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Michael Spang 229fc83d 2019-01-21T18:09:15 Vulkan: Port renderer to Fuchsia (reland) Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan renderer, as well as an implementation of OSWindow that renders fullscreen for the test suite. Disallow use of the vulkan loader from third_party as Fuchsia uses a fork of the loader and has not sent those changes upstream yet. Add a small wayland-inspired library libfuchsia-egl to provide a type "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type combines a zx_handle_t to an image pipe channel and a surface size. Image pipes can only be used once to create a VkSurfaceKHR. This means we have to recreate the pipe in tests that call eglCreateWindowSurface more than once with a single OSWindow, or the second call will fail. Add a resetNativeWindow() method to accomplish this. Reland disabling -Wextra-semi. BUG=angleproject:2475 TEST=angle_end2end_tests on Fuchsia Change-Id: Ie91715bcd760c6c04d4b8a02a91daa71e32ee30c Reviewed-on: https://chromium-review.googlesource.com/c/1467603 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3f0ff409 2019-02-12T03:08:51 Revert "Vulkan: Port renderer to Fuchsia" This reverts commit 991d1cfb5e5a2f20a46961da3ad85b95da30b88a. Reason for revert: Failing compile on the fuchsia bots on the ANGLE auto-roller. https://ci.chromium.org/p/chromium/builders/luci.chromium.try/fuchsia_x64/209198 In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.cpp:10: In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.h:13: In file included from gen/third_party/fuchsia-sdk/sdk/fidl/fuchsia/ui/policy/cpp/fidl.h:5: In file included from ../../third_party/fuchsia-sdk/sdk/pkg/fidl_cpp/include/lib/fidl/cpp/internal/header.h:12: ../../third_party/fuchsia-sdk/sdk/pkg/fit/include/lib/fit/function.h:135:6: error: extra ';' after member function definition [-Werror,-Wextra-semi] }; ^ 1 error generated. Original change's description: > Vulkan: Port renderer to Fuchsia > > Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan > renderer, as well as an implementation of OSWindow that renders > fullscreen for the test suite. > > Disallow use of the vulkan loader from third_party as Fuchsia uses a fork > of the loader and has not sent those changes upstream yet. > > Add a small wayland-inspired library libfuchsia-egl to provide a type > "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type > combines a zx_handle_t to an image pipe channel and a surface size. > > Image pipes can only be used once to create a VkSurfaceKHR. This means we > have to recreate the pipe in tests that call eglCreateWindowSurface more > than once with a single OSWindow, or the second call will fail. Add a > resetNativeWindow() method to accomplish this. > > BUG=angleproject:2475 > TEST=angle_end2end_tests on Fuchsia > > Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf > Reviewed-on: https://chromium-review.googlesource.com/c/1446496 > Commit-Queue: Michael Spang <spang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=spang@chromium.org,geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I2d9abefa9db5363ba63a17c1773d0e147040d055 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2475 Reviewed-on: https://chromium-review.googlesource.com/c/1465761 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Michael Spang 991d1cfb 2019-01-21T18:09:15 Vulkan: Port renderer to Fuchsia Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan renderer, as well as an implementation of OSWindow that renders fullscreen for the test suite. Disallow use of the vulkan loader from third_party as Fuchsia uses a fork of the loader and has not sent those changes upstream yet. Add a small wayland-inspired library libfuchsia-egl to provide a type "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type combines a zx_handle_t to an image pipe channel and a surface size. Image pipes can only be used once to create a VkSurfaceKHR. This means we have to recreate the pipe in tests that call eglCreateWindowSurface more than once with a single OSWindow, or the second call will fail. Add a resetNativeWindow() method to accomplish this. BUG=angleproject:2475 TEST=angle_end2end_tests on Fuchsia Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf Reviewed-on: https://chromium-review.googlesource.com/c/1446496 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 3d6e3004 2019-02-01T15:43:59 Implement EGL_ANDROID_recordable for Vulkan back-end. This initial implementation provides the extension, and always answers that the ANativeWindow is not recordable. BUG=angleproject:2511 Change-Id: Id3c57351dd1029bff7adf7166f9c82eee6e634b3 Reviewed-on: https://chromium-review.googlesource.com/c/1412507 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 65cd76a7 2019-02-01T10:31:58 Use env variable to select default backend This is useful for situations where angle is substituted for the system library underneath an application oblivious to this change. The ANGLE_DEFAULT_PLATFORM variable is used when the display type is default to control the default back-end. Possible values are vulkan, gl and d3d11. If the value of this variable is not valid, or not supported by the current platform, the usual defaults are applied. Bug: angleproject:3125 Change-Id: I304b006e0a4149f78561038d01cede143640dafb Reviewed-on: https://chromium-review.googlesource.com/c/1450211 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5313c8a8 2019-01-14T17:02:52 Implement EGL_KHR_fence_sync and EGL_KHR_wait_sync EGL_KHR_fence_sync introduces the EGLSync object and associated create/destroy/clientWait functions. EGL_KHR_wait_sync adds the serverWait function on top of that. Bug: angleproject:2466 Change-Id: Iebb239a85c4471ea18b3c3a8a83b793af555e31d Reviewed-on: https://chromium-review.googlesource.com/c/1412261 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 37d2e606 2019-01-10T12:46:16 Make BlobCache use independent from ANGLE_program_cache_control The decision to enable caching or not was based on the size of the cache as directed by eglProgramCacheResizeANGLE, which is incorrect for applications that only use the ANDROID_blob_cache extension. The new behavior is as follows: - If EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE is specifically requested and set to true, but the size of the cache is 0, caching is disabled for the context. - If EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE is specifically requested and set to false, caching is disabled for the context. - Otherwise, caching is left enabled for the context, although the cache possibly has a size of zero, which effectively disables it. During application execution, if the blob cache callbacks are set, the application cache will be used. Bug: 896406, angleproject:2516 Change-Id: Ic0cabda03fb6bf53994e86e3ede30afc8021d67e Reviewed-on: https://chromium-review.googlesource.com/c/1405708 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@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 c3ee7ec0 2018-09-21T16:15:03 Implement EGL_ANDROID_image_native_buffer. BUG=angleproject:2508 Change-Id: I8ef2ce8320edeb336727905055f47bb299dec2ea Reviewed-on: https://chromium-review.googlesource.com/c/1238886 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Courtney Goeltzenleuchter 3f21fcb9 2018-09-17T17:21:44 Set ANGLE default backend to Vulkan If the Vulkan backend is available, use it on Android. This way ANGLE built for the ANGLE apk always uses Vulkan. ANGLE built for use in Chrome keeps GL. At least for now. Bug=angleproject:2418 Change-Id: Ic7796c74821a44b856a596d31b3de09e7ca47ede Reviewed-on: https://chromium-review.googlesource.com/c/1265504 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Shahbaz Youssefi 996628a4 2018-09-24T16:39:26 Vulkan: Add support for VkPipelineCache The cache is initialized from the application's blob cache and is occasionally written back to it for disk storage. Bug: angleproject:2516 Change-Id: I4cba4b00a7b9641c2983ef07159bc62cd10a5519 Reviewed-on: https://chromium-review.googlesource.com/1241373 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 4230d484 2018-09-14T10:14:45 Finish fixing EGL enums. This removes the temporary defines now that Chromium is up-to-date. Bug: angleproject:2806 Change-Id: I8e3308d6b80e49c2b2a7a698ee5d8ad40f442475 Reviewed-on: https://chromium-review.googlesource.com/1227031 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f4d429c1 2018-09-13T11:20:52 Fix EGL enum allocation. The following enums had a small typo causing them to be takend from an unused block: EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE Fix this by temporarily defining a secondary enum. Once Chromium is fixed upstream we can remove the temporary enum. Reported by dan.glastonbury@gmail.com. Bug: angleproject:2806 Change-Id: I2ce1dec0a30d5e83f2bec0ae243fd860cbcea4fc Reviewed-on: https://chromium-review.googlesource.com/1220371 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 9137adea 2018-08-27T14:22:37 Add support for EGL_ANDROID_blob_cache The functionality of MemoryProgramCache is divided up in two. BlobCache is now a generic binary cache, which interfaces with the callbacks from EGL_ANDROID_blob_cache. MemoryProgramCache handles program [de]serialization and interacts with BlobCache. Bug: angleproject:2516 Change-Id: Ie4328a2e56a26338e033d84f4e53a1103411937d Reviewed-on: https://chromium-review.googlesource.com/1194285 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang cf0d8fef 2018-07-30T13:41:32 Remove the proxy context. BUG=angleproject:2668 BUG=angleproject:2714 Change-Id: I9f375caa605e13aae04e8051a779515f8ddfb93a Reviewed-on: https://chromium-review.googlesource.com/1155105 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 9d05b930 2018-07-27T15:47:18 Don't store a ref from an EGL image to its source. ImageSiblings no longer inherit from RefCountObeject because they may be EGL or GL objects and should handle their own deletion. This can cause GL resources to outlive their contexts. When the GL resource is deleted, simply orphan the image. BUG=angleproject:2668 Change-Id: I4a5c12bbe6e725f946209f9b48345a4097c9c91c Reviewed-on: https://chromium-review.googlesource.com/1153601 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang cd7cd2a8 2018-07-19T11:25:54 Pass Context to EGLImage creation and Display to EGLImage initialization. BUG=angleproject:2507 Change-Id: I6c195434131709203f892be6037e974002c174c2 Reviewed-on: https://chromium-review.googlesource.com/1143453 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 853f8255 2018-07-09T09:18:50 DisplayImpl: Make waitClient/waitNative non-const. These methods can mutate the display resources. Necessary for getting rid of ProxyContext and for the Vulkan error refactor. Bug: angleproject:2714 Bug: angleproject:2713 Change-Id: Ibffb1a382ecb064daaa7c664f9fc65cbcf927b37 Reviewed-on: https://chromium-review.googlesource.com/1128927 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 3cacf69b 2018-06-20T16:49:57 Pass all context creation parameters to DisplayImpl::createContext. Knowing the share context at native context creation time is required if we want to honor the requested share group instead of virtualizing contexts or using global share groups. BUG=angleproject:2464 Change-Id: I1fb4d71de266b3191986b1754e73d474e49445bb Reviewed-on: https://chromium-review.googlesource.com/1108743 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 24ddc7a8 2018-06-11T14:56:34 WGL: Support unvirtualized contexts and unsafe multithreading. When using unvirtualized contexts, DisplayWGL still creates a Renderer for managing any internal GL resources such as emulated back buffers for DXGISwapChainWindowSurfaceWGL or D3DTextureSurfaceWGL but also creates a new Renderer for each GL context. All created contexts share resources. BUG=angleproject:2464 Change-Id: I945502514079368e062beef70bed49c61ed44403 Reviewed-on: https://chromium-review.googlesource.com/1097459 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 2dabb4a3 2018-06-01T17:18:41 Make a context current when destroying it. The destructors of objects in a context assume that the context is current during destruction. If another context is current at this time, they can delete objects from other contexts. BUG=angleproject:2464 Change-Id: I813d092cc7f33a39c814edae5baa433733b4590c Reviewed-on: https://chromium-review.googlesource.com/1083371 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 75359664 2018-04-11T01:42:27 Implement EGL_KHR_debug. BUG=angleproject:1618 Change-Id: I790944b49badc910b6c72266469fcb8e86ac4252 Reviewed-on: https://chromium-review.googlesource.com/1019387 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e1a057e8 2018-06-07T15:09:00 Fully format some files. Change-Id: Id6ea245849696d4c6d7eabc6860c0ac424dd8013 Reviewed-on: https://chromium-review.googlesource.com/1091309 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Brandon Jones 2b0cdcc1 2018-05-02T08:02:50 Implement EGL_ANGLE_explicit_context Implementation of EGL_ANGLE_explicit_context. Includes new libGLESv2 entry points and exports, libANGLE entry points, extension declarations for eglGetProcAddress, and unit tests. Autogeneration scripts have been modified to produce entry points, exports, eglGetProcAddress function table, extension function pointers, and function declarations. Bug:angleproject:1395 Change-Id: I1b79c6069bbed05beb4700a32139a64ddc465c4c Reviewed-on: https://chromium-review.googlesource.com/1039865 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang c1651618 2018-05-23T11:34:11 Don't double-terminate a display. Some dEQP tests call eglTerminate twice on the same display and cause crashes. BUG=angleproject:2546 Change-Id: I3118e07aec19a28ad2b76fc2705be5b0bea37857 Reviewed-on: https://chromium-review.googlesource.com/1066467 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 671be629 2018-05-18T15:01:46 Make sure the DisplayImpl is terminated if it fails to fully initialize. It is possible that if device creation fails that the display would be left in a state where rx::DisplayImpl is initialized and egl::Display is not. BUG=angleproject:2546 Change-Id: I609e4c40f37945322d64786d4f6e97f361764b62 Reviewed-on: https://chromium-review.googlesource.com/1066501 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuly Novikov ef80f835 2018-05-16T20:42:04 Revert "Don't double-terminate a display." This reverts commit 10e7e5013c41cdca8d6ab0ed4bc9bb3dedb537e7. Reason for revert: Possible reason for anglebug.com/2561 Original change's description: > Don't double-terminate a display. > > Some dEQP tests call eglTerminate twice on the same display and cause crashes. > > BUG=angleproject:2546 > > Change-Id: I8a13d00fd03692b3b24dee4813c245d83ea00862 > Reviewed-on: https://chromium-review.googlesource.com/1060335 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org Change-Id: Iab32ed96443eab406afa65642f9a66f68dc8ebcd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2546, angleproject:2561 Reviewed-on: https://chromium-review.googlesource.com/1062728 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 10e7e501 2018-05-15T16:08:05 Don't double-terminate a display. Some dEQP tests call eglTerminate twice on the same display and cause crashes. BUG=angleproject:2546 Change-Id: I8a13d00fd03692b3b24dee4813c245d83ea00862 Reviewed-on: https://chromium-review.googlesource.com/1060335 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ce07f967 2018-05-09T11:27:06 Merge the Framebuffer onDestroy and onDestroyDefault methods. Pass the proxy context to the onDestroyDefault call. BUG=angleproject:2464 Change-Id: I47f869d623e238ca3680c962387ba9359e7d3844 Reviewed-on: https://chromium-review.googlesource.com/1052220 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0ab41fa5 2018-03-14T11:03:30 Add an EGL extension to disable GL extensions by default. BUG=angleproject:2404 Change-Id: I2667ddc92d5c9ef6e0ef115f2fdf0c3d3643d945 Reviewed-on: https://chromium-review.googlesource.com/962702 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 199f4294 2018-01-19T19:04:05 Vulkan: Enable on Android Add Android DisplayVk and WindowSurfaceVk variants. Build Vulkan backend and validation layers on Android if toolchain uses required NDK API level. Fix validation layers discovery to work on Android. BUG=angleproject:2314 TEST=angle_end2end_tests builds and runs on Nexus 5X, 12 VULKAN tests pass Change-Id: Iac2ec4ecd6470a7552f9f60c023ba1760aa090c5 Reviewed-on: https://chromium-review.googlesource.com/887797 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 2aaa7b4e 2018-01-12T17:17:27 Add GLES1 targets and stub entry points. * Create a new libGLESv1_CM target. * Merge all autogenerated extension entry points into one file. * Allow creation of ES1 contexts. BUG=angleproject:2306 Change-Id: I446258363a96a3c37d657089dd7c1cff0fa3cf78 Reviewed-on: https://chromium-review.googlesource.com/865718 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e1aa9219 2018-01-08T17:53:05 Create a new DeviceImpl each time one is requested from a DisplayImpl. This makes sure that the Device to DeviceImpl ratio is always 1:1 and avoids any potential double-deletion or unexpected deletion of DeviceImpl objects. BUG=742034 Change-Id: I778068ccd09b7478d3683123456062b94be242a1 Reviewed-on: https://chromium-review.googlesource.com/854627 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang b433e872 2017-10-05T14:01:47 Change robust resource init into a context creation attribute. Enabled support on OpenGL even through the extension is not fully implemented so that testing with Chromium/Passthrough commmand decoder is still possible. BUG=angleproject:1635 Change-Id: Ia417b1779aace1eae19514325701a79cd33f4ef3 Reviewed-on: https://chromium-review.googlesource.com/678479 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill c43be720 2017-07-13T16:22:14 Implement ANGLE_program_cache_control extensions. This will give the browsers the ability to control the cache size, query and populate the contents, and trim cache contents on memory pressure. BUG=angleproject:1897 Change-Id: I6edaa7d307b890223db98792d5b074e4a7fdfaa4 Reviewed-on: https://chromium-review.googlesource.com/563606 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill a5822b8a 2017-06-30T12:55:10 Temporarily disable the GPU program cache. We should give the app layer more control over the cache before we enable it, to save on memory usage in Chrome. BUG=angleproject:1897 Change-Id: I532c05c3042cb0a2d9c62f362f25d6064042ca2c Reviewed-on: https://chromium-review.googlesource.com/558370 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3244736a 2017-06-28T14:53:52 Use MemoryProgramCache. Add the member functions for saving and loading from the binary cache, and hook them into the Program class. Requires that the Renderer supports the program binary extension. BUG=angleproject:1897 Change-Id: I2dc8d21b02da705ded58c5cd1943562c9c97c49b Reviewed-on: https://chromium-review.googlesource.com/522874 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>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 948bbe51 2017-06-01T13:10:42 Redesign robust resource init as a display extension. Also correct the enum allocation to values that are available to ANGLE. BUG=angleproject:1635 Change-Id: I443f5654aa6a5049b4a1ae4c253cd6473b4e446e Reviewed-on: https://chromium-review.googlesource.com/520002 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 98de826c 2017-05-29T13:01:02 Platform: Fix initialization order in tests. Because of the platform refactor in abf38572062b91 we broke the way the tests override the D3D workarounds for the tiny depth/stencil bug. This change passes a pointer to the platform directly in the EGL init logic, which solves this issue. It also removes all decltype code in the platform header which might fix the UBSAN problem we were seeing previously. Also change a present mode selection error into a warning in the Vk back-end, since this was being triggered on AMD, but is safe. BUG=angleproject:2042 Change-Id: Ibbd0c69ce11a840cf4b33c616f56020001e553aa Reviewed-on: https://chromium-review.googlesource.com/513519 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 29f148b0 2016-11-23T21:05:36 Support Vulkan on Linux as well as Windows. Refactor display and surface classes into Win32 and Linux parts and add Linux parts to gn and gyp builds. BUG=angleproject:1668 Change-Id: I2a7d29c35f4f42fa0035bd97938d3770f3627672 Reviewed-on: https://chromium-review.googlesource.com/412426 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 76b8f469 2017-04-21T12:23:40 Use a shared state for egl::Image. This allows us to stop duplicating some information in the impl. BUG=angleproject:1635 Change-Id: If8f7d2418571c3254729f48c463814ec18ed2644 Reviewed-on: https://chromium-review.googlesource.com/469153 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yunchao He 4f285443 2017-04-21T12:15:49 Refactoring: replace NULL by nullptr for pointers (2nd CL). This CL mainly handles the pointer comparisons (== or !=). BUG=angleproject:2001 Change-Id: I25ac3b61032e7ad91459a1c6541cadc87cf9b160 Reviewed-on: https://chromium-review.googlesource.com/483935 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov f5bb220f 2017-02-17T23:25:17 Restore Default Platform logging to stderr Was lost in https://chromium-review.googlesource.com/434188 Also, don't reset pre-set Platform to Default, otherwise Chrome's platform gets reset. BUG=angleproject:1660, angleproject:1892 Change-Id: I052c86c513c8d89d2420a4724a8bd0dc7446c7c2 Reviewed-on: https://chromium-review.googlesource.com/444928 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang feb8c686 2017-02-13T16:07:35 Add extensions to disable client arrays. Chrome doesn't allow any client data in its command buffer. Add an ANGLE extension to request a context that disallows client data. BUG=602737 Change-Id: If9d5144daea3c629a73562396000df59a671aad3 Reviewed-on: https://chromium-review.googlesource.com/441986 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6c1f671b 2017-02-14T19:08:04 Add destroy hooks for several GL objects. These hooks allow the back-end renderer to free object resources without having to store pointers to shared device handles for each and every object. This will allow us to save memory on back-ends that really care about memory overhead. There is a downside in that there is more boilerplate in passing gl::Context handles around everywhere. BUG=angleproject:1684 Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7 Reviewed-on: https://chromium-review.googlesource.com/426401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill abf38572 2017-02-14T16:47:59 Remove old C++ ANGLE platform. Now that the new platform is in place, we can remove the old methods. Must be landed after https://codereview.chromium.org/2697463003/ BUG=angleproject:1892 BUG=chromium:678870 Change-Id: Ia29a3b120cf3521fc0409019c2e64e4dbc6f460d Reviewed-on: https://chromium-review.googlesource.com/441274 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 40dc8c10 2017-02-14T10:41:32 Release the global texture manager with the last referencing context. This ensures that when the global texture manager is released, there is a valid context. BUG=angleproject:1639 Change-Id: I1b75885e9dc02b607bb1a386de394f6087429f5d Reviewed-on: https://chromium-review.googlesource.com/442074 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ce02f086 2017-02-06T16:46:21 Add an extension to share textures at the display level. BUG=angleproject:1639 Change-Id: If9140142ebce89f33921c13d9d212c17d1894162 Reviewed-on: https://chromium-review.googlesource.com/437618 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 70ee0f61 2017-02-06T16:04:20 Add destroy handler to SurfaceImpl. This allows the Vulkan back-end to avoid storing a reference to the VkDevice. This will extend to all the Vulkan object handle wrapper types. BUG=angleproject:1684 Change-Id: I3a98e94bc171ca27f225ce57996c3fdf9581e6e1 Reviewed-on: https://chromium-review.googlesource.com/424229 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez c295e516 2017-01-27T17:47:50 Implement EGL_KHR_surfaceless_context BUG=angleproject:1651 Change-Id: I710df14c2bfa55db2fb9b9715001756d1c1a8f1b Reviewed-on: https://chromium-review.googlesource.com/434763 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov bcb3f9ba 2017-01-27T22:45:18 Direct logging to Platform when available All logging should be done via ERR() and WARN(), which call angle::Platform's logError and logWarning, if there is current Platform which supports logging. Otherwise, ERR() is directed to std::cerr. Misc fixes to keep tests passing. BUG=angleproject:1660, angleproject:1644 Change-Id: I2bca33a021537185d0c236a3083789af3236b5f3 Reviewed-on: https://chromium-review.googlesource.com/434188 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang c5a2a172 2017-01-13T15:55:07 Add EGL_EXT_pixel_format_float support, enables float EGL surfaces. Add floating point EGL configs for the D3D11 backend. BUG=angleproject:1707 Change-Id: Ic84cd3a0d41e78cc39d0275d83e7695f55673ddf Reviewed-on: https://chromium-review.googlesource.com/428294 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov d73f852f 2017-01-13T17:48:57 Reland "Replace gl::trace logging with Chromium style logging" Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. Fix incorrect enabling of ERR() calls in UNIMPLEMENTED() and UNREACHABLE(), resulting in increased code size and <iostream> adding 5 static initializers to chrome because of cerr referenced in statically linked translator. BUG=angleproject:1660 Change-Id: I7caa18036118d532e0544f75278602559172ae04 Reviewed-on: https://chromium-review.googlesource.com/431457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 65603eb8 2017-01-12T16:48:03 Refactor EGL config entry points to to separate validation. BUG=angleproject:1707 BUG=angleproject:798 Change-Id: I34fefa9f9bbd42ef05f222c8caf856a22cf206a3 Reviewed-on: https://chromium-review.googlesource.com/428293 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e70413c7 2017-01-12T16:35:17 Roll EGL headers. Update CGL backend to use new EGL types. BUG=angleproject:1707 Change-Id: I165e81a758cad0a8036aef68c44a57bcc61e982d Reviewed-on: https://chromium-review.googlesource.com/428292 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6a6b09c9 2017-01-12T21:52:29 Revert "Replace gl::trace logging with Chromium style logging" Failing Chromium static initializers check: FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower Possibly due to the static initializer for std::array for the log severity types. We should change it to POD. BUG=angleproject:1660 This reverts commit afcc41cee4ff63e7f6c9e60e55fc061adbba7dd4. Change-Id: Ifb362a4af78542608397c7a0b19e6afe076f2cf3 Reviewed-on: https://chromium-review.googlesource.com/427235 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov afcc41ce 2016-12-13T12:59:39 Replace gl::trace logging with Chromium style logging Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. BUG=angleproject:1660 Change-Id: I58192988ad16196706fe48d0c0ab0fd1a10c0210 Reviewed-on: https://chromium-review.googlesource.com/424173 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 3311d474 2017-01-02T17:55:02 Display: Add a shared state object. This will allow us to manage the SurfaceSet in the GL layer. BUG=angleproject:1684 Change-Id: Iab8243157710beab2667ef10275571078ce9ae8e Reviewed-on: https://chromium-review.googlesource.com/424228 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0448ec84 2016-12-23T13:41:47 Vulkan: Enable validation layers on request. Also adds the build files for the Vulkan layers. The layers are enabled by default for the tests. BUG=angleproject:1319 Change-Id: I0b442b36312a1299a932922e1c4e39f00801de49 Reviewed-on: https://chromium-review.googlesource.com/367751 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e09bd5d3 2016-11-29T16:20:35 Vulkan: Add display creation, test and extension. With this CL we have the ability to create Vulkan test configs and run basic tests, although the only thing that works is creating a Vulkan Renderer using the extension. BUG=angleproject:1319 Change-Id: I8ad17bba01241334be7da16e68fea38762ca6a20 Reviewed-on: https://chromium-review.googlesource.com/367750 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 95401dbb 2016-12-15T11:27:48 Surface: Pass DisplayImpl to initialize and swap. In new back-ends (Vulkan) this will allow us to avoid storing a ref to the Renderer in the Surface class. BUG=angleproject:1319 Change-Id: I3b3f50893070d2993e4e91dd82ee539a083b3727 Reviewed-on: https://chromium-review.googlesource.com/419837 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 439a55e5 2016-12-15T13:12:26 Fix ability to recover EGL Display after D3D11 device lost BUG=angleproject:1463 Change-Id: I9f3e1190cc42e0cb37d80b94c35b61e88203dd32 Reviewed-on: https://chromium-review.googlesource.com/420475 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 60e6edfa 2016-10-31T12:17:19 Make ASSERT reference the conditional expression. This should prevent further unexpected bot breakage due to unreferenced variables in the ASSERT expression. Also remove the no longer needed variable referencing macro. BUG=angleproject:1586 Change-Id: I127695165bdfe39c51fe8d17e00daf6bf2fa8252 Reviewed-on: https://chromium-review.googlesource.com/404948 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 2018c0ba 2015-12-08T11:48:51 Add a EGL_ANGLE_d3d_texture_client_buffer extension. Allows creation of pbuffers from D3D texture objects. BUG=540829 BUG=angleproject:1144 Change-Id: If8ea717ef011608cd01357c217837133d726d3ea Reviewed-on: https://chromium-review.googlesource.com/316804 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang a284f2ff 2015-08-07T16:49:07 Add stubs for EGL_EXT_swap_buffers_with_damage. BUG=512090 Change-Id: I9413d6f5c13b9ea59ab9c923dc6c5d157f344166 Reviewed-on: https://chromium-review.googlesource.com/291652 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 168445c2 2016-09-23T16:33:22 Add an extension for requesting a NULL Display. BUG=angleproject:1468 Change-Id: Ief4b0e7d7a0420e59e547cd24fde53deb3718ccb Reviewed-on: https://chromium-review.googlesource.com/388845 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang f41a7151 2016-09-19T15:11:17 Add an extension to disable resource generation on bind. BUG=angleproject:1518 Change-Id: I662f7b07da5c97831496f2617b0adadf9858bdc9 Reviewed-on: https://chromium-review.googlesource.com/386799 Reviewed-by: Antoine Labour <piman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang c287ea6e 2016-09-16T14:46:51 Add WebGL validation extensions to ANGLE. BUG=angleproject:1523 Change-Id: I6fecb5055ed8087665aeee34b3a066ea8f38d51b Reviewed-on: https://chromium-review.googlesource.com/386281 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 87fbe1c2 2016-08-03T14:41:42 ContextImpl: only expose getResetStatus for robustness This will allow each backend to implement this method separately. The current set of ContextImpl methods used for robustness are slightly D3D-centric. BUG=angleproject:1463 Change-Id: I101f8ada2c49de4cf110db48b1e8380c52b50fb2 Reviewed-on: https://chromium-review.googlesource.com/365829 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Martin Radev 6230dd54 2016-08-23T15:20:03 Check for OpenGL ES support when creating context Support for an OpenGL ES version can come either through OpenGL ES, OpenGL core or available extensions. The context creation should fail if the requested OpenGL ES version is not supported. BUG=angleproject:1477 TEST=angle_end2end_tests Change-Id: I810d004a1bd62f75f162d775d3cf92c4283252a3 Reviewed-on: https://chromium-review.googlesource.com/374338 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 9c721c64 2016-08-02T14:56:23 Check for device loss on all applicable EGL entry-points This will make applications aware of device loss on all EGL calls that need to have an initialized display. For that purpose, we track the device loss state at the egl::Display level instead of always querying the implementation. This is correct because at device-loss at the display level is non-recoverable. It also deduplicates the tracking that would have to be done in all the EGL backends. Changes made in this commit: - Cached device loss in egl::Display - Check isDeviceLost in ValidateDisplay - Changed EGL entry-points testing isDeviceLost to explicitely request a testDeviceLost - Add calls to ValidateDisplay to entry-points missing it - Removed unused virtual qualifiers for some robustness methods BUG=angleproject:1463 Change-Id: I92bea81f2ecd5423c445cff31557a4d9783557d5 Reviewed-on: https://chromium-review.googlesource.com/365450 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov a6426d67 2016-06-03T00:18:38 Android GL backend and end2end tests Just the bare minimum implementation for end2end tests to run. BUG=angleproject:1362 TEST=angle_end2end_tests on Nexus 5X Change-Id: I92293e0f8bdc2ffaa5d4661927750d7cb3d931e6 Reviewed-on: https://chromium-review.googlesource.com/349353 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 00ed7a1f 2016-05-19T13:13:38 Enable always-available extensions in gl::Context. We can consolidate exposing these extensions in initCaps. Otherwise we have to maintain the lists in every Renderer back-end. Also do the same treatment for select egl::Display extensions. BUG=angleproject:1319 Change-Id: I529dd120c6d2cdbb789bd9dd20491e796e97f3f6 Reviewed-on: https://chromium-review.googlesource.com/345914 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d3a5b185 2016-05-19T13:13:35 Make inheritance heirarchy for egl::Surface. This will allow us to select the Impl constructor more easily createWindowSurface createPbufferSurface createPbufferSurfaceFromClientBuffer createPixmapSurface This in turn lets us pass an EGLImplFactory to the constructor and will allow us to pass in the local SurfaceState to the constructor. BUG=angleproject:1369 Change-Id: I6b13c1548c54bd5c493d59b68bfdaf55226b6bb5 Reviewed-on: https://chromium-review.googlesource.com/342060 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 53ea9cc6 2016-05-17T10:12:52 Replace rx::Renderer with rx::ContextImpl. Previously Context had no Impl class, but had a special relationship with the instanced Renderer class. Having a ContextImpl backing every Context will allow new designs to enable things like multithreading (where each ContextImpl stores a Context-specific device) or non- virtual Contexts on Android or other platforms where it is more efficient. A large refactoring patch that touches every back-end. BUG=angleproject:1363 Change-Id: Icb73a7d37447f08a664eeb499a310ba05d71a57e Reviewed-on: https://chromium-review.googlesource.com/342052 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 538281f6 2016-04-13T23:36:55 Initial Chrome OS support. Samples and end2end tests mostly work. Only one config, and no input. BUG=angleproject:1297 Change-Id: I5b69babccc5b97e486d86e1721a0a1740ad80941 Reviewed-on: https://chromium-review.googlesource.com/319460 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Ian Ewell bda75597 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I39b6ec393ea338e2c843fb911acc1b36cd1158a0 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com> Reviewed-on: https://chromium-review.googlesource.com/341254 Reviewed-by: Ian Ewell <ewell@google.com>
Corentin Wallez 9670b03e 2016-04-29T09:47:47 Revert "Finish NV12 support via streams." Broke Windows Clang compilation, see https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Clang%20Builder%20%28dbg%29/builds/3583/steps/compile/logs/stdio and search for TextureStorage11.h This reverts commit 9b8b359fa3615be7c7492239a48f61103b2e4fcc. Change-Id: I6e54305eba02b40927a35577594df39e951adb32 Reviewed-on: https://chromium-review.googlesource.com/341430 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Ian Ewell 9b8b359f 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I098940e6f25e113dcc4fc8d22ffed4b5a16fd860 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
Ian Ewell ec2c0c5e 2016-04-05T13:46:26 Update internal AttributeMap type to EGLAttrib. Newer EGL functions use EGLAttrib to pass in attributes, which can be either 32-bit or 64-bit depending on the system while the old attributes are passed in as EGLints, which are usually 32-bits. To support these newer functions, AttributeMap now uses EGLAttrib internally instead of EGLint, and all the code using AttributeMap has been updated to cast properly. BUG=angleproject:1348 Change-Id: I7c4dd9ef23ea1b1741f3a565502fb5e26bf962d7 Reviewed-on: https://chromium-review.googlesource.com/337162 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
Ian Ewell 701b74b0 2016-03-02T15:26:39 Add support for EGL_KHR_stream. EGL_KHR_stream is now implemented. Since the extension does not come with any producers or consumers, it does not have much functionality and the implementation is therefore very simple (validation layers and a new object to store some attributes). This however add the groundwork to add the appropriate consumer and producer extensions to stream D3D NV12 textures directly into ANGLE which will significantly improve video performance on Chromium on D3D-based platforms. BUG=angleproject:1332 Change-Id: Ie240c73869f5098d1215cc5e27aa5decd06c3ed1 Reviewed-on: https://chromium-review.googlesource.com/330003 Commit-Queue: Ian Ewell <ewell@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill da123308 2016-03-29T17:00:48 Add ANGLE_TRY macros to reduce boilerplate with gl/egl Errors. The macros don't need to disambiguate between GL/EGL. Also make helpers to deal with ErrorOrResult. BUG=angleproject:1310 BUG=angleproject:1327 Change-Id: I8041c4b17a859fe1f236bca3ad266453d67a8fd4 Reviewed-on: https://chromium-review.googlesource.com/335826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Austin Kinross 2a63b3f8 2016-02-08T12:29:08 Re-land "Implement EGL_experimental_present_path_angle" - Re-land with clang fix. This allows ANGLE to render directly onto a D3D swapchain in the correct orientation when using the D3D11 renderer. The trick is to add an extra uniform to each shader which takes either the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this value to -1.0. When rendering to the default framebuffer, ANGLE sets this value to +1.0. ANGLE multiplies vertex positions by this value in the VS to invert rendering when appropriate. It also corrects other state (e.g. viewport/scissor rect) and shader built-in values (e.g. gl_FragCoord). This saves a substantial amount of GPU time and lowers power consumption. For example, the old method (where ANGLE renders all content onto an offscreen texture, and then copies/inverts this onto the swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame on a Lumia 630. Verification: + dEQP GL ES2 tests pass when "present path fast" is enabled + all ANGLE_end2end_tests pass when "present path fast" is enabled BUG=angleproject:1219 Change-Id: I56b339897828753a616d7bae837a2f354dba9c63 Reviewed-on: https://chromium-review.googlesource.com/326730 Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d1c46228 2016-02-08T14:51:18 Revert "Implement EGL_experimental_present_path_angle" Compile failure on Clang/Win: The reason for reverting is: FAILED: ninja -t msvc -e environment.x86 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj.rsp /c ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp /Foobj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj /Fdobj\gpu\angle_end2end_tests.cc.pdb In file included from ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp:7: In file included from ..\..\third_party\angle\src\tests\test_utils/ANGLETest.h:13: ..\..\testing\gtest\include\gtest/gtest.h(1392,16) : error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ ..\..\testing\gtest\include\gtest/gtest.h(1422,12) : note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp(281,9) : note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here ASSERT_EQ(mWindowWidth * 4, mappedSubresource.RowPitch); ^ ..\..\testing\gtest\include\gtest/gtest.h(1960,32) : note: expanded from macro 'ASSERT_EQ' # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) ^ ..\..\testing\gtest\include\gtest/gtest.h(1943,67) : note: expanded from macro 'GTEST_ASSERT_EQ' EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ ^ BUG=angleproject:1219 This reverts commit 6b3c1db5170450bbc4946d8f18ba0d8619da43a0. Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6 Reviewed-on: https://chromium-review.googlesource.com/326680 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 6b3c1db5 2015-12-18T14:01:46 Implement EGL_experimental_present_path_angle This allows ANGLE to render directly onto a D3D swapchain in the correct orientation when using the D3D11 renderer. The trick is to add an extra uniform to each shader which takes either the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this value to -1.0. When rendering to the default framebuffer, ANGLE sets this value to +1.0. ANGLE multiplies vertex positions by this value in the VS to invert rendering when appropriate. It also corrects other state (e.g. viewport/scissor rect) and shader built-in values (e.g. gl_FragCoord). This saves a substantial amount of GPU time and lowers power consumption. For example, the old method (where ANGLE renders all content onto an offscreen texture, and then copies/inverts this onto the swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame on a Lumia 630. Verification: + dEQP GL ES2 tests pass when "present path fast" is enabled + all ANGLE_end2end_tests pass when "present path fast" is enabled BUG=angleproject:1219 Change-Id: Ib6eeea46bafa6ebce4adada0ae9db3a433b8fc4c Reviewed-on: https://chromium-review.googlesource.com/321360 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 4c06817a 2016-01-25T15:50:20 Add support for targetting GLES with DisplayGLX. BUG=angleproject:1145 Change-Id: I3072c31f2f743943b2ed9a3b1a020529112d5f71 Reviewed-on: https://chromium-review.googlesource.com/324091 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 436e32ae 2016-01-15T15:53:12 GLX backend: check for child window resizes on eglWaitNative This is the standard way, if not often used, for application to notify the driver of window size changes. Chromium uses it to resize when it is done rendering and swapping so that drivers do not clobber the backbuffer. This fixes black flickering appearing when resizing the Chromium windows with --use-gl=angle. BUG=angleproject:1281 Change-Id: Ic76f3c3ef453eae07eb59122135290411f86764d Reviewed-on: https://chromium-review.googlesource.com/322390 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 33db61d1 2016-01-20T10:54:49 Add support for targetting GLES with DisplayWGL. BUG=angleproject:1145 Change-Id: I5a0a667621aceedb4662cfb2356d7dbd0d9f7718 Reviewed-on: https://chromium-review.googlesource.com/285557 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez a433388d 2016-01-14T17:24:50 Implement eglWait* This mostly does nothing except on X11 where it calls the equivalent glXWait*. eglWait* are needed because they are used by Chromium and were triggering an UNREACHABLE(). BUG=angleproject:1281 Change-Id: Iff9c127b16841bc27728304a5ba2caff49ff11b5 Reviewed-on: https://chromium-review.googlesource.com/322360 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 46e6c7a5 2016-01-18T14:42:30 Add stubs for no_error extension. In some cases ANGLE flushes state for FBOs during validation. For testing of the state synching code for FBOs, this makes end-to-end testing impossible. Solve this by partially implementing a hidden no_error extension, hidden to the user by not exposing the extension string, but allowing us to skip validation of some of the FBO methods that require checking for complete FBOs. BUG=angleproject:1280 BUG=angleproject:1260 Change-Id: I708f348ccec6697b974c48cd890ec75a703abe21 Reviewed-on: https://chromium-review.googlesource.com/322210 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Byungseon Shin 9a866453 2016-01-08T10:35:55 Fix compilation error on Linux BUG=574909 Change-Id: I6dc4b010b67a9c7f3b64215a168e6ed5e894989b Reviewed-on: https://chromium-review.googlesource.com/320635 Commit-Queue: Byungseon Shin <xingri@gmail.com> Tested-by: Byungseon Shin <xingri@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 7f448b58 2015-12-16T13:31:57 Add an EGL_ANGLE_surface_orientation extension. BUG=angleproject:1262 Change-Id: Ifbb0f5302311a68a0c6f02baaea706cbb7055a52 Reviewed-on: https://chromium-review.googlesource.com/320011 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 666cb828 2016-01-04T17:44:09 Revert "Add an EGL_ANGLE_surface_orientation extension." Compilation warnings on clang. This reverts commit 18cc14b5951842ede85c06dcbc0bba230bcedc45. Change-Id: If58047486116e34ef30c4b317d3fb47cd2349d15 Reviewed-on: https://chromium-review.googlesource.com/319822 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>