src/common/angleutils.h


Log

Author Commit Date CI Message
Kyle Piddington f13f440e 2021-12-15T15:11:05 Reland: Metal: Fix Webkit warnings in ANGLE build Fix nullable warnings, unused functions Add in additional function specification to FormatStringIntoVector to correctly fix warning Bug: angleproject:6781 Change-Id: I26af2d698f14d353832802aa7b5ce34c5a1f4b95 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3366796 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Charlie Lao eca427b2 2021-12-20T10:55:41 Vulkan: Add mutex to protect mVirtualBlock mVirtualBlock could be accessed from multiple thread when asyncCommandQueue is enabled, where the free call could come from the submission thread. This CL adds a mVirtualBlockMutex in BufferBlock and always take the lock when mVirtualBlock is been accessed. This CL also adds ConditionalMutex class for the general usage that a mutex is only used based on a boolean. Bug: angleproject:6840 Change-Id: Ib647b4ff12ebfc08f2a70192d39f16e15a1fc5f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3350798 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
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>
Tim Van Patten ef65edf2 2021-11-22T14:23:35 Add extension: ANGLE_rgbx_internal_format Add the extension ANGLE_rgbx_internal_format, which exposes the ANGLE internal format GL_RGBX8_ANGLE. The format GL_RGBX8_ANGLE enables emulating RGB8 formats with RGBA8 within ANGLE. This also renames the format GL_RGBX8_ANGLEX to GL_RGBX8_ANGLE, since it's being exposed. Bug: angleproject:6690 Test: Texture2DTestES3.TextureRGBXImplicitAlpha1 Change-Id: I5548a3578a14e2f2a4006bbf59983b01f694b7f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3296625 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Stephen White 0b56267f 2021-11-02T12:25:40 Implement ANGLE_FALLTHROUGH macro. Use it instead of ABSL_FALLTHROUGH_INTENDED. (ANGLE shouldn't use absl unless angle_enable_absl is true. This is breaking the roll of ANGLE into Dawn.) Bug: angleproject:6647 Change-Id: I47f9a00841c4605fca52b17eeb68c0b1da5004c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3258008 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0004ecc2 2021-09-22T13:39:55 Write GL info to test artifact in end2end_tests. These will show up as glinfo.json in the "cas outputs" of the shard that runs these tests. We currently have information for Pixel 4, NVIDIA and Intel Win/Linux, and SwiftShader Windows. GLES 1.x extensions are treated separately. Some WebGL/Mac-only/D3D-only extensions show as unsupported anywhere. In order to capture artifacts on Android, we use a render test output parameter. Bug: angleproject:6379 Change-Id: I560b219b5a586cdbb68d272090f38eedc76aba20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3176780 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Alexis Hetu c0aa6108 2021-09-17T16:22:55 Add new GL_RGBX8_ANGLEX format Currently, IOSurface objects using {GL_RGB, GL_UNSIGNED_BYTE} are natively represented with GL_BGRX8_ANGLEX, which we use instead of other RGBA formats in order to avoid issues when a canvas uses 'no alpha': https://source.chromium.org/chromium/chromium/src/+/main:third_party/swiftshader/third_party/angle/angle/src/libANGLE/renderer/vulkan/mac/IOSurfaceSurfaceVkMac.mm;l=44 This unfortunately causes some other issues because of the implicit RGB <-> BGR conversion like type mismatches in subresource updates. This CL adds a new type, RGBX8, which will be usable by IOSurface objects and which behaves exactly like the BGRX8 format with the B and R channels flipped. Bug: chromium:1209250 Change-Id: I345eadc8addd05a0964cae30d89c20005479e37b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3188910 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 8f77e0bc 2021-07-29T15:54:26 Define angle::HashSet potentially using abseil Split change from CL using it for simplicity. Bug: angleproject:4889 Change-Id: Ie3e621dee624020581e9fd7679639332718948f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3061439 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya e66e3344 2021-07-12T13:28:54 Vulkan: Add GL_ANGLE_yuv_internal_format extension 1. Add a new extension to support creation of immutable textures with sized internal YUV formats 2. Rename YUV format enums from *_ANGLEX to *_ANGLE 3. Move YUV format enums from angleutils.h to glext_angle.h Bug: angleproject:5773 Change-Id: Ibfe732f4c9a4a536be56481f33e4768f6227c212 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2820153 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill a25f0f2c 2021-06-28T14:56:26 Suppress flaky TSAN TLS false positive. Introduces "ANGLE_NO_SANITIZE_THREAD" which works the same way as "ANGLE_NO_SANITIZE_MEMORY". Bug: chromium:1223970 Change-Id: I9409771f7c4748bbc186da3fc38031d3b1d1e4d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987875 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexis Hetu 84c42d1b 2021-05-26T12:30:10 Mute MSAN false positive MSAN currently detects false positives on global/static thread_local variables which are created at library load time. This CL mutes the false positive in order to unblock running blink_web_tests with SwANGLE on MSAN bots. Bug: chromium:1211047 Change-Id: I7cd103d470177d783df7f73ca6ceeedc0774b163 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2920486 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 9bc837f6 2021-04-07T15:24:12 Vulkan: Generate SPIR-V directly from the translator; Part 1 This is the first change in a series to generate SPIR-V directly from the translator's AST, instead of the generating text GLSL and feeding it to glslang. This change implements the majority of the work needed to map AST types to SPIR-V types, and declare types and interface variables in SPIR-V. Additionally, it lays the infrastructure to conditionally enabling this path in end2end tests. No tests are currently enabled as the change doesn't actually generate code for function bodies yet. Bug: angleproject:4889 Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya f54191ab 2021-03-25T12:27:02 Vulkan: Add YUV G8_B8R8_2PLANE_420_UNORM support. Add support for YCbCr_420_888 and YCrCb_420_888 formats, more commonly known as NV12 and NV21. Bug: angleproject:5773 Change-Id: I1568d543c221ad110e7f199eb2ffd5df23a6134e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2787251 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2e9161e4 2021-01-12T11:29:29 Vulkan: Add YUV G8_B8_R8_3PLANE_420_UNORM format. Bug: angleproject:5438 Change-Id: I525a51256a5ee83fa69c8705aa90790fb32a6602 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2623813 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexis Hetu f2a15485 2020-12-04T14:07:24 Suppress memory leaks detected by LSAN In order to be able to land SwANGLE in Chromium, this cl adds suppressions for memory leaks detected by LSAN. Some of these should be fixed and some are intentional leaks of global variables. This cl should allow the linux_chromium_asan_rel_ng bot to pass while using SwANGLE and shouldn't break the win-libfuzzer-asan-rel bot. Bug: chromium:972686 Bug: angleproject:5377 Change-Id: I7e2336aba43fcfeb95716d6c0aa05caf855134aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2575200 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Ian Elliott 51a0e95d 2020-12-04T16:34:53 Revert "Suppress memory leaks detected by LSAN" This reverts commit 2ded93db0a0d0767e6101dfaf738167ee406b2e6. Reason for revert: Appears to be breaking the ANGLE roll Original change's description: > Suppress memory leaks detected by LSAN > > In order to be able to land SwANGLE in Chromium, this cl adds > suppressions for memory leaks detected by LSAN. Some of these > should be fixed and some are intentional leaks of global > variables. > > This cl should allow the linux_chromium_asan_rel_ng bot to pass > while using SwANGLE. > > Bug: chromium:972686 > Bug: angleproject:5377 > Change-Id: I50a30e74a7d7c799c9dfa4d307792a56cb9d2017 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562748 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Alexis Hétu <sugoi@chromium.org> TBR=sugoi@chromium.org,syoussefi@chromium.org,jmadill@chromium.org,sugoi@google.com Change-Id: I2ab53f3ab89143ea639424f108c404f884c3aaf9 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:972686 Bug: angleproject:5377 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2574796 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Alexis Hetu 2ded93db 2020-11-27T11:15:55 Suppress memory leaks detected by LSAN In order to be able to land SwANGLE in Chromium, this cl adds suppressions for memory leaks detected by LSAN. Some of these should be fixed and some are intentional leaks of global variables. This cl should allow the linux_chromium_asan_rel_ng bot to pass while using SwANGLE. Bug: chromium:972686 Bug: angleproject:5377 Change-Id: I50a30e74a7d7c799c9dfa4d307792a56cb9d2017 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562748 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Trevor David Black e815afbf 2020-09-07T22:09:22 First pass at increasing inclusivity Link to the inclusivity rules https://source.android.com/setup/contribute/respectful-code Bug: b/162834212 Bug: chromium:1097198 Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Trevor Black <vantablack@google.com>
Tim Van Patten e78d9a61 2020-07-24T11:58:45 Convert unordered_map to absl::flat_hash_map for select files This is the initial CL to start migrating to abseil in various places: - formatutils.h - FramebufferVk.h - Program.h - ProgramExecutableVk.h - RewriteRowMajorMatrices.cpp This intentionally hits a couple different places in the code to make sure the abseil dependencies are added to the required targets. Bug: angleproject:4873 Change-Id: Idd6084dff2ebce47833f304c605bbf3151b97414 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2402382 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Geoff Lang 49108a12 2020-06-30T11:53:23 Support BGRA_1010102 IOSurfaces in CGL and Vulkan. Bug: chromium:1100599 Change-Id: I7bc2c2e35490e28e9f6fe8f2e0c26cdea50650b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2275731 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 71e6afb1 2020-01-14T14:12:31 Vulkan: Set set/binding in SPIR-V This change introduces a SPIR-V transformer that modifies shader interface variable decorations directly in SPIR-V instead of manipulating the input GLSL. Currently, descriptor set and binding indices are set by the transformer. The shader translator outputs arbitrary set and binding indices. Once compiled by glslang, the SPIR-V transformer modifies these decorations. The ultimate goal is to be able to modify the SPIR-V again when program pipeline objects decide a different set/binding is necessary. Bug: angleproject:3394 Change-Id: If358265a72bf1fe9f5676562b39a632cb2e05dc4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001477 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jaime Bernardo 755417dd 2019-09-30T17:53:56 GLES2: Use require_constant_initialization for g_Mutex A static assert to verify that the global mutex g_Mutex is trivially constructed fails to compile with clang when using the STL shipped with Visual Studio 2019. Use __attribute__((require_constant_initialization)) instead to verify for constant initialization. BUG=angleproject:3936 Change-Id: I5969762ad5a99033143513d7c4992344da276b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1832164 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya fea65766 2019-09-19T09:30:38 Vulkan: Add support for OES_vertex_type_10_10_10_2 - Add support to CPU/GPU convert vertex formats - Add test cases for type conversion in angle_end2end_tests - Fix a bug in shader script by adding a ceil when calculating bytes Bug: angleproject:3192 Test: angle_end2end_tests --gtest_filter=VertexAttributeTest*Packed1010102* Change-Id: I57bab9fc1c1041cd734746d0e52a33717b635ec0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1788495 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Jaedon Lee 3b46885e 2019-07-30T16:50:36 Vulkan: Implement EXT_texture_type_2_10_10_10_REV - Expose GLES 3.0 feature of 2_10_10_10_REV texture type on GLES 2.0 as EXT. - Handle alpha channel value as 1.0 when used with RGB format. - Add test for "RGB+UNSIGNED_INT_2_10_10_10_REV" case into TextureUploadFormatTest. BUG=angleproject:3232. Test: dEQP-GLES2.capability.extensions.uncompressed_texture_formats.GL_EXT_texture_type_2_10_10_10_REV dEQP-GLES2.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev dEQP-GLES3.functional.fbo.completeness.renderable.texture.*2_10_10_10_rev KHR-GLES2.core.internalformat.*2_10_10_10_rev* KHR-GLES3.core.internalformat.*2_10_10_10_rev* Change-Id: Iac00517971f9242161115c7256117a69093fb5df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1732618 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>
Tobin Ehlis 134425c7 2019-03-15T17:02:17 Vulkan:Integrate SecondaryCommandBuffers Integrate the custom SecondaryCommandBuffer type into the CommandGraph nodes by adding new ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS define that can be set in the BUILD gn args with angle_enable_custom_vulkan_cmd_buffers set to "true." Initially the custom cmd buffers are disabled by default. This adds some support functions to SecondaryCommandBuffer to make the integration easier by matching the wrapped cmd buffer interface: initialize(), end(), valid(). Bug: angleproject:3136 Change-Id: Ib910554583192550757bb8ce89914e3ea8737988 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1526556 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 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>
Shahbaz Youssefi a390ebd9 2018-10-18T13:04:40 Add compiler printf attribute to relevant functions Relands 27a472c60 with reinterpret_cast changed to C-style cast to support types that are pointers on some platforms and integers on others. This commit includes fixes to undefined behavior caught by this attribute. The following changes have been made: - 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined behavior with p. Additionally, %p already prints 0x with both gcc and clang. This results in a small output change: void *x = (void *)0x1234; void *y = (void *)0x1234567890abcdef; printf("|%0.8p|\n", x); printf("|%0.8p|\n", y); printf("|%016" PRIxPTR "|\n", (uintptr_t)x); printf("|%016" PRIxPTR "|\n", (uintptr_t)y); prints: |0x00001234| |0x1234567890abcdef| |0x0000000000001234| |0x1234567890abcdef| - %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is changed to %llu and the relevant argument is cast to unsigned long long. This is due to these types being typedefs to unknown types (on Linux for example, these are unsigned long, and my guess would be unsigned long long on Windows where long is 32 bits). - %llu is used for GLuint64, which could be unsigned long (as is on Linux). Those arguments are cast to unsigned long long. - %p is used for some EGLNative types, but those types may not be a pointer. Those arguments are cast to uintptr_t and printed as above. Bug: angleproject:2928 Change-Id: Idf9f705c3d00f69e41e7603453016276a2e13a64 Reviewed-on: https://chromium-review.googlesource.com/c/1300913 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill e9503ae9 2018-10-25T17:55:04 Revert "Add compiler printf attribute to relevant functions" This reverts commit 27a472c601aa542f48ca5944fb769e2971a0594f. Reason for revert: Causing failures on 32-bit Linux configs: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8931673733828416640/+/steps/compile/0/stdout ../../third_party/angle/src/libGLESv2/entry_points_egl.cpp:257:11: error: reinterpret_cast from 'EGLNativeWindowType' (aka 'unsigned long') to 'uintptr_t' (aka 'unsigned int') is not allowed reinterpret_cast<uintptr_t>(win), reinterpret_cast<uintptr_t>(attrib_list)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../third_party/angle/src/common/debug.h:230:112: note: expanded from macro 'EVENT' #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper("%s" message "\n", __FUNCTION__, ##__VA_ARGS__); ^~~~~~~~~~~ ../../third_party/angle/src/libGLESv2/entry_points_egl.cpp:314:11: error: reinterpret_cast from 'EGLNativePixmapType' (aka 'unsigned long') to 'uintptr_t' (aka 'unsigned int') is not allowed reinterpret_cast<uintptr_t>(pixmap), reinterpret_cast<uintptr_t>(attrib_list)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original change's description: > Add compiler printf attribute to relevant functions > > This commit includes fixes to undefined behavior caught by this > attribute. The following changes have been made: > > - 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined behavior with > p. Additionally, %p already prints 0x with both gcc and clang. This > results in a small output change: > > void *x = (void *)0x1234; > void *y = (void *)0x1234567890abcdef; > > printf("|%0.8p|\n", x); > printf("|%0.8p|\n", y); > > printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(x)); > printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(y)); > > prints: > > |0x00001234| > |0x1234567890abcdef| > |0x0000000000001234| > |0x1234567890abcdef| > > - %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is > changed to %llu and the relevant argument is cast to unsigned long > long. This is due to these types being typedefs to unknown types (on > Linux for example, these are unsigned long, and my guess would be > unsigned long long on Windows where long is 32 bits). > - %llu is used for GLuint64, which could be unsigned long (as is on > Linux). Those arguments are cast to unsigned long long. > - %p is used for some EGLNative types, but those types may not be a > pointer. Those arguments are cast to uintptr_t and printed as above. > > Bug: angleproject:2928 > Change-Id: I63e9e998c72701ce8582f1ebf25d6374be9090e4 > Reviewed-on: https://chromium-review.googlesource.com/c/1289232 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I4f3cea64977bee9f889db6c995371bd2bbc6d81b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2928 Reviewed-on: https://chromium-review.googlesource.com/c/1299480 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 27a472c6 2018-10-18T13:04:40 Add compiler printf attribute to relevant functions This commit includes fixes to undefined behavior caught by this attribute. The following changes have been made: - 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined behavior with p. Additionally, %p already prints 0x with both gcc and clang. This results in a small output change: void *x = (void *)0x1234; void *y = (void *)0x1234567890abcdef; printf("|%0.8p|\n", x); printf("|%0.8p|\n", y); printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(x)); printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(y)); prints: |0x00001234| |0x1234567890abcdef| |0x0000000000001234| |0x1234567890abcdef| - %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is changed to %llu and the relevant argument is cast to unsigned long long. This is due to these types being typedefs to unknown types (on Linux for example, these are unsigned long, and my guess would be unsigned long long on Windows where long is 32 bits). - %llu is used for GLuint64, which could be unsigned long (as is on Linux). Those arguments are cast to unsigned long long. - %p is used for some EGLNative types, but those types may not be a pointer. Those arguments are cast to uintptr_t and printed as above. Bug: angleproject:2928 Change-Id: I63e9e998c72701ce8582f1ebf25d6374be9090e4 Reviewed-on: https://chromium-review.googlesource.com/c/1289232 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill f4a789f9 2018-10-18T16:56:20 Use angle::Result in front-end (Part 6) Refactors the gl::Program, gl::Compiler and gl::Query classes. Bug: angleproject:2491 Change-Id: I96acecdc6af301a89201bd7f5222a180433e5eb2 Reviewed-on: https://chromium-review.googlesource.com/c/1289711 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill abfbc0fe 2018-10-09T12:48:52 Use angle::Result in allocation and math check macros. Replace these with ANGLE_CHECK_*_ALLOC and ANGLE_CHECK_*_MATH depending on the specific error type. Bug: angleproject:2491 Change-Id: Ic4395101fe701c563ae2b92aa2c55c93b934a7de Reviewed-on: https://chromium-review.googlesource.com/c/1262737 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Nico Weber 079a6bc3 2018-10-01T14:30:09 Remove an exit-time destructor from a frequently-included header. Bug: angleproject:1459 Change-Id: I2bfd7a34ef8ca6d367af7e1d9dd740c4e93727ac Reviewed-on: https://chromium-review.googlesource.com/1255382 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 1bf963b6 2018-07-19T14:56:37 Clean up PlatformMethods attribute enum Centralize definition of EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX in Platform.h. Bug: angleproject:2528 Change-Id: Id2b022c4ea08d2e98cbd6c3b248b58d096c20dfb Reviewed-on: https://chromium-review.googlesource.com/1144265 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6b873dd7 2018-07-12T23:56:30 Add gl::ErrorSet and angle::Result. gl::ErrorSet can handle errors and is accessible from ContextImpl. It allows the implementation to mutate the error set without using the gl::Context directly. angle::Result is the faster POD return value class. It should generate optimal code. It can also be used seamlessly with the ANGLE_TRY macro. Also introduces an internal enum as a workaround for generating and consuming errors in the back-end. When the internal enum is used as an error return value the error is not consumed in the front-end. This is a temporary workaround only. Bug: angleproject:2491 Bug: angleproject:2713 Change-Id: I6cbdaadd075ccbdf241844cbcbc4ed5c3be40a8b Reviewed-on: https://chromium-review.googlesource.com/1133200 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill dec86230 2018-07-11T09:01:18 Generalize Context scratch buffer errors. This refactor will allow us to generate different error types in different backends. This makes Vulkan happy because it won't have to generate gl::Errors and can stay with vk::Error. Bug: angleproject:2713 Change-Id: I981402450f3b519d4f79851982547695d583355a Reviewed-on: https://chromium-review.googlesource.com/1128921 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill ca2ff38b 2018-07-11T09:01:17 Refactor internal format pixel math methods. This removes the use of the ErrorOrResult class from these methods. This will enable more performant Error handling. Also cleans up the ANGLE_TRY_CHECKED_MATH macro to be more general. Bug: angleproject:2713 Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08 Reviewed-on: https://chromium-review.googlesource.com/1128920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Yuly Novikov f5fd5c6c 2018-06-22T17:52:32 Remove FormatString for real Forgot to remove it from the header in https://chromium-review.googlesource.com/577922 Bug: angleproject:1644 Change-Id: I89f9c975b3fc3b7161edd2c2907549eaa672c223 Reviewed-on: https://chromium-review.googlesource.com/1112647 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Frank Henigman 95fb2a17 2018-05-27T20:17:05 Add vertex formats and lookup function. Add an angle::Format for each ES2 vertex data format. Add function GetVertexFormatID() to get the angle::Format for a vertex attribute. These will be used later to support vertex formats in Vulkan (by mapping angle::Format to Vulkan format) and to eliminate the redundant enum gl::VertexFormatType. No functional change. BUG=angleproject:2405 BUG=angleproject:2531 Change-Id: I871ae23ce9fba57d90c554376e84b03f8514f7fc Reviewed-on: https://chromium-review.googlesource.com/1044874 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 4fef7738 2018-05-29T15:21:41 Add perf test for Error/Result class. This is a performance test that stresses the Error class. It also is used in tests for the new Result class. Bug: angleproject:2575 Change-Id: Ie23c2a1ea74108d2ba72bf26f1db04e14f7eda64 Reviewed-on: https://chromium-review.googlesource.com/1077129 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 41918387 2018-03-13T11:37:54 Vulkan: Additional texture formats support. RGB565, RGBA4444, RGBA5551 Bug:angleproject:2358 Change-Id: I4dc19f9e4cc7b51f215b57d440a108cdf17aec24 Reviewed-on: https://chromium-review.googlesource.com/960573 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 7b17fa18 2018-01-29T11:12:57 Add a constexpr constructor for TVariable BUG=angleproject:2267 TEST=angle_unittests Change-Id: I9b7e01801caa7235ac5e2d4212ea92e38c1f774d Reviewed-on: https://chromium-review.googlesource.com/908752 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho d66e1939 2018-01-17T11:36:24 Allow creating EGL pbuffers from typeless D3D textures A new extension EGL_ANGLE_d3d_typeless_texture_client_buffer is added that allows creating EGL pbuffers from typeless D3D textures. The extension increases the flexibility of the API compared to plain EGL_ANGLE_D3D_texture_client_buffer. The colorspace for the created EGL pbuffer can be set by using the EGL_GL_COLORSPACE attribute. Internally this sets the ANGLE format of the buffer. There are new ANGLE formats that are used specifically for typeless textures, separate ones for SRGB and linear views into the D3D textures. The extension is only supported on the D3D11 backend of ANGLE. BUG=angleproject:2300 TEST=angle_white_box_tests Change-Id: I6a6cb873d2cc0dca0b7f18a0f2cd35e7bafcb7d8 Reviewed-on: https://chromium-review.googlesource.com/873917 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill eeda03b6 2018-01-05T17:26:29 EGL: Remove internal enum for NULL driver. This is now updated in Chrome, so we can remove the last uses. Bug: angleproject:2159 Change-Id: Ia31e42b8a685756ee70450be19a52248e3efa92f Reviewed-on: https://chromium-review.googlesource.com/853119 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f3e23295 2018-01-04T18:19:21 EGL: Expose NULL driver device selection. This makes the device type selection part of the ANGLE platform extension. We currently support NULL driver selection on all available back-ends (although on the NULL back-end, it already has no device type). Optionally we could expose certain features of this as separate extensions. This currently also supports the old hidden enum, until we can update Chrome and consolidate to the new exposed official enum. Bug: angleproject:2159 Change-Id: I85d0811098e644e8192c207673af9e18ed7c1da2 Reviewed-on: https://chromium-review.googlesource.com/846021 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Sami Väisänen 935cb7c5 2017-11-08T15:53:41 Support B8G8R8A8_UNORM_SRGB as D3D11 texture format Support B8G8R8A8_UNORM_SRGB as D3D11 texture format. BUG=angleproject:2172 Change-Id: I2f15a55123601735d7fc6caa40bb056243a91b44 Reviewed-on: https://chromium-review.googlesource.com/758600 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho c853804c 2017-09-27T11:20:15 Add support for arrays of arrays to VariableLocation Array indices are sorted so that the outermost index is in the back. This is because we want to be consistent with future arrays of arrays parsing code. In parsing we'll have a utility function to make a TType object into an array, and there it's most natural to push the new outermost sizes to the back of the vector. Further patches will still be needed to parse arrays of arrays and add support to arrays of arrays into the API. BUG=angleproject:2125 TEST=angle_unittests, angle_end2end_tests Change-Id: I6c88edabf68ae9dbd803ec6d20543016c408b702 Reviewed-on: https://chromium-review.googlesource.com/686414 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
jchen10 a99ed554 2017-09-22T08:10:32 Refactor data conversions for state commands This mainly enforces the rules as descripted in ES 3.10, section 2.2.1 and 2.2.2, by enhancing the "queryconversions" to support more rules, removing the scattered type convertors in "utilities" , "mathutil" and "queryutils", and forcing to only use the convertors in "queryconversions". BUG=angleproject:2165 Change-Id: I73c1dc850e2b3b8a479ece1d9c5eb7ae4ce851fe Reviewed-on: https://chromium-review.googlesource.com/680094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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 f00f7ffe 2017-08-31T14:39:15 Add a Uniform type info table. Currently most uniform type info is determined by switching on the uniform type. Some values are computed from other values, which can result in three or more switch statements plus some multiplies or other math. This patch attempts to improve the speed by pre computing necessary values into constant static tables. Improves performance by about 7% in a uniform stress test. BUG=angleproject:1390 Change-Id: I29bef259a17f6d6536171ade4950e2d712bfd39c Reviewed-on: https://chromium-review.googlesource.com/643791 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2c1183bb 2017-08-24T10:36:01 Fix compile on non C++14 configs. The WrappedArray move constructor was not contexpr under c++11 rules. New code was introduced when fixing D3D11 runtime warnings. BUG=angleproject:2025 Change-Id: Ie322d9fa3db36f320b7a9ef5048a23c31c153ad1 Reviewed-on: https://chromium-review.googlesource.com/633911 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 92996b0d 2017-08-17T10:39:02 D3D11: Fix masked clear unused RTV warning. This benign warning would show up in the Debug layer messages. It was causing the test to fail in some standalone configurations. This fix implemented here is to keep 8 different pixel shaders, one for each total count of render targets, up to the implementation max. BUG=angleproject:2025 Change-Id: I826ddae686ddb1cfad17879644152be2f6125c5b Reviewed-on: https://chromium-review.googlesource.com/617512 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang aadc8f37 2017-08-11T17:34:44 Implement the CPU fallback for CopyTextureCHROMIUM on OpenGL. BUG=angleproject:1932 Change-Id: Iabc1a3e361d66313dc16bf19b392402b7836f8a5 Reviewed-on: https://chromium-review.googlesource.com/612562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
jchen10 3c76d59f 2017-08-03T08:47:56 Check GCC for __has_attribute The __has_attribute macro was one of improvements in GCC 5 release. See https://gcc.gnu.org/gcc-5/changes.html. This checks to make it work with older GCC. BUG=angleproject:2119 Change-Id: I751249b9d028d1322829bebc1ca8d423edf27057 Reviewed-on: https://chromium-review.googlesource.com/599152 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 44183cce 2017-08-01T12:48:34 Micro-optimizations to draw call entry point. Thanks to Markus from NVIDIA. This inlines some methods and optimizes the check if a uniform is a bool type. BUG=angleproject:2119 Change-Id: I6f2c2d22c577458b39de600d3c56ec8e1a456a7a Reviewed-on: https://chromium-review.googlesource.com/591699 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5978e28d 2017-06-02T11:49:31 D3D11: Consolidate InputLayout allocation. This introduces a helper type to act as the initialization data type for input element arrays. A WrappedArray class acts as a helper class to wrap a C array and size into a C++ class, similar to std::array but without the data storage. Also move resource deallocation memory counting into a single code path. BUG=angleproject:2034 Change-Id: I5e108254777f0df65f5f60fe26e760c71b95b542 Reviewed-on: https://chromium-review.googlesource.com/506775 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 98de826c 2017-05-29T13:01:02 Platform: Fix initialization order in tests. Because of the platform refactor in abf38572062b91 we broke the way the tests override the D3D workarounds for the tiny depth/stencil bug. This change passes a pointer to the platform directly in the EGL init logic, which solves this issue. It also removes all decltype code in the platform header which might fix the UBSAN problem we were seeing previously. Also change a present mode selection error into a warning in the Vk back-end, since this was being triggered on AMD, but is safe. BUG=angleproject:2042 Change-Id: Ibbd0c69ce11a840cf4b33c616f56020001e553aa Reviewed-on: https://chromium-review.googlesource.com/513519 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 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>
Yunchao He d7297bfb 2017-04-19T15:27:10 Code refactoring: replace NULL by nullptr for pointers. This is the frist change to replace NULL by nullptr. It handles the initialization and assignment for pointers. BUG=angleproject:2001 Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5 Reviewed-on: https://chromium-review.googlesource.com/481600 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@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>
Corentin Wallez 054f7ed0 2016-09-20T17:15:59 preprocessor: Miscellaneous cleanups - Use full header paths in includes - Use ASSERT instead of assert - Use angle::NonCopyable instead of PP_DISALLOW_COPY_AND_ASSIGN - Use range-for in a couple places - Remove pp_utils.h BUG=angleproject:1522 Change-Id: If107fef89e8465bca65cf664926d1051c5d1e232 Reviewed-on: https://chromium-review.googlesource.com/387212 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 78a9c733 2016-07-15T11:22:43 D3D11: Implement multisampled stencil resolve. This implements a fairly slow path with readback for stencil blits, and depth/stencil resolve. In a subsequent patch I'll implement the depth blits. BUG=angleproject:1246 Change-Id: I04151d1f49ca404d858172dff8286608eae29864 Reviewed-on: https://chromium-review.googlesource.com/359955 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Sami Väisänen 46eaa946 2016-06-29T10:26:37 Support CHROMIUM_path_rendering fragment operations This brings two new APIs, BindFragmentInputLocation and ProgramPathFragmentInputGen that together dictate how the fragment shader varyings are used. BUG=angleproject:1382 Change-Id: I4b52fd8a3555235a73aecd4f3dba2d500789cbb0 Reviewed-on: https://chromium-review.googlesource.com/357071 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Sami Väisänen <svaisanen@nvidia.com> Commit-Queue: Sami Väisänen <svaisanen@nvidia.com>
Jamie Madill ec0b580d 2016-07-04T13:11:59 Re-land "D3D11: Fix readback of BGRA-backed formats." For some BGRA-backed formats (RGBA4, R5G6B5, RGB5A1), our ReadPixels implementation wasn't aware the BGRA format didn't exactly match the RGBA format. For these it would do the 'fast path' memcpy method, when it should stop and do the slow pixel-by-pixel packing method. Fixes conformance2/reading/read-pixels-from-fbo-test.html. Reland: fix empty format info that was causing us to only see the first pixel in the FBO in a ReadPixels call. Also fix bugs in the unorm 16-bit format readback code, and add ASSERTs to catch bugs in subsequent new formats. BUG=angleproject:1407 BUG=chromium:616176 Change-Id: I9fd55b9e1dd6a306eb4db195d775c02a1eb1f93f Reviewed-on: https://chromium-review.googlesource.com/357132 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
John Bauman 73d417ed 2016-06-17T00:49:40 Revert "D3D11: Fix readback of BGRA-backed formats." This reverts commit 230d95616d1309914a6703e27a797a440806dd02. This broke GLES2ConformTest.GL2Tests_framebuffer_objects_input_run on the NVIDIA Win8 Chromium bots. BUG=chromium:620908 Change-Id: Idf6e3eb51483ff0b6bc758b95c5910863ddfc25f Reviewed-on: https://chromium-review.googlesource.com/353394 Reviewed-by: John Bauman <jbauman@chromium.org> Commit-Queue: John Bauman <jbauman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 230d9561 2016-06-15T18:11:52 D3D11: Fix readback of BGRA-backed formats. For some BGRA-backed formats (RGBA4, R5G6B5, RGB5A1), our ReadPixels implementation wasn't aware the BGRA format didn't exactly match the RGBA format. For these it would do the 'fast path' memcpy method, when it should stop and do the slow pixel-by-pixel packing method. BUG=angleproject:1407 BUG=chromium:616176 Change-Id: Ie24758513af6f9ef87f0aa503135456c96493701 Reviewed-on: https://chromium-review.googlesource.com/352252 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e2e406c3 2016-06-02T13:04:10 Add base::numerics for safe math and conversions. This replaces are "IsUnsignedXXXSafe" family of methods. Also add overflow checks to unpack block sizes. BUG=angleproject:1397 Change-Id: Ib47be149b0486c70f795b0d0f8899441faac9340 Reviewed-on: https://chromium-review.googlesource.com/348062 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c9bdeff4 2016-02-08T12:36:55 D3D11: Refactor RenderTarget apply into StateManager11. This is a refactoring patch only, and doesn't change the behaviour. The intent is to make it easy to turn on the Framebuffer dirty bits in a subsequent patch, once we can cleanly handle textures and renderbuffers getting recreated. BUG=angleproject:1260 Change-Id: Iaa5cfe222b020724e088eee5f1ae909b6f981a08 Reviewed-on: https://chromium-review.googlesource.com/325423 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4e31ad55 2015-10-29T10:32:57 D3D11: Add dynamic geometry shaders. The geometry shader we want will depend on our current draw mode, and if we're using flat shading in the shader. Without flat shading, we'll still be using them only for point sprites, but for other primitive types with flat shading enabled, we'll be using them to correct the provoking vertex order with D3D11. Note: no new features in this CL, those are turned on in follow-ups. BUG=angleproject:754 Change-Id: Iabf13ffd582f5a7200ee0df5aa9c3671aa7b6ed4 Reviewed-on: https://chromium-review.googlesource.com/309154 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill f0d10f89 2015-03-31T12:56:52 Replace non-copyable macro with a helper class. This class provides a simpler scheme for blocking default copy and assignment operators. It also reduces the amount of code needed since it's inherited to child classes. This also fixes the conflict between our macro and the same-named macro in Chromium code. BUG=angleproject:956 Change-Id: If0dc72aa3f63fbc7b8fa34907418821c64c39e2f Reviewed-on: https://chromium-review.googlesource.com/263257 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
Geoff Lang 7825f619 2014-11-26T16:19:41 Update ANGLE_platform_angle_d3d to use a device type enum instead of WARP bool. BUG=angle:490 Change-Id: I1555e7f09b23138753e52ddf720d088587f7cadb Reviewed-on: https://chromium-review.googlesource.com/232104 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9d294c33 2015-01-30T19:58:39 Revert "Compile the D3D11 VS and PS on separate threads at GL link time" Failing compile on Chromium bots: FAILED: ninja -t msvc -e environment.x86 -- C:\b\build\goma/gomacc "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\angle\src\libANGLE\renderer\d3d\libANGLE.ProgramD3D.obj.rsp /c ..\..\third_party\angle\src\libANGLE\renderer\d3d\ProgramD3D.cpp /Foobj\third_party\angle\src\libANGLE\renderer\d3d\libANGLE.ProgramD3D.obj /Fdobj\third_party\angle\src\libANGLE.cc.pdb c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\concrt.h(4774) : error C3861: '__uncaught_exception': identifier not found ninja: build stopped: subcommand failed. This reverts commit 6d51f2629a8118f7afd450ea832c93143a84c330. Change-Id: Iebb2843dfbc3795290fbb33e1a111ddad59c3126 Reviewed-on: https://chromium-review.googlesource.com/244792 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 6d51f262 2015-01-26T16:34:48 Compile the D3D11 VS and PS on separate threads at GL link time BUG=angle:900 Change-Id: Iad5dbbcc676e2a2b6dfc3d7bc6ab5957154de33e Reviewed-on: https://chromium-review.googlesource.com/240490 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Jamie Madill 55573e13 2014-11-25T11:21:13 Use cross-platform enum for Vendor ID. BUG=angle:795 Change-Id: Ibe9bbb79b92730ba80ca7275528c8b61d5d44c59 Reviewed-on: https://chromium-review.googlesource.com/228914 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e371f1d7 2014-11-21T11:25:22 Update the DISALLOW_COPY_AND_ASSIGN macro to use c++ operator deletion. Also remove the TSymbol copy constructor which is not used. BUG=angle:836 Change-Id: I4f35f554c90d01dc2132d244a1974d9a8dc89bbd Reviewed-on: https://chromium-review.googlesource.com/231231 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang df8fafef 2014-11-11T11:11:33 Fix compilation failure with Visual Studio 14. Change-Id: If009cec928318c90a2f6d445ea8b4b06c4e45209 Reviewed-on: https://chromium-review.googlesource.com/228919 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@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>
Tibor den Ouden 2221f47b 2014-10-22T15:07:05 Compiler flags and macros added to shader debug report The list of D3D compiler flags and macros used if compilation of a shader succeeds is added to the shader debug output. BUG=angle:751 Change-Id: Ie84a586010787fe8d9c0dedfe9208f881058a588 Reviewed-on: https://chromium-review.googlesource.com/224970 Tested-by: Tibor Ouden, den <tibordenouden@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 8e7d7a30 2014-09-02T17:09:08 Fix use of references with va_start BUG=angle:736 va_start behavior is undefined if the second parameter is a function, array, or reference type. clang produces a warning for this, while MSVC does not. Change-Id: I0bc2805e312e3542aac816f10a257e2f1cfad128 Reviewed-on: https://chromium-review.googlesource.com/216010 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Tested-by: Nico Weber <thakis@chromium.org>
Jamie Madill 33ea2f97 2014-08-29T15:15:01 Added BufferSubData benchmark. BUG=angle:705 Change-Id: I65d557f35e4c9f1d94853a775330a92b7d428847 Reviewed-on: https://chromium-review.googlesource.com/213810 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang da5777cf 2014-07-11T09:52:58 Create an Error object to represent GL errors. BUG=angle:520 Change-Id: I1a54e6f308b5b0f310c725a7771af737a77ecd42 Reviewed-on: https://chromium-review.googlesource.com/209619 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang bfdea66b 2014-07-23T14:16:32 Remove try-catch blocks from entry points. BUG=angle:700 Change-Id: I036901c397053a75677923304d7e1ed697c82aa2 Reviewed-on: https://chromium-review.googlesource.com/209570 Reviewed-by: <ehsan@mozilla.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 93455ebe 2014-07-08T15:22:50 Add missing limits include to angleutils.h This missing include was breaking the build on Linux. BUG=angle:692 Change-Id: Id502f477d6e3373519b011e75c144782e9101944 Reviewed-on: https://chromium-review.googlesource.com/206633 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 53cb14dc 2014-07-08T15:02:35 Share ArrayString and Str helper methods. Placing these string helper methods allows us to re-use them in the relevant place of the shader translator. BUG=angle:466 Change-Id: Idd638542027d3b1035bc79fc941e80bf436c82af Reviewed-on: https://chromium-review.googlesource.com/206567 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Ehsan Akhgari 10530c34 2014-07-02T20:37:53 Add ANGLE_NO_EXCEPTIONS macro This macro allows us to hide angle's usage of try/catch so that we can properly hide them from compilers that do not support exceptions properly (such as clang-cl and gcc/clang with -fno-exceptions). Change-Id: I75f466a5322e5840e007711ea851f444bd6ca299 Reviewed-on: https://chromium-review.googlesource.com/206562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: <ehsan@mozilla.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shannon Woods 3dc8020a 2014-06-16T13:29:52 Fix dependent typename build error on non-MSVC compilers BUG=angle:677 Change-Id: Ic0d257ef41e8c80baeddd664eb6c2cc5db94ee43 Reviewed-on: https://chromium-review.googlesource.com/203428 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Geoff Lang 04fb89ad 2014-06-09T15:05:36 Generate pixel shader output to match the bound framebuffer. Only generate pixel shader output variables for render targets that are currently bound. Fixes some performance issues with D3D10 cards that were slow to discard unused outputs. Fixed memory leaks in ProgramBinary by refactoring the freeing of the current state into a reset function. BUG=angle:670 Change-Id: I40f83e15724fb9a1a9ae61363a056999f1fa26d2 Reviewed-on: https://chromium-review.googlesource.com/202977 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang cec3590a 2014-04-16T10:52:36 Use a Caps structure to store extension and texture format support. Removes support for fallbacks in D3D9 texture formats. The fallback formats did not work properly anyways. BUG=angle:658 Change-Id: Idfa5183bf71fd8ebf4608f940f9d93177b9eff08 Reviewed-on: https://chromium-review.googlesource.com/200813 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Jamie Madill d3f0f1ec 2013-09-20T13:31:08 Expose and generalize Clear11's CompareStates function, and add methods for equality test and initialization. TRAC #23841 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 28167c62 2013-08-30T13:21:10 Add support for struct varyings, and more robust varying link validation. TRAC #23749 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Geoff Lang ea228635 2013-07-30T15:17:12 Use SafeRelease and SafeDelete to make sure released objects are NULL and will cause proper errors if referenced again. TRAC #23617 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang