src/common/BinaryStream.h


Log

Author Commit Date CI Message
Charlie Lao c5d19d76 2023-09-07T09:58:24 Reland "Load mUniformLocations using loadVector" This is a reland of commit 6f526b8f52d17bf89082a901f06df6edb75a7dbd Original change's description: > Load mUniformLocations using loadVector > > Bug: b/275102061 > Change-Id: I1da5bdd6bf0ec40cd877c2274a8fe1ee0b11267a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4849551 > Reviewed-by: Roman Lavrov <romanl@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/275102061 Change-Id: If501db97a37b00104a9d16fc40200f772ffcd2fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4856749 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 79691400 2023-09-09T20:50:24 Revert "Load mUniformLocations using loadVector" This reverts commit 6f526b8f52d17bf89082a901f06df6edb75a7dbd. Reason for revert: Suspected cause of MSAN failure. See: https://chromium-review.googlesource.com/c/angle/angle/+/4851776 Original change's description: > Load mUniformLocations using loadVector > > Bug: b/275102061 > Change-Id: I1da5bdd6bf0ec40cd877c2274a8fe1ee0b11267a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4849551 > Reviewed-by: Roman Lavrov <romanl@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/275102061 Bug: chromium:1480543 Change-Id: I50c39758d180320465b152ad32ba9447878f7d8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4855538 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Charlie Lao 6f526b8f 2023-09-07T09:58:24 Load mUniformLocations using loadVector Bug: b/275102061 Change-Id: I1da5bdd6bf0ec40cd877c2274a8fe1ee0b11267a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4849551 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 632ded9e 2023-09-01T13:43:11 Load ShaderInterfaceVariableInfoMap data members with readStruct This CL groups the remaining data members of ShaderInterfaceVariableInfoMap into a POD (plain old data) struct and load it with readSTruct call (and save it with writeStruct). This CL also uses readVector for mDefaultUniformBlocks[shaderType]->uniformLayout instead of individual reads of each basic elements. Bug: b/296433003 Change-Id: I48b508822cb414cea75a6e384a0794f245460f57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4833690 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 014e584f 2023-08-21T15:51:30 Vulkan: Separate out XFB data from ShaderInterfaceVariableInfo Right now the transform feedback data is embedded in the ShaderInterfaceVariableInfo. This caused ShaderInterfaceVariableInfo becomes non-trivial copy-able. This CL moves transform feedback related data out and into its own array, and entire vector of ShaderInterfaceVariableInfo is now memcpied. Further, most programs don't use transform feedback. Right now because transform feedback data is embedded in the ShaderInterfaceVariableInfo, it bloated the size of ShaderInterfaceVariableInfo even if you do not use XFB. This CL makes transform feedback variable info data a std::unique_ptr so that if not used, it is just a nullptr. When we load/save the structure, the ones that has nullptr gets skipped. Bug: b/296433003 Change-Id: I61940a683611717ab0445fcbf44b89b1b7166ee4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4799344 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Charlie Lao 962fdf7b 2023-08-31T17:44:51 Add templated BinaryOutputStream::writeVector and writeStruct To avoid repeated code pattern, this CL adds templated BinaryInputStream::readVector and readStruct and BinaryOutputStream::writeVector and writeStruct, that does the static assertion to ensure they are trivially copyable. readIntVector/writeIntVector is removed. This CL also padding warning for ProgramExecutable::PODStruct to avoid potential Msan complain. Bug: b/296433003 Change-Id: I8e718b41cde898960b9e86a2d7d1bc5a837fe561 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4834700 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5446e87e 2023-07-24T16:46:56 Improve ProgramExecutable::load performance We are calling push_back for each vector inside ProgramExecutable. This causes c++ run time to constantly re-allocate storage and copy the vector over to new storage, and impacts performance negatively. Since the vector size is know when we load program from cache, this CL calls resize to the correct size first and then update each element as we walk over, thus reduces the vector storage reallocation. This CL reduces blade_and_soul_revolution frame time from 4.48 ms to 4.35 ms on pixel 7 pro. This CL also changes ProgramBinaryTest tests to use slightly more complicated program instead of the simplest program. Bug: b/275102061 Change-Id: I8d92117b07a9ad2d0851850e473ea1b86f9868f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4713685 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 972f8107 2023-07-14T12:05:40 Reject program binaries when the renderer string changes If the underlying driver changes, reject program binaries from the old versions. The driver is supposed to do this for us (on OpenGL, at least) but this adds some extra protection. Bug: angleproject:4981 Change-Id: Id9486d8e6f9136970c0d7c37d59dea5d43b0a50e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685317 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya cc34aa73 2022-12-19T14:03:27 Move BinaryStream to common and expose ShaderState to compiler This is a refactor change in preparation for adding support for glShaderBinary. Move BinaryStream to common so that it is accessible by both libANGLE and the Compiler. Extract members that hold the result of compilation from ShaderState and move into new CompiledShaderState struct. Move helper functions & classes relevant to ShaderVar serialization to the CompiledShaderState header. Tests: EGLBlobCacheTest* Bug: angleproject:7833 Change-Id: I7ec575247eccb3afbc6ab6bfa24d36e69d4576f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4080998 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>