src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h


Log

Author Commit Date CI Message
Alexey Knyazev 779a25a8 2020-04-27T02:11:58 D3D11: Migrate to the new blend state tracking Migrate D3D ClearParameters struct to the new color mask storage Bug: angleproject:4394 Change-Id: Ibeb64e4bbb2758b9c8271fc3c59d2d675850b0a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165886 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 605ab763 2020-02-24T19:43:32 D3D11: Implement OES_draw_buffers_indexed Existing CONSTANT_COLOR/CONSTANT_ALPHA limitation was generalized to independent blend states with draw call invalidation and a new end2end test. dEQP tests that are incompatible with this limitation result in INVALID_OPERATION and are marked as FAIL. D3D11 renderer always normalizes and deduplicates requested blend states based on their enabled features and bound framebuffer. Bug: angleproject:4394 Change-Id: I284796e18be71de1b5bfb087d36f6a45be4c3f70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2070575 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev b8c6521a 2020-02-14T14:23:08 Reland "Move sampleAlphaToCoverage out of blendState" This is a reland of f6e73131c528b1317067624bc71c3ce41a48f9aa Aligned BlendStateKey fields Original change's description: > Move sampleAlphaToCoverage out of blendState > > This is the second step towards exposing OES_draw_buffers_indexed (that defines independent blend state for each draw buffer). This flag is global in all graphics APIs, however D3D11 technically puts it in the blend state. > > D3D11: BlendStateKey was extended to keep existing D3D11 state caching semantics. > > D3D9: a comment was added explaining why this feature was never implemented there. > > Bug: angleproject:4394 > Change-Id: Ie6a294eeb6fcf4c868a1f1001c4f7efd61692ccd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057063 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: angleproject:4394 Change-Id: Ia7aed863f0f9f6066daf1b02ecade3256f494062 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2066698 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 38bb9fdf 2020-02-19T13:02:00 Revert "Move sampleAlphaToCoverage out of blendState" This reverts commit f6e73131c528b1317067624bc71c3ce41a48f9aa. Reason for revert: Crashes on Win10 FYI x64 Debug (NVIDIA) and Win7 FYI Debug (AMD) in the webgl CTS Original change's description: > Move sampleAlphaToCoverage out of blendState > > This is the second step towards exposing OES_draw_buffers_indexed (that defines independent blend state for each draw buffer). This flag is global in all graphics APIs, however D3D11 technically puts it in the blend state. > > D3D11: BlendStateKey was extended to keep existing D3D11 state caching semantics. > > D3D9: a comment was added explaining why this feature was never implemented there. > > Bug: angleproject:4394 > Change-Id: Ie6a294eeb6fcf4c868a1f1001c4f7efd61692ccd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057063 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,lexa.knyazev@gmail.com Change-Id: I650624b5dfb7f2777c316906b9145a411243f42f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4394 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2062605 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Alexey Knyazev f6e73131 2020-02-14T14:23:08 Move sampleAlphaToCoverage out of blendState This is the second step towards exposing OES_draw_buffers_indexed (that defines independent blend state for each draw buffer). This flag is global in all graphics APIs, however D3D11 technically puts it in the blend state. D3D11: BlendStateKey was extended to keep existing D3D11 state caching semantics. D3D9: a comment was added explaining why this feature was never implemented there. Bug: angleproject:4394 Change-Id: Ie6a294eeb6fcf4c868a1f1001c4f7efd61692ccd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057063 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@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>
Jamie Madill 306b6c16 2018-07-27T08:12:49 D3D11: Use angle::Result error pattern. 1/3 This CL improves performance on the draw call microbenchmark by 10% when no-oping driver calls. Bug: angleproject:2738 Change-Id: I4f5c11db90d9056ce4557b2a4432bc55b42b5bba Reviewed-on: https://chromium-review.googlesource.com/1150093 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4166f014 2018-05-31T14:53:30 D3D11: Optimize Renderer11::drawArrays. Uses inlining and more efficient computation re-use to streamline this function. Bug: angleproject:2575 Change-Id: Ib13e32811f56ec9a010ed66f298d4235e5c6807d Reviewed-on: https://chromium-review.googlesource.com/1067120 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2274b652 2018-05-31T10:56:08 StateManager11: Cache impl objects. Also requires putting the Framebuffer ID in the shared state object. Bug: angleproject:2575 Change-Id: I68e3af839a85798e01050560a67624a165d3ed2c Reviewed-on: https://chromium-review.googlesource.com/1067119 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b05f3659 2017-09-12T15:23:05 D3D11: Consolidate Blend State application. This will make it easier to implement fast state switching on Context change. BUG=angleproject:2052 Change-Id: I045cc2164200a93215629a2746068e686d7c99ff Reviewed-on: https://chromium-review.googlesource.com/659234 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 518f5d55 2017-09-12T15:23:04 D3D11: Consolidate Depth Stencil State application. This will make it easier to do state update on context switch. BUG=angleproject:2052 Change-Id: Ia73cfd07ced40a9e22d6b34a5619250ede9e8844 Reviewed-on: https://chromium-review.googlesource.com/659233 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez db9e5d31 2017-06-12T12:05:45 D3D11: Only apply attachments that are written by the program This works around a bug in the AMD driver that writes 0's to the first attachment if it isn't written by the pixel shader. BUG=angleproject:2048 Change-Id: I384fd60c0e0a37fbc0fd7b69fe1ec74fe4ffac8f Reviewed-on: https://chromium-review.googlesource.com/531630 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill d222d454 2017-06-06T17:48:35 Use HashingMRUCache in InputLayoutCache. This simplifies the state management code inside this manager. Also it should improve the speed of lookups due to using hashing instead of a tree lookup. BUG=angleproject:1156 BUG=angleproject:2044 Change-Id: I19ea8dbac6f2dfd7d30dd403d77b66ba0aa85d73 Reviewed-on: https://chromium-review.googlesource.com/527693 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5ea762a6 2017-06-07T14:59:51 Consolidate base:: imports. This merges the mrucache and numerics into one folder, to prevent having to make two identical versions of logging. BUG=angleproject:2044 Change-Id: Iba6dab05b21eb9ba0de44f27a90579c590a9a7fd Reviewed-on: https://chromium-review.googlesource.com/522870 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ea19b4ac 2017-05-25T14:48:34 Don't store Renderer in RenderStateCache. Instead pass it around via methods. This makes the code a bit nicer. BUG=angleproject:2044 Change-Id: I721e190a2ecde2b1a65e57debf419ee06a5dce29 Reviewed-on: https://chromium-review.googlesource.com/516385 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 9216a6e2 2017-05-24T15:53:20 Introduce MRUCache. This library comes from Chromium's base, and is useful for many use cases in ANGLE. It can replace the custom MRU code we use in the RenderStateCache. It will also be useful for implementing a program binary cache. BUG=angleproject:2044 Change-Id: Iba166fe380d7ed4e3123428b0227b9d299f756d1 Reviewed-on: https://chromium-review.googlesource.com/516384 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 63d8c266 2017-05-29T13:35:09 Re-use std::hash in RenderStateCache. This will allow us to more easily take advantage of Chromium's MRUCache class. BUG=angleproject:2044 Change-Id: I3fad82fc825861dc1c2095f25da83159da76e76b Reviewed-on: https://chromium-review.googlesource.com/517359 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill aa0a5446 2017-05-25T13:30:23 Ensure gl State structs are zero filled. In some cases we would hash or memcmp against structs with bools or other non-filled data. This could have implementation differences, and may have been causing cache errors on Clang. BUG=chromium:721648 BUG=angleproject:2044 Change-Id: I981a1e6e8d50a33f7fade568497b72b919accfce Reviewed-on: https://chromium-review.googlesource.com/516383 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20805650 2017-05-25T12:20:59 D3D11: Consolidate state allocation. This cleans up the allocation and deallocation of Blend, DepthStencil, Rasterizer, and Sampler states. This patch introduces a LazyResource2 class, basically a replacement for LazyResource, which will be removed once the refactor is done. BUG=angleproject:2034 Change-Id: I4fa759ae479807ff69a629f89a08b01800ba3f66 Reviewed-on: https://chromium-review.googlesource.com/503627 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shahmeer Esmail 95f6cedd 2017-03-13T17:40:31 RenderstateCache and Clear11 Optimizations - Unify DepthStencilState and BlendState caches in RenderStateCache with those in Clear11. This will increase cache hit rate and reduce memory usage. - Apply DepthStencilState and BlendState only when required to reduce state sets. BUG=angleproject:1632 Change-Id: I244e3ba189f82814638fa90e2617aa5441024d0f Reviewed-on: https://chromium-review.googlesource.com/453888 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 15ede106 2015-11-26T15:20:34 D3D11: Disable stencil buffer when not attached. Similarly to the D24S8 attachment getting confused when we use only the stencil portion, ANGLE could write to the stencil portion when we were only using the depth. Fix this by internally disabling stencil test and writes when using this type of configuration. BUG=angleproject:1237 Change-Id: Ib7868d5e9f8aea73304a132005541dab947aa619 Reviewed-on: https://chromium-review.googlesource.com/314032 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0df8fe44 2015-11-24T16:10:24 D3D11: Don't read or write to the unused depth buffer. When using STENCIL8, we emulate it on D3D11 with D24S8, since there is no native stencil-only format. However in many places we would write to the depth part of this format, and confuse the D3D runtime when it would use the depth test. Fix this by never modifying the depth portion of the buffer, or reading from it. BUG=angleproject:1232 Change-Id: Ifd2e54eceae84e8deea85f439c132d07981b2286 Reviewed-on: https://chromium-review.googlesource.com/313996 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> 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 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>