src/common/platform.h


Log

Author Commit Date CI Message
Roman Lavrov 1593390b 2025-04-07T11:22:21 Increase ANGLE_LIKELY/UNLIKELY probability to 99.99% I can't find the exact value for clang, but according to GCC docs __builtin_expect probability is assumed to be only 90%. When we actually bother to use ANGLE_LIKELY we mean "almost always", so this value can be much higher. Setting to 99.99% because lower values don't seem to trigger the optimization below (at least 99.9% doesn't) __builtin_expect already enables some optimizations such as moving unlikely branches (e.g. cold function calls) out of the primary flow. Increasing the probability enables more aggressive optimizations such as making those function calls store/load registers only in the rare cases when this call is made - which allows the rest of the caller to be made more efficient by not having to handle these register changes. Example: stur w4, [x29, #-0xc] stur x8, [x29, #-0x8] str x3, [sp, #0x8] stp w2, w1, [x29, #0x18] bl 0x356fdc <_ZNK2gl7Context25getActiveLinkedProgramPPOEv> ldp w2, w1, [x29, #0x18] ldr x3, [sp, #0x8] ldur w4, [x29, #-0xc] ldur x8, [x29, #-0x8] Bug: b/383305597 Change-Id: I077f4f2cb90cfb8282409d12adcb02c3302e7761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6437572 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5b343e8f 2025-03-11T11:35:08 Vulkan: Remove support for Stadia Bug: angleproject:42262714 Change-Id: Icae5fe828fe4e0bcd287d297df1bc586708ef86e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6344390 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Alexey Knyazev 57a3e9a7 2024-08-15T00:00:00 Prevent compilation with unsupported Apple SDK versions Bug: angleproject:360147119 Change-Id: Ie9924cb49ffa729d454a2869a2d19d957500bd10 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5793513 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Marcin Radomski b20cd34d 2024-07-18T10:03:17 Add build flag for a "dma_buf" Android build Add angle_android_dma_buf gn flag, defaulting to false. When enabled: - Enables a "linux-like" build of ANGLE while using the Android toolchain, by making the OS detection logic define PLATFORM_OS_POSIX but not PLATFORM_OS_ANDROID. - Makes ANGLE default to using Vulkan backend, and - Enables DMA-BUF based external image support. This allows setting up GL framebuffers backed by DMA-BUFs, enabling rendering without full Android graphics stack. See the bug for details. Bug: b/353262025 Test: treehugger Test: Build the entire CL chain with the new Soong config flag enabled Test: run the system, attach debugger to eglGetDisplay(), see Test: DisplayVkOffscreen getting instantiated Change-Id: I584f9491b188f730f4ee9630173cc486ae7e8908 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5729841 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Roman Lavrov 21fc5e87 2024-07-09T09:30:23 Move loadimage SSE includes/defines out of common headers Including x86intrin.h from common headers appears to be making the "include analysis" tool unhappy. Doesn't look like we actually need it, the only possibly relevant place I could find is the loadimage SSE implementation - but even that wasn't enabled outside of Windows anyways. It is not clear there is a need for the ANGLE_USE_SSE define in other places, at least not at this point. The current implementation also appears to be only for Windows. Move all related code to where it is used - loadimage implementation. Bug: angleproject:42266508 Change-Id: I1eac1510e7515cb6cc85c0332f5de91e0494d3da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5688790 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 0ad73958 2024-03-04T11:17:36 Deduplicate and fix ConstStrLen implementations Move multiple implementations to one angle::ConstStrLen. Some of the implementations were partially incorrect, too. Fixed: angleproject:8569 Change-Id: I760c173a5b75932f4ae2fabcc4916329247d3cb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5332384 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ec2603d6 2024-02-14T13:02:35 Fix build in absence of SSE support Bug: angleproject:8536 Change-Id: Ic74c775b9291fb6bb75adcaeeab0a5f01c2cfa3b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5296385 Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Lu Yahan 1bdb4038 2023-11-23T16:37:37 [riscv] Add riscv support Bug: angleproject:8423 Change-Id: Id1d9b06ff18985cb66a865477c30fdac8791e9de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5057086 Auto-Submit: Yahan Lu <yahan@iscas.ac.cn> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
L. E. Segovia ed391dae 2022-03-25T16:36:39 Replace `extern thread_local` to avoid GCC < 9.1 bug GCC generates broken code for mingw-w64 target when accessing `extern thread_local` variables from another compilation unit. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104862 See: https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0017-Replace-extern-thread_local-to-avoid-GCC-mingw-w64-b.patch Co-authored-by: Alvin Wong <alvinhochun@gmail.com> Bug: None Change-Id: Ief0036054e644d40b8b0e86ed990280e566da2a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637587 Auto-Submit: L. E. Segovia <amy@amyspark.me> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 3d17e9aa 2023-04-06T12:54:24 Add PLATFORM_IOS again ANGLE_PLATFORM_IOS means "iOS or MacCatalyst". Bug: angleproject:8121 Change-Id: I1482f44a106a1363623e2608b126ccde5548b81e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404162 Reviewed-by: Dan Glastonbury <djg@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen f507fe05 2023-04-06T12:27:00 Rename PLATFORM_IOS to PLATFORM_IOS_FAMILY The current define ANGLE_PLATFORM_IOS actually means "iOS or tvOS or WatchOS or MacCatalyst". The current define ANGLE_PLATFORM_WATCHOS means nothing. The current define ANGLE_PLATFORM_APPLETV means nothing. Replace PLATFORM_IOS and its uses with PLATFORM_IOS_FAMILY, so that then PLATFORM_IOS can be reintroduced and others can be fixed. Replace PLATFORM_IOS_SIMULATOR and its uses with PLATFORM_IOS_FAMILY_SIMULATOR for consistency. Use consistent `#if X` notation instead of `#if defined(X)`. Bug: angleproject:8121 Change-Id: Ibe668c2ae9bb801d15e036fcf1dfd53f22c30787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404161 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen c19b66f6 2023-04-06T11:30:03 EAGL: Define ANGLE_ENABLE_EAGL in build system ANGLE_ENABLE_EAGL is a "build system" decision. Set this and new variable ANGLE_ENABLE_CGL in BUILD.gn file. This is consistent with the other backends. Remove ANGLE_CPU_ARM64. This was used to do ANGLE_ENABLE_EAGL=TRUE when on Catalyst. Instead, let the build system set this. For ANGLE/Chrome buildsystem, this is not set, as Catalyst is not implemented. For WebKit, this should be set at WebKit build settings. Replace `defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)` with simpler expression: `defined(ANGLE_ENABLE_EAGL)`. Replace `defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_IOS)` with simpler expression: `defined(ANGLE_PLATFORM_APPLE)`. Bug: angleproject:8121 Change-Id: I3a0bbabb4347ad11f693e3f7c336ff12f66203d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404160 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Yuly Novikov cba2a0d5 2023-02-16T19:48:30 Keep MemoryBarrier macro defined Macro was originally undefined in crrev.com/c/361291. Undefining it breaks UWP build with newer compilers. Keeping the macro defined doesn't affect libGLESv2 exported symbols, so it looks like there is no need to undefine it. Bug: chromium:1380553 Change-Id: I6476aa015949e5f2639160fac80db39da710bfb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262071 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen e1d5d8c0 2023-01-26T16:06:14 Include stdint.h instead of cstdint in platform.h The project seems to expect use of stdint.h, since almost none of uint*_t, int*_t use are prefixed with std:: namespace. It is reasonable to expect a contract that platform.h includes some specific files from the standard library when it establishes the "platform for ANGLE". It appears that the contract kind of already includes stdint.h types or defines. Replace <cstdint> in platform.h with <stdint.h>. The file platform.h is included from many files, so those files do not need to include the stdint.h redundantly. Remove #include <stdint.h> from Constants.h, as that file already includes platform.h and <stdint.h> is part of the "platform". Bug: angleproject:7977 Change-Id: I04563eb3680bcd7470775e3a60b9f466a00b8b63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194174 Commit-Queue: Kenneth Russell <kbr@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Yan,Shaobo 2b6d7920 2022-09-20T10:26:23 Remove extra '# if defined(ANGLE_PLATFORM_WINDOWS)' This is a follow up CL of https://chromium-review.googlesource.com/c/angle/angle/+/3902853 The origin CL use defined(ANGLE_PLATFORM_WINDOWS) while it is already in the parent ANGLE_PLATFORM_WINDOWS block. This CL fix this issue. Bug: angleproject:7669 Change-Id: Ice23577c4582fa68f9bd475c8cdb388c6d9e7b04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3906955 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shaobo d63fdfa5 2022-09-19T09:33:47 Include <windows.h> to build vulkan only ANGLE on Windows When building ANGLE with vulkan backend only on windows, the compiler may throw error related to Windows SDK if developer has installed several windows sdk when compiling tests/test_expectations/GPUTestConfig.cpp and tests/test_utils/third_party/vulkan_command_buffer_utils.cpp. The build prviously works because we has opengl or d3d11 backend built together on windows. And the wgl source code includes <windows.h>. To fix this issue, this CL include <windows.h> in platform.h when vulkan backend is enabled and the platform is windows. Bug: angleproject:7669 Change-Id: I66f1bbdbd7b5da32c63b71224b442dfeb8e97467 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3902853 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang c07df6fe 2021-12-17T20:11:52 Disable vulkan device select layer for msan build The vulkan device select layer is not built with chrome, so this layer is not built with msan. So loading this layer will cause MemorySanitizer errors. Those errors are false positive. So disable it for msan build. Bug: chromium:1259170 Change-Id: I513d6dd3d4fbc16c62aaa3aa1e7cf299e3e4144a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3347143 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
John Cunningham 42bd4fc2 2021-12-10T14:58:17 Metal: add ANGLE_metal_create_context_ownership_identity. This Metal-specific EGL extension allows a given context and the GPU resources it allocates to be associated with a particular task ID on the system, for system-level bookkeeping purposes. Bug: angleproject:6795 Change-Id: I19ee0993564169b01c4a450e63dcfacd339b98b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335172 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jamie Madill 14f55a7f 2021-11-02T10:16:58 infra: Enable TSAN and UBSAN tests. These tests are not yet enabled on the CQ. Bug: angleproject:5795 Change-Id: I3fc58ab800ebbc0840da8221b03b4ab145d28028 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3258003 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 2a9e6e48 2021-11-01T15:56:54 infra: Add tests to ASAN configs. These add basic ANGLE tests with SwiftShader + ASAN. Bug: angleproject:5795 Change-Id: I92a51a44214ff0f442d4a1b2a0bc6ac2b8d3f4eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3254431 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Bruce Dawson fbf8d1ea 2021-10-07T13:53:05 Remove windows.h from common/platform.h Windows.h is expensive and causes lots of namespace pollution with the macros that it defines. This change removes windows.h from platform.h and debug.h and adds the necessary typedes and new include of windows.h to let Chromium build. This reduces the number of Angle translation units that include windows.h by about a third, from 624 to 440. Significant further reductions will be difficult because of translation units that genuinely need windows.h. Earlier versions of this change made it clear that the DeleteFile and GetCurrentTime macros were renaming Angle functions. These angle functions were renamed which makes this change much simpler. Bug: angleproject:6283 Change-Id: Icddc8f98b19485e563b2cf616bba2ad4ea49228e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212639 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Gilbert afda22b0 2021-07-19T16:46:50 Define ANGLE_IS_64_BIT_CPU in common/platform.h. This is more reliable and reduces reliance on build flags. Vendoring into Firefox, it's not trivial to replicate build flags, but C++-native checks always work. Bug: angleproject:6186 Change-Id: Idafd4ef1954efbfa79eae86cddfaa8f2e3992296 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036589 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Kyle Piddington d7aa0130 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile translator. This change is meant to merge the translator changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the translator code in a state that compiles, but not to switch the Metal backend over to use this translator backend yet. Bug: angleproject:5505 Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
John Plate a2ade894 2021-04-13T21:12:26 Clear macros 'NEAR' and 'FAR' Bug: angleproject:5861 Change-Id: Id4cccf5e06dd39c37bd4fa23965edd31633b0fef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2824429 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: John Plate <jplate@google.com>
James Darpinian e53efb18 2020-11-03T16:22:19 Allow choosing EAGL or CGL at runtime Dean Jackson made this change downstream in WebKit: https://bugs.webkit.org/show_bug.cgi?id=216722 Change ANGLE to dynamically load either EAGL (OpenGLES) or CGL (OpenGL) depending on both compile and runtime configurations. Intel Mac -> CGL Intel Mac Catalyst -> CGL Intel iOS Simulator -> EAGL iOS Device -> EAGL Apple Silicon Mac -> CGL Apple Silicon Mac Catalyst (with Mac app) -> CGL Apple Silicon Mac Catalyst (with iOS app) -> EAGL The trickiest bit is Apple Silicon Mac Catalyst, which depends on the type of the application it is attempting to run. In that case ANGLE must compile both the CGL and EAGL interfaces and then pick one to use after launch. Bug: angleproject:5253 Change-Id: Iba167b3cc3105e457dcfc9bc14147d0fc3e70bac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2500185 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kenneth Russell 12ce8f68 2020-01-03T16:40:06 Upstream WebKit's iOS port of ANGLE. Added the EAGL backend authored by Dean Jackson from Apple, and the refactoring changes needed to support it side-by-side with the macOS backend. Ran "git cl format" against these diffs. Defined the EGL_ANGLE_device_eagl extension and allocated an enum out of ANGLE's reserved range. The iOS backend is not yet included in any of the GN files. Bug: angleproject:4263 Change-Id: I631c32930433c03bb16a242955ffedf55174bb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jamie Madill 5407aaa0 2019-12-16T15:50:12 Re-land "Add new test runner harness." (#2) Re-land #2 changes: * export labels are fixed for the CFI build * crash test disabled because of flakiness and issues with asan Re-land changes: * Unit test is suppressed in ASAN * --deqp-case is fixed * Debug layer errors should correctly work with failure expectations Original message: The ANGLE test harness is a harness around GoogleTest that provides functionality similar to the Chromium test harness. It supports: * splitting a test set into shards * catching and reporting crashes and timeouts * outputting to the Chromium JSON test results format * multi-process execution Unit tests are added in test_utils_unittest.cpp. Bug: angleproject:3162 Bug: chromium:1030192 Change-Id: I71d66a407ea0e53d73cbe75b5b4bfb9e73791534 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965091 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill b92ec244 2019-12-06T15:08:54 Revert "Re-land "Add new test runner harness."" This reverts commit e20560faf1de86c01198143ef7733a12a098a90b. Reason for revert: Now fails on Linux CFI and also is a bit flaky. Original change's description: > Re-land "Add new test runner harness." > > Re-land changes: > > * Unit test is suppressed in ASAN > * --deqp-case is fixed > * Debug layer errors should correctly work with failure expectations > > Original message: > > The ANGLE test harness is a harness around GoogleTest that provides > functionality similar to the Chromium test harness. It supports: > > * splitting a test set into shards > * catching and reporting crashes and timeouts > * outputting to the Chromium JSON test results format > * multi-process execution > > Unit tests are added in test_utils_unittest.cpp. > > Bug: angleproject:3162 > Change-Id: I841f2b5dfe51f7f44dac68324bdf6afd418b8bfb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948240 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=ynovikov@chromium.org,ianelliott@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ibfd65b8b18ead3a232abb6cb75fd6489b0ff5f38 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954570 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e20560fa 2019-12-04T13:18:36 Re-land "Add new test runner harness." Re-land changes: * Unit test is suppressed in ASAN * --deqp-case is fixed * Debug layer errors should correctly work with failure expectations Original message: The ANGLE test harness is a harness around GoogleTest that provides functionality similar to the Chromium test harness. It supports: * splitting a test set into shards * catching and reporting crashes and timeouts * outputting to the Chromium JSON test results format * multi-process execution Unit tests are added in test_utils_unittest.cpp. Bug: angleproject:3162 Change-Id: I841f2b5dfe51f7f44dac68324bdf6afd418b8bfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948240 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
James Darpinian 012d1519 2019-10-31T16:50:23 Stop using __has_include<Cocoa/Cocoa.h> __has_include seems to cause problems with goma builds. Instead, detect iOS vs MacOS using TargetConditionals.h. Also use plain C++ instead of Objective-C++ when possible. Bug: angleproject:3439 Bug: 1015591 Change-Id: I816624e0cdc54ad3a18d3891b4efecf6fe640574 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1894243 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Jamie Madill c898ec1a 2019-11-04T15:20:18 Add EGL GGP extensions. This CL adds two new extensions: * EGL_ANGLE_ggp_stream_descriptor: Introduces a new attribute to CreateWindowSurface. Allows the app to pass in a stream descriptor to VkCreateSurfaceKHR. Mirrors VK_GGP_stream_descriptor_surface. * EGL_ANGLE_swap_with_frame_token: Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This allows the app to pass a GGP frame token down to vkQueuePresentKHR. Mirrors VK_GGP_frame_token. Bug: angleproject:4078 Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Nathan Zabriskie 5d9c4ee3 2019-09-17T15:36:25 Add D3D11on12 device option This CL adds a new D3D11on12 device option which runs the D3D11 API on top of D3D12. This is done to aid in preliminary investigations into the feasibility of creating a full D3D12 backend implementation. Bug: angleproject:3919 Change-Id: I0ad4250eb3c93b0b74274c904aac74f03753c7ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814404 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 11dc1635 2019-09-18T14:46:23 Add support for generating UWP (Windows Store) projects again Until late 2017, ANGLE supported Windows Store apps on Windows 8.1, Windows Phone 8.1, and Windows 10 (via the Universal Windows Platform, aka UWP). Unfortunately ANGLE deprecated support for Windows Store when it switched from GYP to GN in 2017. Since then, users have been able to use Microsoft\angle for their UWP apps but this isn't ideal since it's based on a 2017 copy of Google\angle. This PR bring back support for UWPs, so that UWP users can use Google\angle again. Specifically it: - Adds support for generating UWP projects via GN - Adds helper/util functions specific to UWP (they're mostly similar to the desktop Windows helpers) - Fixes some existing Windows Store code that's rotted since 2017 - Disables async shader compilation for UWPs, since its implementation calls wait on the UI thread (which is forbidden in UWPs) - Renames 'ANGLE_ENABLE_WINDOWS_STORE' to 'ANGLE_ENABLE_WINDOWS_UWP', since ANGLE only support UWPs now - Fixes misc other related issues (such as dependencies on D3D9 headers in API-agnostic code) Note that this doesn't bring back support for Windows/Phone 8.1. BUG=angleproject:3922 Change-Id: Ia79ae05a5e0e0a0625eb633bf1928722dfd3e85f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1811871 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
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>
Jamie Madill 7fa8824b 2018-11-26T13:22:57 Update clang-format settings. To allow for extern "C" declarations to not break on a brace. This preserves the current code style. Also add indented preprocessor definitions. This makes the formatting of "platform.h" much nicer. Bug: angleproject:2971 Change-Id: I392babe0c8d67539a8e026a36a023a7404bb63c2 Reviewed-on: https://chromium-review.googlesource.com/c/1347452 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jeff Gilbert c0b82333 2018-09-26T18:04:05 Polyfill BitCount for ARM/ARM64 on MSVC. Also _WIN64 implies _WIN32. Bug: angleproject:2858 Change-Id: I63e2ffd2e9e304171ea6adb99836733981cc1813 Reviewed-on: https://chromium-review.googlesource.com/1248441 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Thomas Miller cb4ae446 2018-08-02T08:19:09 Make Angle compile for Arm64 Windows Change-Id: Iee947a5abf4a833f155f7cb100577c92323a34e5 Reviewed-on: https://chromium-review.googlesource.com/1160863 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 7b19a49b 2018-04-20T09:31:52 Use LIKELY and UNLIKELY macros to wrap error generation. BUG=609673 Change-Id: I247f561712e30aa10bad77fabf614501d596915e Reviewed-on: https://chromium-review.googlesource.com/1021995 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4fba4a97 2017-12-05T10:36:05 Include the D3D11 headers on Windows when OpenGL is enabled. The OpenGL backend on Windows uses D3D11 to implement several interop extensions. Without this change, there are compile failures when the D3D11 backend is disabled. BUG=angleproject:2276 Change-Id: I69ad524ca84aa0aa399cfc0b601315f3ee65ed16 Reviewed-on: https://chromium-review.googlesource.com/809186 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Tom Anderson 23cd4add 2017-11-10T14:54:37 Add missing include to stddef.h on arm Change-Id: I28771a550a3188993635f55803093fc49590ceb1 Reviewed-on: https://chromium-review.googlesource.com/764887 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e7c5f4f0 2017-10-30T07:16:43 Fix compilation on mips devices. We need to include stddef explicity for size_t. BUG=angleproject:2167 Change-Id: I66e75b8d29e94aa9b8427e39827a0267649bb0ec Reviewed-on: https://chromium-review.googlesource.com/743702 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev 74a0000f 2017-07-11T11:27:09 Request a D3D11.1 device and D3D11.3 context The patch extends Renderer11 so that a D3D11.1 device and D3D11.3 context can be created. This is necessary for using the D3D11.3 feature called VPAndRTArrayIndexFromAnyShaderFeedingRasterizer. BUG=angleproject:2062 BUG=angleproject:2145 TEST=angle_end2end_tests Change-Id: I84c761b2897d7d911686f5b6d79cb93e233015a0 Reviewed-on: https://chromium-review.googlesource.com/591448 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jerome Duval d2e87929 2017-07-12T15:42:34 Enable Haiku in platform-specific headers. 1. src/common/platform.h updated to define ANGLE_PLATFORM_POSIX on Haiku. 2. include/EGL/eglplatform.h updated to add stubs typedefs for platform-specific primitives for Haiku. Change-Id: I28775e909ad9cabec1c474ff4fe0a241eb05d6a1 Reviewed-on: https://chromium-review.googlesource.com/573022 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Sergey Ulanov 145e3cbb 2017-06-29T12:36:21 Enable Fuchsia in platform-specific headers. Two simple fixes to make libANGLE compile for Fuchsia: 1. Added stubs typedefs for platform-specific primitives in EGL/eglplatform.h for Fuchsia. 2. src/common/platform.h updated to define ANGLE_PLATFORM_POSIX on Fuchsia. Change-Id: I5f053de46632ac3f12bb93e57eeb94c3a34c867c Reviewed-on: https://chromium-review.googlesource.com/563758 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Brian Osman 63d82626 2017-01-06T14:05:18 Fix preprocessor typo for enabling Windows Runtime Library BUG=angleproject:530 Change-Id: Id93bd4f3f82bc0a6a0cbe4b55bc310d11266a2bd Reviewed-on: https://chromium-review.googlesource.com/425938 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 47c0e048 2016-11-30T13:44:45 Use ComPtr references for D3D objects. This is an work-in-progress CL to prototype using ComPtr. It also has a new design for internal errors that doesn't use FormatString, preferring a stream-based approach. One thing to be aware of is that the address operator does not behave as expected with ComPtr - we should use ::AddressOf. BUG=angleproject:530 BUG=angleproject:1644 Change-Id: If5643e9e5726fd9aa5cbd422fca12ae169eb5b1f Reviewed-on: https://chromium-review.googlesource.com/415027 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Martin Radev ee7e1e21 2016-07-18T15:39:47 Add ES31 entry points as function stubs Entry points were generated using scripts which take the new function declarations from gl31.h, find the newly added functions and output the new function declarations and defitions. BUG=angleproject:1442 TEST=angle_unittests Change-Id: I2d77eb4cc24873a31cb2745b7b82bf611d5058c6 Reviewed-on: https://chromium-review.googlesource.com/361291 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Geoff Lang 5695fc99 2016-07-05T14:47:30 Clean up the SSE detection logic. * Include the correct header right in the SSE check in platform.h. * Don't use separate SSE versions of the load functions, have them use SSE automatically. BUG=612205 Change-Id: I70f9a5513e144db4d16c1f3ad922debeb6c50268 Reviewed-on: https://chromium-review.googlesource.com/358108 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jacek Caban e842eabd 2015-03-26T16:50:35 Fixed compilation with mingw. Change-Id: I027cedc383efbd215e55a7ddf4e41eb1c368a1ae Reviewed-on: https://chromium-review.googlesource.com/262590 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jacek Caban <cjacek@gmail.com>
Austin Kinross 2bdcbb9a 2015-01-16T11:12:15 Enable Windows Phone 8.1 project generation Change-Id: Iab44f6d634bdcd01348aa49de28b96c3b6086df7 Reviewed-on: https://chromium-review.googlesource.com/241945 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Jamie Madill dd806c2b 2015-01-14T14:26:35 Use emmintrin.h for SSE includes. This header should work on all available platforms, instead of the platform-specific intrin.h or x86intrin.h. BUG=angle:773 Change-Id: Ia012053064838f9893aa647d872e136a47cfad1a Reviewed-on: https://chromium-review.googlesource.com/240552 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cooper Partin ffe38e1c 2015-01-14T08:32:19 Fixed WinRT ARM build break. ARM cannot use SSE. Change-Id: I9a55d37db148f82b255e2c7ff414e79259e2c4e1 Reviewed-on: https://chromium-review.googlesource.com/240476 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0875f85d 2015-01-12T16:27:11 Don't use SSE functions on Android. These methods are unavailable on ARM platforms. Also fix a sequencing bug that caused us to incorrectly define the Android platform as Linux. BUG=angle:773 Change-Id: Id2b47acdd5b574c618ac86641a1a8238fbb4a2c3 Reviewed-on: https://chromium-review.googlesource.com/240095 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 01675d80 2015-01-05T16:09:08 Use correct SSE header on OSX. This fixes the compile errors in loadImageSSE2.cpp. BUG=angle:773 This reverts commit a93192369eb448e932bcdd1e08ae791aacfbe0c4. Change-Id: I31bc419cd3930ae129903b935f49a3c9b27fc887 Reviewed-on: https://chromium-review.googlesource.com/238448 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kenneth Russell 0c219b81 2014-11-19T11:17:03 Trivial change to allow translator to be compiled via Emscripten. BUG=none Change-Id: Ifdb02d4b7c061f403f50d2e1fbea4ab117462475 Reviewed-on: https://chromium-review.googlesource.com/230813 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Kenneth Russell <kbr@chromium.org>
Austin Kinross 922a9fb3 2014-10-21T14:26:33 Use D3D11 Debug Annotations when D3D9 is unavailable Change-Id: I37ac5fe7f0b2fe5e71bd7f0afca55e9894f3463c Reviewed-on: https://chromium-review.googlesource.com/224512 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 570e83cf 2014-10-20T14:13:58 Rename ANGLE_ENABLE_PERF -> ANGLE_ENABLE_DEBUG_ANNOTATIONS Change-Id: I701cd5ee749797428171e9c58a46fce626b9a969 Reviewed-on: https://chromium-review.googlesource.com/223590 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Cooper Partin 88d3b8cb 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I6dd7fef72a73572d4a3deda7ce36a11da3a75c81 Reviewed-on: https://chromium-review.googlesource.com/224366 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e020bed5 2014-10-20T16:16:46 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" Causing regressions in the build: http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/20182 This reverts commit 756aebfc7afa6d0de14e96637ef396dd7b290c2d. Change-Id: I2f4bdb5aeb429c9bbc5e655a1761704f33737841 Reviewed-on: https://chromium-review.googlesource.com/224221 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 756aebfc 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I34e443b1e194800460e441ac6cee42cf68430564 Reviewed-on: https://chromium-review.googlesource.com/224302 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 8858cf0a 2014-10-17T20:53:32 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" due to build failures on Chromium FYI bots. This reverts commit 406a3be91cc8175df95bd390425e35830778f2d5. Change-Id: Ica2abd2e557a4fd9852d85b7fc018e3d272b6edf Reviewed-on: https://chromium-review.googlesource.com/224051 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Cooper Partin 406a3be9 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I9ad82b7819bcca1c05e7aa60dc2baec4a7bc403c Reviewed-on: https://chromium-review.googlesource.com/222360 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods fb839475 2014-06-16T13:21:41 Fix ifdef complaints in clang BUG=angle:677 Change-Id: Iee457dfc0990e5ffd61932b1f286f3c0208568bc Reviewed-on: https://chromium-review.googlesource.com/203427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Geoff Lang 44fa7594 2014-05-30T11:50:07 Refactor platform related functionality into platform.h and tls.h. Since libGLESv2 and libEGL will eventually be cross platform, it will be useful to have platform defines and TLS functions that work everywhere. BUG=angle:664 Change-Id: Ia357925a0992d82e8b446d88d32a1984d319e6e8 Reviewed-on: https://chromium-review.googlesource.com/202133 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>