src/libANGLE/Image.h


Log

Author Commit Date CI Message
Mohan Maiya b38cc7fa 2024-09-30T12:43:09 Vulkan: Consolidate read colorspace override states ColorspaceState struct is now used to cache read colorspace related states to determine the colorspace of Vulkan read image views. ImageViewHelper methods are called during initialization and when colorspace related states are toggled dynamically which in turn process these states and determine the final read colorspace. Bug: angleproject:40644776 Tests: ImageTest*Colorspace*Vulkan SRGBTextureTest.SRGB*TextureParameter*Vulkan SRGBTextureTestES3.SRGBDecodeTexelFetch*Vulkan Change-Id: I16b3666cd80865936b826dc0738fc9210dabeda9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5901255 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Yuxin Hu eaffa034 2024-09-24T20:56:04 Revert "Vulkan: Consolidate colorspace override states" This reverts commit bffcd235ba6c031603d798daaa98f1cf9a3f3e46. Reason for revert: Breaks Android test `org.skia.skqp.SkQPRunner#UnitTest_DMSAA_dst_read`. Details: https://b.corp.google.com/issues/369388539. Original change's description: > Vulkan: Consolidate colorspace override states > > ColorspaceState struct is now used to cache colorspace related states > and used to determine the colorspace of Vulkan image views. > ImageViewHelper methods are called during initialization and when > colorspace related states are toggled dynamically which in turn process > these states and determine the final read and write colorspaces. > > We can now fully support rendering to EGLImages, with colorspace > overrides, via texture or renderbuffer EGLImage targets > > Bug: angleproject:40644776 > Tests: ImageTest*Colorspace*Vulkan > MultithreadingTestES3.SharedSrgbTextureMultipleContexts*Vulkan > SRGBTextureTest.SRGB*TextureParameter*Vulkan > SRGBTextureTestES3.SRGBDecodeTexelFetch*Vulkan > ReadPixelsPBOTest.SrgbUnorm*Vulkan > Change-Id: I1cc2b5bd834b519b83deab4d80a2fcaabeb271d6 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5841290 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> Bug: angleproject:40644776 Change-Id: I5bf6cf2ed0c8ec22fc02d8c3da92673ee85fe002 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5888506 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya bffcd235 2024-09-13T14:58:00 Vulkan: Consolidate colorspace override states ColorspaceState struct is now used to cache colorspace related states and used to determine the colorspace of Vulkan image views. ImageViewHelper methods are called during initialization and when colorspace related states are toggled dynamically which in turn process these states and determine the final read and write colorspaces. We can now fully support rendering to EGLImages, with colorspace overrides, via texture or renderbuffer EGLImage targets Bug: angleproject:40644776 Tests: ImageTest*Colorspace*Vulkan MultithreadingTestES3.SharedSrgbTextureMultipleContexts*Vulkan SRGBTextureTest.SRGB*TextureParameter*Vulkan SRGBTextureTestES3.SRGBDecodeTexelFetch*Vulkan ReadPixelsPBOTest.SrgbUnorm*Vulkan Change-Id: I1cc2b5bd834b519b83deab4d80a2fcaabeb271d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5841290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi c3a1cae4 2024-04-15T14:58:55 Use angle::SimpleMutex everywhere in libGLESv2 Only cases left that use std::mutex are: - Share group and the context ErrorSet mutexes as they need try_lock() - Anywhere mutexes are used in conjunction with std::condition_variables (as they explicitly require std::mutex) Bug: angleproject:8667 Change-Id: Ib6d68938b0886f9e7c43e023162557990ecfb300 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5453294 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya b978974d 2024-03-03T10:48:48 Update frontend support for QCOM foveated extensions Modifications to frontend support - 1. EXTENDED_DIRTY_BIT_FOVEATED_RENDERING is removed 2. New framebuffer attachment API - getFoveationState 3. Attachment type restriction for foveated rendering is removed 4. Addition of new test - RenderbufferAttachmentClearThenDraw Bug: angleproject:8484 Change-Id: I699cbed81346c9a6344c4ff36afa51d6cc1bf052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5338529 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d05c9a5e 2024-01-25T13:01:49 Frontend support for QCOM foveated extensions Add frontend state management to support foveated rendering extensions. Bug: angleproject:8484 Test: Texture2D*Foveation* Change-Id: I0e1be9f11b2d442207674562da760f5bfd7debc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5208091 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang f405b999 2024-01-19T11:18:49 Make RefCountObject use atomics for the reference count When the context share lock is disabled it is possible for races with EGL Image reference counting causing the EGL Image to be deleted. egl::Image already protects its members with a mutex but the siblings also hold a reference to the egl::Image, if siblings are added and removed at the same time, writing to the ref count races and the egl::Image can be deleted while still being referenced. Bug: angleproject:6957 Change-Id: I3da8691136b6dbcffb2094187c81cafda077e50d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5214270 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Igor Nazarov ca4dc52e 2023-06-22T15:20:12 Replace (Single/Shared)ContextMutex classed with ContextMutex This CL removes `SingleContextMutex` class and not 100% safe `Context::lockAndActivateSharedContextMutex()` method. `SharedContextMutex<>` was replaced with `ContextMutex` with static mutex type which is defined in "SharedContextMutex.h": - ContextMutexType = std::mutex Above refactoring also allows storing `State::mContext` by value, instead by pointer. Actual mutex is referenced by `ContextMutex::mRoot` member. This removes extra pointer indirection and slightly improves performance. If newly created Context uses shared textures/samplers, then it uses `Display::mManagersMutex` root as its root. Performance in Single/Shared cases now will be the same, and it should be slightly faster then old Shared case (because of the reduced complexity). Bug: angleproject:8226 Change-Id: I7ca4d9ea008c665cbea98ace1c6e7bbc544f54b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632729 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 36c3e0f5 2023-01-17T17:42:59 Implement "Shared Context Mutex" functionality. Existing implementation uses single `GlobalMutex` for - EGL calls - GL calls for Contexts with concurrent access. This CL introduces abstract `egl::ContextMutex` with two implementations: - SingleContextMutex; - SharedContextMutex<Mutex>; Note: `std::mutex` is used in this commit. It is very easy to change mutex type either at compile-time or at run-time (single type per Display). When Context: - is not Shared; - does not use `EGLImage`s; - does not use EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE - does not use EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE then it will be using `SingleContextMutex` with minimal overhead. Before such Context is used as `shareContext` or uses `EGLImage` its mutex replaced by `SharedContextMutex<Mutex>`. The `GlobalMutex` is only used for EGL calls, while `egl::ContextMutex` implementations for GL calls. Because some EGL calls use Context, explicit `egl::ContextMutex` lock is required. This is implemented by generating "egl_context_mutex_autogen.h" header, and insertion of `ANGLE_EGL_SCOPED_CONTEXT_LOCK()` macro before `ANGLE_EGL_VALIDATE()` in each EGL entry point. Implementation in "egl_context_lock_impl.h" returns lock for required APIs. Special cases of `egl::ContextMutex` lock handled separately. `std::unique_lock<>` is not used for performance reasons. `egl::ContextMutex` explicitly locked when capturing EGL calls. Fixes EGLImage problem: https://chromium.googlesource.com/angle/angle/+/e18240d136d15e5cdfa4fa4a6355ca21c8d807b6 Mark contexts as shared when importing EGL images. Details: - EGLImage inherits Context's mutex when created. Mutex is used when the EGLImage accessed or destroyed. - When EGLImage is used in Context with other `egl::ContextMutex`, two mutexes are merged into one. - After the mutex merge, Context Groups will remain separate, but will not be able to run in parallel. Fixes race when checking `context->isShared()` in the `SCOPED_SHARE_CONTEXT_LOCK()` macro. One Context may start executing GL call while not "Shared", but become "Shared" inside the call. New (second) "Shared" Context may immediately start using GL and potentially corrupt some "Shared" state. Possible performance benefit: allows parallel execution in some cases, when single `GlobalMutex` would block. Important note: Process of replacing the `SingleContextMutex` by `SharedContextMutex<Mutex>` is not 100% safe. This mean that original Context may still be using `SingleContextMutex` after activating `SharedContextMutex<Mutex>`. However, this was always the case before introduction of this CL. Old `Context::mShared` member update was not synchronized in any way at all. In other words, this solution does not 100% fix the original problem. For 100% safe solution `SingleContextMutex` should not be used (always pass `SharedContextMutex<Mutex>` to the `gl::Context` constructor). See `lockAndActivateSharedContextMutex()` for more details. CL adds new build option: angle_enable_shared_context_mutex = true Behavior with other build options: - When: `angle_enable_shared_context_mutex` is disabled or `angle_enable_share_context_lock` is disabled or `angle_force_context_check_every_call` is enabled, Contexts will always have `SingleContextMutex`, however it will be only used in special cases. `SCOPED_SHARE_CONTEXT_LOCK()` will use `GlobalMutex` when applicable. - Otherwise, `SCOPED_SHARE_CONTEXT_LOCK()` will use `egl::ContextMutex`. Some GFXBench "1080p Driver Overhead 2 Offscreen" performance numbers. Tested on S906B (Samsung Galaxy S22+) on old ANGLE base: https://chromium.googlesource.com/angle/angle/+/807c94ea85e046c6f279d081d99f0fb1bcf1191a Capture/Replay: Adjust tests do adhere to capture limits Each test result is an average frame number from 6 runs. SingleContextMutex 6579 ( +0.13%) (old) GetContextLock() (mShared is false) 6570 Forced `mShared = true` or NOT using `SingleContextMutex`. SharedContextMutex<std::mutex> FORCE 5061 (-22.97%) (old) GetContextLock() FORCE 4766 (-27.46%) Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Idcd919f9d4bf482b9ae489bd8b4415ec96048e32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 1633a1bb 2023-02-17T15:16:06 Fix EGLImage importing problem Chrome DrDC uses EGLImage to share textures between contexts. Sometimes, chrome will create texture with a GLES 3.x context, and then create EGLImage from it, and then import EGLImage to a GLES 2.0 (WebGL 1.0) context. In this case, ANGLE may report errors if the original texture is created with formats which are not supported with GLES 2.0, but actually the texture can be sampled and rendered by ANGLE. Fix the problem by adding mIsTexturable & mIsRenderable in Image, and calculating them against the original context which owns the texture. Bug: chromium:1417294 Change-Id: I4c304422f0d0fc01a48c942d05758f8c2ce438e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4265252 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 046db15c 2023-01-16T15:25:33 Vulkan: Remove redundant ImageState::sourceType It was the same as ImageState::target Bug: angleproject:7962 Change-Id: I0ed95deaa23087abbe975a99304bae6ea515ab7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4168455 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3886af6e 2023-01-16T15:17:40 Vulkan: Generalize AHB optimization prohibitions ... to all external images. Bug: angleproject:7962 Change-Id: Ib8e090b995330b651865953057869adb4d14c83b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169559 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya 90b6d511 2023-01-13T10:06:12 Vulkan: Add support for AHB usage FRONT_BUFFER flag AHB usage flags have been updated to include front buffer usage. AHBs tagged with this flag need to be handled similar to single-buffered window surfaces especially w.r.t glFlush semantics. Account for the new usage flag when deferring flushes. Bug: angleproject:7956 Test: Android VTS GraphicsFrontBufferTests.* Change-Id: I79440d8447ac569c3d785de191815d2d2f3f069f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4167063 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao b19d17b8 2022-12-09T14:38:08 Vulkan: Split Serial class into UniqueSerial and Serial This CL splits Serial class into two classes: UniqueSerial and Serial. UniqueSerial supports the object unique serial usage where there is == and != operator but no > or < comparison. UniqueSerial can have invalid value, but Serial will not have invalid value (in next CL). The main reason is for next CL we can further optimize out the invalid value check in the QueueSerial comparison. Bug: b/262047600 Change-Id: Ieaed2a0d5546b012a6d63aa18b6006595e4aee1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4093557 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill 0d203aef 2022-10-16T10:08:01 EGL: Add ID types for egl::Surface and egl::Image. This is in preparation for using resource maps for Context, Surface and EGLImage. The map change will make it much easier to work with the trace fixture. It will also have a small benefit in safety as we will longer be casting raw pointers for these types. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. Bug: angleproject:7758 Change-Id: Ib1d19622a4f2a6f0458cc28f5bbe30bb9f349b98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957163 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 44791792 2022-08-12T00:13:45 Use angle::FlatUnorderedSet for ImageSibling::mSourcesOf As my test with Chromium on Android, ImageSibling::mSourcesOf only contains one item, so change it to angle::FlatUnorderedSet with default size 2. Bug: chromium:1336126 Change-Id: Ie1ba3ebb195170ad5c9f4713b599a91de5052702 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3828444 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 61a17ba9 2022-08-11T11:23:10 Use angle::FlatUnorderedSet for ImageState::targets In mose cases, chrome only needs 1 or 2 targets for an EGLImage, so using angle::FlatUnorderedSet with 2 default size instead of the std::set for targets. Bug: chromium:1336126 Change-Id: Ieff3cfbd5d020fda3aaecb162ddb354def14d962 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827681 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang c0818a18 2022-08-02T16:20:21 Protect ImageState::targets with a std::mutex The ImageState::targets could be accessed cross shared groups, so it is not protected by share context lock, so we have to protect it with this std::mutex. Bug: chromium:1349118 Change-Id: I886eed7a7405d01f01f1806b4d71db79d449e421 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3804750 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org>
Yuxin Hu 4c5e9d47 2022-06-21T17:12:56 Do not defer clear if FBO attachment is AHB image When application uses Android Hardware Buffer (AHB) image as the Framebuffer Object (FBO) attachment, it is possible the app doesn't call glReadPixels to fetch the FBO color. In this case deferred clears will not be flushed when the app reads the FBO pixel color, and the app will read the old FBO color. This CL fixes the issue by flushing the glClear calls immediately when any of the FBO color attachments is AHB image. Bug: b/236394768 Bug: angleproject:7458 Change-Id: I9151ab57750007c4ac18af39c3fa4abe752ede5e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3715851 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 2dd13ebb 2022-04-21T11:25:00 Track Surface color & depth/stencil init separately. This clears up some trace testing confusion due when robust resource init is enabled, and the app clears color but not depth on the default surface. Bug: angleproject:7221 Change-Id: Id97871aec32ad831b663aaa9116e04b582ab5a36 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 078da78f 2022-03-17T13:06:58 Vulkan: Support GL_EXT_EGL_image_storage extension This extension provides a mechanism for creating texture objects that are both EGLImage targets and immutable and removes the possibility of implicit orphaning. EGL images created from external sources now support types other than 2D. Tests covering the new feature were added to ImageTest.cpp. Bug: angleproject:6346 Change-Id: Id3e328f352deb1af47062be232384229a8b1c341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530489 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Peng Huang e00ad443 2021-11-15T20:16:16 Add EGL_ANGLE_vulkan_image extension This extension is for exporting VkImage from EGLImage. The VkImage must be used with the same VkDevice used by ANGLE Vulkan backend. Bug: chromium:1264439 Change-Id: I222d900465cf2716d94fc64f06e240390ec518ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3285025 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Geoff Lang a8000240 2021-10-05T13:12:22 Don't release EGLImage refs until backends are respecified orphanImages is called before impl methods to respecify textures and renderbuffers. This can cause the backend objects to reference deleted images. TextureVk::handleImmutableSamplerTransition is one such function that is called using "previousImage". Fix this by having orphanImages return a RAII object that deletes the image when the caller chooses. In this case, after the impl methods have been called to respecify the backend data. Bug: b/194432407 Change-Id: Ifb265b4409ba43478731a1701e2409f089976b1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3206430 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jeff Vigil 6136620b 2021-03-25T15:43:06 Reland "EGL: GLES: Implement GL_EXT_protected_textures" This is a reland of 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa This removes changes in gl backend. Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: Id36d697c53afc0f0dadf92bda4565f9157f4fc2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076825 Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c408926f 2021-07-22T12:00:59 Revert "EGL: GLES: Implement GL_EXT_protected_textures" This reverts commit 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa. Reason for revert: Suspected for breaking ANGLE->Chrome roller. Bug: angleproject:6204 Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:3965 Change-Id: Ia3ef260a17097b474189ccad5b235a9db99ee00b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3043889 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jeff Vigil 6210a9b3 2021-03-25T15:43:06 EGL: GLES: Implement GL_EXT_protected_textures Implement EGL_EXT_protected_content Images Add protected member to Images and Textures Add error when creating objects if not supported or does't match native buffer When creating siblings pass protected state Add extension caps Add Validation Add GetTexParameter and SetTextparameter Add protected to Texture and state Expand tests for images and textures Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 185d9d08 2020-08-14T22:48:15 Re-land "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." Re-land fixes the crash when drawing with no bound Program executable. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: If2bd25b08298a99f5e64b4055137f9154b0f0860 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365595 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Khushal f6fb6da8 2020-08-19T21:04:35 Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." This reverts commit 699bcde0b729853f33474941a313f6d5c9e63faf. Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240 Original change's description: > Feedback Loop Redesign 2/3: Track bound FBOs in Texture. > > Currently we track feedback loops by counting the times a Texture is > bound as a sampler or image in a particular context. This is a bit > tricky because Texture bindings change frequently. Relative to the > number of times we need to check for a feedback loop this causes excess > overhead. > > Usually Framebuffers have a low number of Textures bound (in many cases > just 1). And Textures aren't usually bound to many different FBOs. So > instead of counting the number of times a Texture is bound as a sampler > or image we will track the Framebuffers that the Texture is bound to. > > This CL adds a small vector class to gl::Texture which tracks all the > Framebufer Serials of its bound Framebuffers. We can use this set to > quickly check if there's any potential feedback loop between the a FBO > and this Texture. > > We also update the feedback loop check to use this new method. We will > be able to remove the old counting method when we switch the Vulkan > feedback loop handling to use the new tracking in this CL. > > Bug: angleproject:4500 > Bug: angleproject:4959 > Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 > Reviewed-by: Tobin Ehlis <tobine@google.com> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,courtneygo@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4500 Bug: angleproject:4959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077 Reviewed-by: Khushal <khushalsagar@chromium.org> Commit-Queue: Khushal <khushalsagar@chromium.org>
Jamie Madill 699bcde0 2020-08-14T22:48:15 Feedback Loop Redesign 2/3: Track bound FBOs in Texture. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya daed369c 2020-05-05T14:24:26 EGL: Add support for GL_EXT_EGL_image_array extension Add support for creating 2D array EGLImages. 2D array textures are core in GLES3.0. Enable the eglImageArray bool that controls exposure of the extension for all contexts >= GLES3.0 Bug: angleproject:4604 Tests: angle_end2end_tests --gtest_filter=ImageTest.*2DArray* Change-Id: Iebc1ad184fe7209ca89d620290337438ac251c56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2176109 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 1fc354fa 2020-04-22T11:49:00 Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages." Re-land fixes ASSERT on Android GLES. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I91d31213b115a58546b574caa574eebbb098266c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 623d0443 2020-04-21T15:15:03 Revert "Vulkan: Forward RenderBuffer/Surface dirty messages." This reverts commit 3fb33ade6ec8f286797bff5645304df580b1a963. Reason for revert: Causing WebGL test failures on GLES/ANGLE/Android. Bug: chromium:1072739 Original change's description: > Vulkan: Forward RenderBuffer/Surface dirty messages. > > Previously we were only forwarding Texture staging changes to the > Framebuffer for re-sync. We could miss out on clears that were staged > in Surfaces and Renderbuffer attachments. Complete the chain by making > the SurfaceVk and RenderbufferVk forward notifications from the > VkImage. > > Bug: angleproject:4517 > Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4517 Change-Id: I4fd4d79dc11da0ba86065d3a80975de4c791a2a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3fb33ade 2020-04-09T15:27:12 Vulkan: Forward RenderBuffer/Surface dirty messages. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya dac5cc3b 2020-04-08T18:26:46 EGL: Add support for EGL_EXT_image_gl_colorspace extension Add support for creating images with custom colorspace. Bug: angleproject:3756 Tests: angle_end2end_tests --gtest_filter=ImageTest* Change-Id: I9c332c012541c094728d9d9bde7add4189084a33 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2104088 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 44168468 2019-06-20T09:50:23 Vulkan: Sync image in TextureVk::syncState. We can use the DIRTY_BIT_IMPLEMENTATION internal dirty bit in the gl::Texture class to force calls to ContextVk::syncState. In syncState we can ensure we call ensureImageInitialized before we get to the ContextVk. This in turn means we can remove some of the command graph breaks from TextureVk. We need to make sure the dirty bits are propagated to EGL Image siblings with this method. This fixes a potential implementation issue with EGL images with the GL back-end. Also makes a state change test a little better by removing some of the VAO and program init calls before the draw. Improves perf on the texture change microbenchmark by 12.5%. Bug: angleproject:3539 Bug: angleproject:3117 Change-Id: I2b5481690801fa98f859a6c02e3f4b974590cd3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663839 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang fe59f6b5 2019-01-16T09:34:30 Vulkan: Implement EGL Images for 2D and Renderbuffer sources. No support for non-zero mipmaps as sources yet. Suppress dEQP tests due to apparent driver bugs with scissored clears on depth or stencil attachments. BUG=angleproject:2668 Change-Id: Idaa5e70ce9b0c91232fbb989cbf4de1b9134aafb Reviewed-on: https://chromium-review.googlesource.com/c/1415010 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ab2bfa81 2019-01-15T19:06:47 Enable Chromium clang style plugin for libANGLE. This fixes a few style warnings: * auto should not deduce to raw pointer type * inlined virtual methods are not allowed * non-trivial constructors and destructors should be explicit * inlined non-trivial constructors should not be in-class * missing override keywords Bug: angleproject:3069 Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53 Reviewed-on: https://chromium-review.googlesource.com/c/1407640 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Jamie Madill 666818ea 2018-11-14T09:54:33 Use angle::Result in front-end (Part 8) Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Jamie Madill 1c7f08c3 2018-10-10T16:13:02 Inline RefCountObject::release. Also don't return errors from the object release methods. Not returning errors reduces the amount of code generated. Also we shouldn't be exiting early from destructor type functions. Increases object binding performance. Bug: angleproject:2877 Change-Id: Ieb8120d885b946915e355419825e1f52f31d7b49 Reviewed-on: https://chromium-review.googlesource.com/c/1270218 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 2eb54074 2018-08-22T16:41:26 Fix EGLImage pixel format validation This fixes the scenario when EGLImage source and target have different types. For example, a texture is created with unsigned format using glTexImage2D, it is used as a source of EGLImage with eglCreateImageKHR, and then the EGLImage is used to create a renderbuffer target with glEGLImageTargetRenderbufferStorageOES. OES_EGL_image doesn't specify what should happen in this case, but GL implementations (Nexus 5X) seem to allow using this renderbuffer in glFramebufferRenderbuffer and the resulting framebuffer is complete. Thus, in this case, instead of checking whether the renderbuffer format can be used in glFramebufferRenderbuffer, we need to check whether the original texture can be used in glFramebufferTexture2D. Similarly in reverse direction. Also, for the case of source renderbuffer and target texture, presume that glEGLImageTargetTexture2DOES will succeed regardless of renderbuffer format. 1. Add isRenderable and isTexturable checks to egl::Image class, and perform different checks depending on source type. 2. Add isRenderable check to FramebufferAttachment and delegate EGLImage attachments check to egl::Image. 3. Use these checks in validation of EGLImageTargetTexture2D, EGLImageTargetRenderbufferStorage and when checking attachment completeness Bug: angleproject:2567 Change-Id: I8e9f4a2930a4075a4d8464f62582c6825270187e Reviewed-on: https://chromium-review.googlesource.com/1192585 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@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 0bc81b6c 2018-07-30T13:34:50 Store egl::Image size/format information at initialization time. This avoids potential null-dereferences on the source if it is orphaned. BUG=angleproject:2668 Change-Id: I5d591a941d114bb231044572a31a8c43cf3a9c4f Reviewed-on: https://chromium-review.googlesource.com/1155104 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
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>
Jiawei Shao a8802477 2018-05-28T11:17:47 ES31: Implement FramebufferTextureEXT on OpenGL back-ends This patch intends to implement FramebufferTextureEXT on OpenGL back-ends. 1. Support layered framebuffer attachments. 2. Add new framebuffer completeness rules on layered framebuffer attachments. 3. Support FRAMEBUFFER_ATTACHMENT_LAYERED_EXT as a valid <pname> parameter of GetFramebufferAttachmentParameteriv. Note that for an entire level of a cube map: 1. It has no TextureTarget because TEXTURE_CUBE is not a valid target for TexImage*D. 2. It corresponds to 6 ImageDescs (that represents its faces) in class Texture, so when the cube map is cube complete, we return the ImageDesc of its first face, meanwhile we do not allow querying ImageDesc if it is not cube complete. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.geometry_shading.query.framebuffer_attachment_layers dEQP-GLES31.functional.geometry_shading.query.framebuffer_incomplete_layer_targets dEQP-GLES31.functional.geometry_shading.layered.* dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_* dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_* Change-Id: I44393b513ec8f1a682fd1c47d3eaa6f3b3fae877 Reviewed-on: https://chromium-review.googlesource.com/1075811 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@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>
Jamie Madill 05b35b21 2017-10-03T09:01:44 D3D11: Lazy robust resource init. This patch moves the robust resource init logic to the GL front-end. Instead of initializing texture resources immediately on creation in D3D11, it defers the clear until before a draw call in some cases, or skips the update if we can determine if a texture (or other resource) has been fully initialized. Currently lazy init is only implemented for Textures, Renderbuffers, and Surfaces. Various places where lazy resource init is triggered: * Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels) * Texture operations (SubImage, GenerateMipmap, CopyTexImage) Some efficiency gains remain to be implemented, such as when a SubImage call fills the entire object. Similarly for Blit, and a few other operations. In these cases we can skip lazy init as an optimization. Edge cases with EGLImage are mostly untested. BUG=angleproject:2107 Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8 Reviewed-on: https://chromium-review.googlesource.com/576058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@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 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>
Frank Henigman aa7203ef 2017-05-03T23:32:29 Inherit privately from angle::NonCopyable. Make all inheritance from angle::NonCopyable private so the compiler complains about this (admittedly unlikely) code: class Foo: angle::NonCopyable { virtual ~Foo() { ... } }; angle::NonCopyable *p = new Foo; delete p; In the above code ~Foo() is not called, only ~NonCopyable(), because the latter is not virtual. Making it virtual would add overhead to all derived classes which don't already have a virtual method. Also tighten access in NonCopyable, because we can. BUG=angleproject:2026 Change-Id: Id0dc4d959cfb7bb82cf49382118129abb1d3a4f0 Reviewed-on: https://chromium-review.googlesource.com/495352 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill d75dd26c 2017-04-20T17:01:19 Make ImageSibling inherit from FramebufferAttachment. Only currently Renderbuffers and Textures can be bound with images. This makes the relationship explicit, and also ensures that an image sibling can determine if it's been initialized or not, which is important for the robust resource init extension with Textures and EGLImages. BUG=angleproject:1635 Change-Id: Ie05319cfbfda50f1497cab3f0b9ca64e1bff8955 Reviewed-on: https://chromium-review.googlesource.com/469154 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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>
Jamie Madill a3944d4f 2016-07-22T22:13:26 Add gl::Format to represent a texture/rb/surface format. This has a few advantages: it preserves all the information of the internal format, such as if it is sized or unsized. It also saves looking up the format multiple times in the table, which should improve speed in some cases. The extra sized-ness information will allow us to perform the correct validation in CopyTexSubImage calls. BUG=angleproject:1228 Change-Id: I42954771b0a9a968f5d787b8cf6e0af721791855 Reviewed-on: https://chromium-review.googlesource.com/362626 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 51706eae 2015-08-07T14:39:22 Make FramebufferAttachmentObject not refcountable Re-land with a fix for an unitialized variable Instead the refcount is done via callbacks. This allows Surface to ignore this refcounting which will be useful in a follow-up CL. BUG=angleproject:891 Change-Id: I1925ccaa4ce7b502b33088660d31c404b8313cb5 Reviewed-on: https://chromium-review.googlesource.com/293712 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 0020426e 2015-08-12T19:07:29 Revert "Make FramebufferAttachmentObject not refcountable" BUG= This reverts commit 19ba57469aa02074d094a9aef104f84d0b6d881e. Change-Id: I5dce6c8a81570e22affbcaf32183a97c97849718 Reviewed-on: https://chromium-review.googlesource.com/293351 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 19ba5746 2015-08-07T14:39:22 Make FramebufferAttachmentObject not refcountable Instead the refcount is done via callbacks. This allows Surface to ignore this refcounting which will be useful in a follow-up CL. BUG=angleproject:891 Change-Id: I39b028476e0e3ab1837c033e1121ea21e54d7970 Reviewed-on: https://chromium-review.googlesource.com/291651 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang a840617a 2015-07-21T16:53:39 Implement the egl and gl layers of EGL Image. Add end2end tests and unittests. BUG=angleproject:970 Change-Id: Ie8306971730a793f08dfd09ead1bfd6ff3e4623d Reviewed-on: https://chromium-review.googlesource.com/291260 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4274f7d2 2015-08-05T23:07:38 Revert "Implement the egl and gl layers of EGL Image." This reverts commit 22a4f38c2ca9ca430b5f976fc7fc816d88918eba. Change-Id: I07acbfe28d11675236de2ea7f6b050c25f80579a Reviewed-on: https://chromium-review.googlesource.com/290960 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 22a4f38c 2015-07-21T16:53:39 Implement the egl and gl layers of EGL Image. Add end2end tests and unittests. BUG=angleproject:970 Change-Id: I13fc501b24c3f11bfedc810c1ff80fcf1318877c Reviewed-on: https://chromium-review.googlesource.com/287343 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>