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


Log

Author Commit Date CI Message
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>
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>
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>
Shahmeer Esmail b5e884a4 2017-03-09T19:33:33 Clear11 VerticesTransform, RasterizerStates, ScissorRect - Skip clears if an empty scissor rect is set - Use rastStates to apply scissoring instead of recomputing the scissored positions and updating the VB and updating the VB for every clear - Use ComPtrs for VB and RasterizerStates BUG=angleproject:1934 Change-Id: Ib4448d8568b465df5de57607be4985095f6bd014 Reviewed-on: https://chromium-review.googlesource.com/453881 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Shahmeer Esmail fe34780f 2017-03-13T17:07:08 RenderStateCache BlendState Hash Fix Fix hash function for blendState cache BUG=angleproject:1937 Change-Id: I0acd7dfcfb933b2b7ff0c1dc6854c7623ec57b3b Reviewed-on: https://chromium-review.googlesource.com/453887 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahmeer Esmail e5cdca7e 2017-03-13T16:45:56 RenderStateCache memory usage Reduce RenderStateCache cache sizes from 4k to 2k. Saves 64kb of memory. Change-Id: I9e92bbdf095f1e66cf9b84ba81899a8af59d6d86 Reviewed-on: https://chromium-review.googlesource.com/453886 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov d73f852f 2017-01-13T17:48:57 Reland "Replace gl::trace logging with Chromium style logging" Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. Fix incorrect enabling of ERR() calls in UNIMPLEMENTED() and UNREACHABLE(), resulting in increased code size and <iostream> adding 5 static initializers to chrome because of cerr referenced in statically linked translator. BUG=angleproject:1660 Change-Id: I7caa18036118d532e0544f75278602559172ae04 Reviewed-on: https://chromium-review.googlesource.com/431457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6a6b09c9 2017-01-12T21:52:29 Revert "Replace gl::trace logging with Chromium style logging" Failing Chromium static initializers check: FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower Possibly due to the static initializer for std::array for the log severity types. We should change it to POD. BUG=angleproject:1660 This reverts commit afcc41cee4ff63e7f6c9e60e55fc061adbba7dd4. Change-Id: Ifb362a4af78542608397c7a0b19e6afe076f2cf3 Reviewed-on: https://chromium-review.googlesource.com/427235 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov afcc41ce 2016-12-13T12:59:39 Replace gl::trace logging with Chromium style logging Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. BUG=angleproject:1660 Change-Id: I58192988ad16196706fe48d0c0ab0fd1a10c0210 Reviewed-on: https://chromium-review.googlesource.com/424173 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
He Yunchao acd1898e 2017-01-04T10:46:42 Replace Error(GL_NO_ERROR) with NoError(). In order to make the errors be consistent throughout ANGLE. BUG=angleproject:1686 Change-Id: I0a2d86091d640aedeac94beae345c1fb6971b00d Reviewed-on: https://chromium-review.googlesource.com/424835 Commit-Queue: Yunchao He <yunchao.he@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang c1984ed4 2016-10-07T12:41:00 Implement robust TexParameter and SamplerParameter entry points. BUG=angleproject:1354 Change-Id: I3aa2dcb8603a839f9c07cd9dd41cb695d2e699f2 Reviewed-on: https://chromium-review.googlesource.com/395529 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 60ec6ea7 2016-01-22T15:27:19 Implement dirty bits for Framebuffer. The dirty bits set the stage for performance improvements in D3D, but don't actually reduce any of the redundant work just yet. BUG=angleproject:1260 Change-Id: Ib84e6a9b7aa40c37c41790f492361b22faaf4742 Reviewed-on: https://chromium-review.googlesource.com/318730 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Tested-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>
Daniel Cheng f33ab835 2015-06-30T19:08:16 Fix some clang warnings with -Wmissing-braces in ANGLE. Clang warns if there are missing braces around a subobject initializer. The most common idiom that triggers this is: STRUCT s = {0}; which can be more simply written as: STRUCT s = {}; BUG=505297 Change-Id: Ib4513ee195d43e7c4a4a2f46c328866f0023a2a5 Reviewed-on: https://chromium-review.googlesource.com/282921 Reviewed-by: Kenneth Russell <kbr@chromium.org> Tested-by: Kenneth Russell <kbr@chromium.org>
Sam McNally 5a0edc62 2015-06-30T12:36:07 Change intializer list order to match field order. BUG=505304 Change-Id: I38149e72732f0b4eb7d398f90b5d11660e2a7fbc Reviewed-on: https://chromium-review.googlesource.com/282465 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross ba8a0bf8 2015-05-13T09:48:59 Add plumbing for D3D11 device caps BUG=angleproject:1002 Change-Id: Id24783c75377ea92a73a43f2605693e07f63dc15 Reviewed-on: https://chromium-review.googlesource.com/270545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Minmin Gong 794e0009 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: Id0e06d7d6600344d858f00dabc219d79289bbc82 Reviewed-on: https://chromium-review.googlesource.com/265020 Tested-by: Minmin Gong <mgong@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b3584fb4 2015-04-09T17:34:21 Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)" Causing a build failure on Mac/Clang: ./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens] #else if defined(_MSC_VER) http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136 This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc. Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7 Reviewed-on: https://chromium-review.googlesource.com/264983 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong 3b26e231 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: I73d9a2b9ad16f032be974b9c819de0dc1247c2ea Reviewed-on: https://chromium-review.googlesource.com/264533 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jacek Caban e842eabd 2015-03-26T16:50:35 Fixed compilation with mingw. Change-Id: I027cedc383efbd215e55a7ddf4e41eb1c368a1ae Reviewed-on: https://chromium-review.googlesource.com/262590 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jacek Caban <cjacek@gmail.com>
Jamie Madill 85a1804d 2015-03-05T15:41:41 Make getColorAttachmentsForRender D3D-only. This encapsulates the workaround in the D3D renderer, and also optimizes the workaround to only compute a new set of attachments when there is a change to the state. BUG=angleproject:930 Change-Id: Ibdc15078236e2d19b544fae8e65b7f2554f31844 Reviewed-on: https://chromium-review.googlesource.com/254102 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7147f01a 2015-03-05T15:41:40 Cleanups to FramebufferD3D. With the new shared state structure, we can eliminate a lot of the state tracking within the FramebufferD3D implementation. BUG=angleproject:930 Change-Id: I0953e321bae3afe7cde7b73c55af62546665c890 Reviewed-on: https://chromium-review.googlesource.com/254101 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 215b37a6 2014-12-22T12:56:07 Work around zero-LOD mipmap issue on D3D11 Feature Level 9_3 In OpenGL ES, it is possible to sample from level 0 of a mipmapped texture by setting GL_TEXTURE_MIN_FILTER to GL_NEAREST. This is possible in D3D9 and D3D11 Feature Level 10_0+ via various methods. It's not possible in D3D11 Feature Level 9_3, though. This change works around this restriction by creating two copies of each texture on 9_3. The textures are identical, except one has mipmaps and one doesn't. The D3D11 renderer figures out which texture to use at the right time, and keeps the textures in sync with each other as necessary. Note: each texture is only created when it's needed. It's possible that only one (or even neither) D3D texture will be created for a given GL texture. Change-Id: I3c17137b4f63b9158b3abf067ad8e5d5c49d2191 Reviewed-on: https://chromium-review.googlesource.com/234522 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@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>