src/libANGLE/BinaryStream.h


Log

Author Commit Date CI Message
Jamie Madill 2e0490ee 2021-01-18T14:21:46 Capture/Replay: Serialize float states properly. Previously we were always casting to int. Instead add a float serialization helper function. Bug: angleproject:5530 Change-Id: Ifc80e1dbad9da8a04b3b013c3a3ffa60444f6d26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2634829 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 98c5ff6b 2020-10-25T16:26:55 BinaryStream: Preserve 64-bit integer data. Previously the code would truncate 64-bit data to fit in 32-bits. This ran into a serialization bug when expanding a 64-bit mask. The new blend state masks for extended range were out of range for the 32-bit promotion that was happening before. Also refactors how we capture bools and enums to be more consistent. size_t is now correctly saved and loaded as 64-bits. Bug: angleproject:5247 Change-Id: I452a98c1b0add4c0cf45493032e9310e7d8321b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2497561 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Manh Nguyen dce37b7d 2020-06-21T22:27:06 Serialize framebuffers + compare contexts for CaptureReplayTests Adds to frame capture the ability to serialize a frame's pre-swap GL state and store it in the binary data file Adds to CaptureReplayTests the ability to compare its serialized GL state with the serialized state pulled from the binary data file Adds a serialization module that serializes framebuffers' GL states and the contents of their color attachments Adds checks to automation script so that it would skips tests that do not produce the expected trace files Adds exception handling to automation script so that it will not crash when a replay build crashes Bug: angleproject:4779 Change-Id: I40a02e018073749e79f0ddbfd3d4065745548f46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2258295 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi e5385ea9 2020-01-27T13:40:18 Vulkan: Compile shaders at link time Since line raster emulation was changed to use specialization constants, it has been possible to compile shaders at link time. However, program pipeline objects would have required keeping the shader sources around for recompilation. Now that all necessary decorations are modified directly in SPIR-V, it's possible to compile the shaders at link time and forget about their sources. Program pipeline objects then simply "reconfigure" the generated SPIR-V. A next step could be to also create the Vulkan pipeline object at link time. A number of failures due to gaps in CTS testing prevent that work currently. In particular, in some situations the generated SPIR-V is not per spec, for example it may contain vertex attributes with aliasing locations, or have transform feedback capture of array elements misconfigured. Bug: angleproject:3394 Bug: angleproject:4253 Change-Id: I54c0884cf056b511a4a306225cc6ed2cef84d257 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2023186 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 7fad424e 2019-12-30T00:07:09 Avoid vector copy in BinaryOutputStream::writeIntVector Also adds a unit test to make sure readIntVector and writeIntVector match. It was not immediately clear that writing the vector size in writeIntVector is writing an int instead of a size_t. Bug: angleproject:3394 Change-Id: I09a003c169dbc47e40c0cd3e4da6f1d7a905c6da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1983162 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Geoff Lang e332e621 2019-02-14T12:53:04 D3D: Asynchronously load program binaries. Unpack as much of the binary steam as possible before passing the final loading of the shader programs off to a worker thread. Reporting as many possible link errors before becoming asynchronous means that linking should only fail due to unexpected system issues at that point. This also allows other backends to asynchronously load program binaries. BUG=angleproject:2857 Change-Id: I587917a3e54522114dabd41d1b14fc491c8fd18a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1473451 Commit-Queue: Jamie Madill <jmadill@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez f0e89be6 2017-11-08T14:00:32 Use packed enums for the texture types and targets, part 1 In OpenGL there are two enum "sets" used by the API that are very similar: texture types (or bind point) and texture targets. They only differ in that texture types have GL_TEXTURE_CUBEMAP and target have GL_TEXTURE_CUBEMAP_[POSITIVE|NEGATIVE]_[X|Y|Z]. This is a problem because in ANGLE we use GLenum to pass around both types of data, making it difficult to know which of type and target a variable is. In addition these enums are placed somewhat randomly in the space of OpenGL enums, making it slow to have a mapping from texture types to some data. Such a mapping is in hot-code with gl::State::mTextures. This commit stack makes the texture types and target enums be translated to internal packed enums right at the OpenGL entry point and used throughout ANGLE to have type safety and performance gains. This is the first of two commit which does the refactor for all of the validation and stops inside gl::Context. This was the best place to split patches without having many conversions from packed enums to GL enums. BUG=angleproject:2169 Change-Id: Ib43da7e71c253bd9fe210fb0ec0de61bc286e6d3 Reviewed-on: https://chromium-review.googlesource.com/758835 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
Jamie Madill 4f86d053 2017-06-05T12:59:26 Introduce MemoryProgramCache. This class will manage GPU binary programs in memory. It will be owned by the Display, and shared between Contexts. Currently this CL just refactors the Program binary saving and loading into static members of this new class. BUG=angleproject:1897 Change-Id: I34f5afb2c02416f6fd80dd65ba3827a8637ce190 Reviewed-on: https://chromium-review.googlesource.com/522873 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 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>
Geoff Lang 61fea139 2015-12-07T14:20:02 Protect against overflow in BinaryInputStream. BUG=angleproject:1112 Change-Id: I6d58d9e0db97ec6c67661abd92b57f61f357d6b5 Reviewed-on: https://chromium-review.googlesource.com/316640 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 41a2b8ea 2015-12-07T21:44:26 Revert "Protect against overflow in BinaryInputStream." This reverts commit dfa2fe31ad66ede57af1c0244ee99b8918eb2d9b. Change-Id: If4a7eb1876876991c537d0a9077cede52ba40b95 Reviewed-on: https://chromium-review.googlesource.com/316621 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang dfa2fe31 2015-12-07T14:20:02 Protect against overflow in BinaryInputStream. BUG=angleproject:1112 Change-Id: Iedd92ce7a56b20f42e51ef86278eb64fbae3c353 Reviewed-on: https://chromium-review.googlesource.com/316031 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
hendrikw 75782629 2015-09-25T11:28:50 Fix possible compiler errors on linux Change-Id: Ifc45446c749690eddc406f66f144304262f04664 Reviewed-on: https://chromium-review.googlesource.com/302478 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@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 d4475816 2015-03-18T10:53:05 Always use static_assert for compile-time assertions and remove META_ASSERT. BUG=468139 Change-Id: I696ef307f2faa54bb72df66784bc79a055499987 Reviewed-on: https://chromium-review.googlesource.com/260776 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ce4c0001 2015-01-12T14:46:11 Don't use std::is_fundamental on Android. This method is unavailable due to being c++11. BUG=angle:773 Change-Id: I995e03c26b5d3103fab963d8fb1eddc5050cf5b5 Reviewed-on: https://chromium-review.googlesource.com/240096 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5ffa95da 2015-01-05T13:15:20 Don't call std::is_fundamental on OSX. We can't use this method on OSX due to missing c++11 STL support. Instead use a helper function to replace it. BUG=angle:773 Change-Id: Iddcd2705792217e6356f51e4bb9dce248d7c3be2 Reviewed-on: https://chromium-review.googlesource.com/238447 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0a73dd85 2014-11-19T16:18:08 Fix include guards. BUG=angle:733 Change-Id: I08b2c11c4831f1161c178c1842b10e807185aced Reviewed-on: https://chromium-review.googlesource.com/230831 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2b5420c0 2014-11-19T14:20:15 Merge libGLESv2 and libEGL classes into libANGLE. BUG=angle:733 Change-Id: Ic491c971411fe82c56cd97c5c8325ac14ec218df Reviewed-on: https://chromium-review.googlesource.com/230830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>