src/common/MemoryBuffer.cpp


Log

Author Commit Date CI Message
Manh Nguyen 900c7e87 2020-07-07T14:20:36 Serialize d/s buffers + use color buffers' impl format for readPixels Adds serialization of depth/stencil buffer contents Currently, readPixels on color buffers uses the gles front-end format, which can be different from the implementation format used in the backend. This can cause seg fault crashes when the number of bytes in a pixel differs between the two format. Changes so that readPixels for color buffers always use the backend format. Bug: angleproject:4817 Change-Id: I62d5deb1320ea38ee46143b2aa97f372ba01baeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2284451 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Manh Nguyen <nguyenmh@google.com>
Geoff Lang aa6dd50d 2020-02-03T17:10:58 Share scratch buffers between contexts. The Display now owns scratch buffers and loans them out to contexts while they are current. This allows us to to only allocate one scratch buffer in a single-threaded use case. Tick the scratch buffers every time a new context is made current. Lower the lifetime from 1000 to 64 to ensure that in the worst case, the buffers are cleared after not being used for ~1 second. BUG=chromium:1030835 BUG=angleproject:4363 Change-Id: I83552424e2beac62b9e41152876b04fc84f53692 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031698 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Geoff Lang a36f8bd4 2020-01-29T12:10:17 Mark MemoryBuffer allocation functions as NO_DISCARD Not all call sites were checking the return value of MemoryBuffer::resize, mark the return value as NO_DISCARD and fix all the warnings. BUG=chromium:1030835 Change-Id: I762796e3d11efc131a814069d78a195b0d4c9f8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2028151 Commit-Queue: Geoff Lang <geofflang@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>
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 996628a4 2018-09-24T16:39:26 Vulkan: Add support for VkPipelineCache The cache is initialized from the application's blob cache and is occasionally written back to it for disk storage. Bug: angleproject:2516 Change-Id: I4cba4b00a7b9641c2983ef07159bc62cd10a5519 Reviewed-on: https://chromium-review.googlesource.com/1241373 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Rafael Cintron 05a449a7 2018-06-20T18:08:04 Replace reinterpret_cast with safer or no cast When casting types to one another in C++, the weaker the cast, the better. This change replaces instances of reinterpret_cast with static_cast or no cast where it safe and correct to do so. BUG=angleproject:2683 Change-Id: I99c9033614a65282ae1d78cf0f4b80fabd75877a Reviewed-on: https://chromium-review.googlesource.com/1109396 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@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 b3f26b9e 2017-07-19T15:07:41 Add a zero-filled scratch buffer to Context. We need this in a few places for handling resource init. Centralize this in the context so we don't have to recreate and re-fill a large zero buffer. BUG=angleproject:2107 Change-Id: Icf9ce417e7ee3498f03e47741dfff89e81b49519 Reviewed-on: https://chromium-review.googlesource.com/576057 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3244736a 2017-06-28T14:53:52 Use MemoryProgramCache. Add the member functions for saving and loading from the binary cache, and hook them into the Program class. Requires that the Renderer supports the program binary extension. BUG=angleproject:1897 Change-Id: I2dc8d21b02da705ded58c5cd1943562c9c97c49b Reviewed-on: https://chromium-review.googlesource.com/522874 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9c9b40ac 2017-04-26T16:31:57 Use parameter cache to skip passing IndexRange. For DrawElements et al., we can use a simple design to store entry point parameters and compute index ranges lazily. This allows us to compute the index range outside of the validation layer. Fixing this will let us implement a few things, such as the no error extension. It will also allow auto-generation of the entry points, since we won't have to have special cases for certain entry points. It will also help fix the syncState layering problem. Now the cached parameter helper (which is owned by the Context) can make the impl layer calls, instead of the validation layer calling the impl directly. We use a small array in Context to gather parameters in a generic way without reallocation on call. We also check type safety by storing a type info struct which can handle inheritance between type classes. Optional variables for the cache determine when to re-compute values. The intent with gatherParams is to call this in every entry point, and have in most cases be a no-op. In some cases like for IndexRange, we store some parameters for later use. The inheritance scheme enables auto-generation of the entry points by keeping signatures similar. BUG=angleproject:747 Change-Id: I871e99e1334cf6e61ef8da62fde3ced094903f8a Reviewed-on: https://chromium-review.googlesource.com/474119 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9f9b1d2d 2017-03-06T18:25:22 Make ScratchBuffer its own type. This helper tool in Renderer11 can be useful in other back-ends, or even in the front end. BUG=angleproject:1635 Change-Id: I18ec19a891a9bdfa7b80dea1b8e308abf206906b Reviewed-on: https://chromium-review.googlesource.com/450919 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 74ba76c4 2015-02-09T10:31:23 Move rx::MemoryBuffer to common library. This class is not D3D-specific so can be shared among other back-ends, or other parts of the ANGLE codebase. Change-Id: Ie00760eb5dae4db52e465ee7a2f97789bae8c0b0 Reviewed-on: https://chromium-review.googlesource.com/246500 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>