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


Log

Author Commit Date CI Message
Xiaopeng Li 118ce6aa 2022-01-20T16:55:04 Support to open d3d12 shared handles For https://docs.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-createsharedhandle Bug: angleproject:6927 Change-Id: I0f0ce7bff37abfc278a167c6eec92eb3b6df1370 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3404060 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Aditya Kushwah f015ae81 2021-08-02T12:47:32 Implement onLabelUpdate method. This change will implement the onLabelUpdate method by calling from every TextureStorage object. Instead of using setDebugName, introduced two new functions, setInternalName and setKHRDebugLabel, which will set the internal name and KHR label respectively that will further be sent to D3D string. Bug: chromium:1164111 Change-Id: I401ca9f6e8a2099a8807f0d7f321efe74269f9f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067921 Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Aditya Kushwah ae24c9d3 2021-07-19T12:11:41 Remove space from internal debug name strings. This changes will reduce the amount of memory used by labels by removing the in between spaces from internal debug name strings. Bug: chromium:1164111 Change-Id: I0ec657789dade2c3c053966ffccfbd673186fdad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3039119 Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Michael Yu 7c253fca 2021-06-02T13:18:44 D3D11 additional context-loss logging This makes logging more consistent when we encounter context loss. In Renderer11::testDeviceLost, note DXGI_ERROR_INVALID_CALL is a valid GetDeviceRemovedReason, but was not detected prior. SwapChain11::resize and SwapChain11::reset added more logging, likewise with Context11::handleResult. This covers everywhere d3d11::isDeviceLostError is invoked, though that might not be exhaustive of all cases we detect device loss. Bug: b/188291915 Test: Manually trigger conditions to test logging. Change-Id: Idd57363101b53bc2d3c4c306ee78a42012a1a320 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935696 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Doug Horn <doughorn@google.com> Commit-Queue: Michael Yu <warty@google.com>
Rafael Cintron 416eb8a3 2021-03-25T13:27:33 Check return value of allocateResource instead of asserting allocateResource can fail if the device has been removed or there is no more video memory. Hence, the return value needs to checked for errors instead of simply asserting that the result doesn't equal angle::Result::Stop. Bug: chromium:1192771 Change-Id: I794f288f16917ef50e45f6f3ab60ee3ebc5941d9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2787249 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Rafael Cintron d809147f 2021-03-22T18:00:00 Enable D3D11 debug names in ANGLE release builds Previously, D3D11 debug names were only output in debug builds. This change enables them in release builds so we can debug GPU memory consumption given traces or full memory dumps. Where it made sense, existing names were shortened for brevity. A future CL can shorten the names further by removing the words texture, SRV, DSV, etc since D3D already outputs this type information. Bug: chromium:1164111 Change-Id: Iadd6222c29dd945115e844ec28ee395ce16c139f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2780564 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Trevor David Black e815afbf 2020-09-07T22:09:22 First pass at increasing inclusivity Link to the inclusivity rules https://source.android.com/setup/contribute/respectful-code Bug: b/162834212 Bug: chromium:1097198 Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Trevor Black <vantablack@google.com>
Jamie Madill a6206854 2019-10-24T12:55:09 Enable "-Wmissing-field-initializers". This is another warning required by Skia. This one didn't find anything that surprising. Enabling the warning does help enforce code consistency and avoids a bit of possible undefined behaviour. Bug: angleproject:4046 Change-Id: Ifec7f4afad49cd820bf3c0a79df3f46559473ee2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877477 Commit-Queue: Jamie Madill <jmadill@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 3ea463bf 2019-06-19T14:21:33 Move event tracer back into common. Requires that we update the TRACE_EVENT macros to accept a platform as an argument. The refactor isn't complete. In order to finish we'd need to ensure we have the Display's PlatformMethods available at all sites. Unblocks adding trace events directly in the perf tests. Bug: angleproject:1892 Bug: angleproject:3117 Change-Id: Iee0ca086ccfe23acab3fc186fb042f018711a94c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1664794 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 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>
Geoff Lang def1ba96 2018-09-28T13:43:41 Reland "D3D11: Resolve multisampled EGL surfaces at eglSwapBuffers" This reverts commit 799da6d18c5ac490e0cdfe9d4dedda26e10f6864. Reason for revert:Crashes have slowed down but there were two changes around the same time that may have caused it. Relanding this to see if things improve. Original change's description: > Revert "D3D11: Resolve multisampled EGL surfaces at eglSwapBuffers" > > An increased crash rate in rx::NativeWindow11Win32::createSwapChain has been > seen around the same time as this patch landed. Speculatively reverting. > > BUG=887403 > > This reverts commit a49f60fee74dfa1caed41ca2e010bc273a6c12cd. > > Change-Id: Id1b08efbf47196f17f4a5e509a29f7d628b07b49 > Reviewed-on: https://chromium-review.googlesource.com/1238884 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 887403 Change-Id: Id862fbb1c0e764470f0b7f6bdb97bf6bab95d26b Reviewed-on: https://chromium-review.googlesource.com/1251701 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 799da6d1 2018-09-21T15:10:57 Revert "D3D11: Resolve multisampled EGL surfaces at eglSwapBuffers" An increased crash rate in rx::NativeWindow11Win32::createSwapChain has been seen around the same time as this patch landed. Speculatively reverting. BUG=887403 This reverts commit a49f60fee74dfa1caed41ca2e010bc273a6c12cd. Change-Id: Id1b08efbf47196f17f4a5e509a29f7d628b07b49 Reviewed-on: https://chromium-review.googlesource.com/1238884 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Till Rathmann a49f60fe 2018-08-20T16:03:06 D3D11: Resolve multisampled EGL surfaces at eglSwapBuffers Support for multisampled EGL surfaces was added in 151d5de (2017-04-13, "Enable MSAA for texture client buffers") but the resolve step was missing because it was not needed for EGL_ANGLE_d3d_texture_client_buffer. However, when using MSAA with a regular EGL surface then resolving is required to get an antialiased image. Please note that the new test case CreateSurfaceWithMSAA does actually not test the newly added resolve step because the resolve is performed by the glReadPixels() call there. So it is rather a general test if MSAA works for EGL surfaces. TEST=angle_end2end_tests.EGLSurfaceTest.CreateSurfaceWithMSAA Change-Id: Ieafd6877fa510d5e16c0d9c6872c31fa73efa86c Reviewed-on: https://chromium-review.googlesource.com/1181138 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 7a5814e2 2018-07-27T08:12:50 D3D11: Use angle::Result error pattern. 3/3 This completes the initial refactor for the D3D11 back-end. Bug: angleproject:2738 Change-Id: I6bc59d6a1a724b3c64d6cd904e6748c2acf8f67d Reviewed-on: https://chromium-review.googlesource.com/1151452 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 30b84854 2018-07-09T09:18:50 SwapchainD3D: Take Display instead of Context. This cleans up another use of the proxy context. Bug: angleproject:2714 Change-Id: Icba5bf76a3e9f811ee571529de16fd8162c76b3a Reviewed-on: https://chromium-review.googlesource.com/1128928 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jeff Gilbert 20c46284 2018-02-22T18:18:01 Make OpenSharedResource() call become fallible in SwapChain11::resetOffscreenColorBuffer(). Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1415754 BUG=angleproject:2367 Change-Id: I69a75c38c6811752df6da9c3cba5901c9d8ab8c4 Reviewed-on: https://chromium-review.googlesource.com/935281 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Jamie Madill 1f9d6843 2017-09-21T11:01:44 StateManager11: Defer RenderTarget invalidation to draw. Although this adds a boolean check (and state flag maintenance) cost to each draw call, it makes ANGLE's internal life a lot simpler because it doesn't have to process a framebuffer change until the draw call. It turns out there are a few dependent checks of the Framebuffer that aren't always easy to do. In one test, Context destruction was triggering RenderTarget invalidation, after the Context had already freed the Framebuffer manager. This also fixes the problem in feature level 9_3 with framebuffer invalidation affecting the internal dirty bit set. (Note that it still dirties the Framebuffer for the next frame). BUG=chromium:767279 BUG=angleproject:2151 Change-Id: I74d61bddf9926004a04f712a9f9eb1205d5df0e1 Reviewed-on: https://chromium-review.googlesource.com/676657 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ea84f6ff 2017-09-20T13:20:30 Pass Context to Framebuffer11 dirty callback. This allows us to call StateManager11::invalidateRenderTarget from the Framebuffer11::signal function, which will then trigger state refresh on the next draw call. This requires passing Context through a few more Renderbuffer methods, and reorganizing the RenderTarget signalling so that it doesn't signal dirty in the destructor. Instead they are signaled as they are destroyed in the containing classes. BUG=angleproject:2151 Change-Id: I4cf575e4a01b48275ff78d75bc55b2d1fced591d Reviewed-on: https://chromium-review.googlesource.com/673139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill ace6822c 2017-09-12T21:56:20 Remove Renderer11::markAllStateDirty. Also remove StateManager11::invalidateEverything. With all state application consolidated in the StateManager, it should be aware of all state changes, and shouldn't need outside notifications. BUG=angleproject:2052 Change-Id: I6748b3944b25f958fa093052bcb7336e66255dd4 Reviewed-on: https://chromium-review.googlesource.com/659400 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill da7185fb 2017-09-12T15:23:07 D3D11: Consolidate SRV and Sampler application. This adds an internal and external version of the setShaderResource method. The external version sets the state as dirty. BUG=angleproject:2052 Change-Id: I6d2d47490c0af89ff5592d4e9c53eb69f8a3264d Reviewed-on: https://chromium-review.googlesource.com/659397 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7ef2ddab 2017-09-12T15:23:06 D3D11: Consolidate Viewport state application. BUG=angleproject:2052 Change-Id: I1cbf2adc09c82b9de68785265def9361eff418b3 Reviewed-on: https://chromium-review.googlesource.com/659236 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7f4fed80 2017-09-12T15:23:05 D3D11: Consolidate Rasterizer State application. BUG=angleproject:2052 Change-Id: I11094744bab4570712632a424f29dff8b19a8dea Reviewed-on: https://chromium-review.googlesource.com/659235 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Jamie Madill 85b63c8e 2017-09-12T15:23:03 D3D11: Consolidate OMSetRenderTargets calls. There were a few calls that were using the context directly. Consolidating them in the StateManager11 class should make efficient state update after a Context switch possible. Also remove the Context parameter from the setRenderTargets methods, since these are only used internally and should be dirtying other states themselves. BUG=angleproject:2052 Change-Id: I878c99fbde7a467f30cc89f2ee5aca476b8cf506 Reviewed-on: https://chromium-review.googlesource.com/659232 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 218ffc49 2017-09-07T11:32:59 SwapChain11: Create SRV copy texture lazily. We would allocate this texture for devices that don't need it. Instead do this lazily. This was showing up in the profiles for the MotionMark benchmark, possibly due to re-creating the surface. BUG=angleproject:1155 Change-Id: I28b5eda29e21899fc8afef054e1b8063e3cc2e00 Reviewed-on: https://chromium-review.googlesource.com/655479 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang a0d38875 2017-09-06T15:32:03 Don't create SRVs for multisampled depth stencil textures in FL10.0. Renderer11::createRenderTarget already fixed this issue but it also is exposed in SwapChain11::resetOffscreenDepthBuffer now that multisampled surfaces are supported in ANGLE. BUG=angleproject:2136 Change-Id: I978666ebc1bb3db14ddf69954d7eb750391bf7a8 Reviewed-on: https://chromium-review.googlesource.com/653779 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a42a4e5e 2017-08-28T14:02:12 D3D11: Copy external offscreen texture when required. In some cases ANGLE gets an external back buffer texture for our SwapChain11 class, and in some of these cases we get an offscreen texture that can't be used as a shader resource. The becomes a problem for some copy operations that use a shader to convert texture formats. Work around this problem by making a shadow copy of the texture that has sampling enabled - it is possible to use CopyResource to copy between them. BUG=chromium:752917 Change-Id: Ib757949d3d06295a118b055bf37311f820f7149c Reviewed-on: https://chromium-review.googlesource.com/638551 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a59a1c1e 2017-07-12T15:46:26 D3D11: Consolidate shader state application. This consolidates all the state changes for shaders into StateManager11. BUG=angleproject:2052 Change-Id: I64dc3af5b0f1459442369e09f93a9ca8ce3232b3 Reviewed-on: https://chromium-review.googlesource.com/531796 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 95107bc8 2017-07-12T15:46:25 D3D11: Consolidate primitive topology application. BUG=angleproject:2045 Change-Id: Ie1deac50a534ee748518d9ec5e6f749f3c78b53d Reviewed-on: https://chromium-review.googlesource.com/531795 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9c335865 2017-07-18T11:51:38 Refactor StateManager11 for dirty bits. This will make iterating over an internal set of dirty bits simpler. This also reorganizes the framebuffer invalidation logic a bit, including how the sample count is pulled from the Framebuffer. BUG=angleproject:1156 Change-Id: I79dbcd11704ab52568c587d836af9c1bff1d2d1f Reviewed-on: https://chromium-review.googlesource.com/529708 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Bryan Bernhart (Intel Americas Inc) caf20889 2017-07-05T15:26:44 Fix incorrect quality level with depth-stencil buffer and MSAA configs. Using a depth buffer format requires that the DSV and RTV have equal quality levels; otherwise, the bound render target will discard writes. BUG=angleproject:1917 Change-Id: Ife25b0a8958fa2b31b43a0d877d27e440916a9bf Reviewed-on: https://chromium-review.googlesource.com/560716 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 2cd45629 2017-06-08T20:14:13 D3D11: Consolidate Vertex Buffer application. With this change, IASetVertexBuffers is only called from a single code site in StateManager11. All other classes call through to here. This will make adopting the dirty bits for InputLayouts and VBs much simpler. BUG=angleproject:2052 Change-Id: I6e7b6146deb7f80f5f0e75dd0aff18eb4cc2bfc2 Reviewed-on: https://chromium-review.googlesource.com/524232 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill dcc9b51d 2017-06-05T15:28:45 D3D11: Consolidate input layout application. This merges all calls to IASetInputLayout to a single place in StateManager11. This means we no longer have to invalidate the state for D3D11, and can always lazily apply the input layout state. Introduces a new ResourceSerial class to replace the uintptr_t and DirtyPointer design. BUG=angleproject:2052 Change-Id: I76b874218b754395f25a129967c769b1f8f82115 Reviewed-on: https://chromium-review.googlesource.com/523025 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0fd806f1 2017-06-01T17:11:40 D3D11: Consolidate Shader allocation. Similar to the InputLayout init, this adds a small helper type to act as a wrapper around shader init data (binary and size). This also adds error trapping to the blit shader compilation. It also removes the LazyResource2 class, and the CompileXS helper methods. BUG=angleproject:2034 Change-Id: I3fd718393c8a0250e4263890f00d0e9147ec9567 Reviewed-on: https://chromium-review.googlesource.com/506776 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5978e28d 2017-06-02T11:49:31 D3D11: Consolidate InputLayout allocation. This introduces a helper type to act as the initialization data type for input element arrays. A WrappedArray class acts as a helper class to wrap a C array and size into a C++ class, similar to std::array but without the data storage. Also move resource deallocation memory counting into a single code path. BUG=angleproject:2034 Change-Id: I5e108254777f0df65f5f60fe26e760c71b95b542 Reviewed-on: https://chromium-review.googlesource.com/506775 Reviewed-by: Geoff Lang <geofflang@chromium.org> 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>
Jamie Madill bdc1e2a2 2017-05-24T14:40:27 D3D11: Consolidate Buffer allocation. We now allocate and release all buffer resources from a single place, allowing us to allocate junk memory, clear on init, and track the currently allocated buffer memory. BUG=angleproject:2034 Change-Id: Id60b63a7f77bc369dfc494a7587ab06c8d34a8e2 Reviewed-on: https://chromium-review.googlesource.com/503253 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2c479d6e 2017-05-24T14:37:22 D3D11: Use TextureHelper11 everywhere. This consolidates all texture allocation into ResourceManager11. It removes a lot of error checking and resource management code. In a few places we're storing some redundant information, like in TextureStorage11, we might store the Format pointer in two places, or the Texture's size. BUG=angleproject:2034 Change-Id: I9369e76925a67632c444c662e5667c5ed7875547 Reviewed-on: https://chromium-review.googlesource.com/503252 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e0e009fe 2017-05-19T14:13:03 D3D11: Consolidate SRV allocation. This change also moves all SRV storage to use the custom smart pointer classes in ResourceManager11. Every single SRV is now allocated in ResourceManager11. For TextureStorage11 and RenderTarget11, we use a shared pointer type since the SRVs use shared ownership by both classes. BUG=angleproject:2034 Change-Id: I90666fbbbc23ff10870b7401f3da09ef79258136 Reviewed-on: https://chromium-review.googlesource.com/503250 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 764a1e76 2017-05-18T11:11:47 D3D11: Consolidate DSV allocation. This uses the new classes introduced in ResourceManager11. Smart pointers mean we can use ANGLE_TRY in more places, and don't need to manually release these views. There is now a single point in the D3D11 back-end where depth stencil views are allocated. BUG=angleproject:2034 Change-Id: If0de2529ece1298e8babf24c07cc4be9849cc4de Reviewed-on: https://chromium-review.googlesource.com/503249 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 403c1682 2017-05-18T11:11:46 D3D11: Add resource manager classes. The resource manager tracks the allocations and deallocations of all D3D11 resources that have device memory: Buffers and Textures (which are either 2D or 3D). It also tracks the number of active Views (DSV, RTV, and SRV, potentially UAV with ES 3.1). A new smart pointer type will wrap the resource deallocation so that the object notifies the manager when ANGLE is done with the resouce. This allows us to track precisely how much GPU memory we think we're using at any point, and will help prevent resource leaks for these object types. It also makes initialization and releasing much more trivial. The base class for a resource uses a template template parameter so that we can use a unique or shared pointer depending on if the object in question needs unique or shared ownership. For some resources (in our case, SRVs are shared between the TextureStorage11 and RenderTarget11 classes, and Textures are shared in many places) we need to have the ability to have shared ownership. Unique ownership is a little bit more efficient so supporting both can be helpful. In this patch RenderTargetView allocation is moved to use the unique smart pointer. BUG=angleproject:2034 Change-Id: Idb1245c24cd66733b8b5ca524c727350b2d2c745 Reviewed-on: https://chromium-review.googlesource.com/503248 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>
Bryan Bernhart (Intel Americas Inc) 151d5de6 2017-04-13T09:52:23 Enable MSAA for texture client buffers Enhancement to the EGL_ANGLE_d3d_texture_client_buffer extension to allow use of a shared D3D texture that can be multi-sampled. BUG=angleproject:1917 Change-Id: Iaf59bbd575a5dfb29345f55b549bc4017bf2d7d0 Reviewed-on: https://chromium-review.googlesource.com/446907 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yunchao He 4f285443 2017-04-21T12:15:49 Refactoring: replace NULL by nullptr for pointers (2nd CL). This CL mainly handles the pointer comparisons (== or !=). BUG=angleproject:2001 Change-Id: I25ac3b61032e7ad91459a1c6541cadc87cf9b160 Reviewed-on: https://chromium-review.googlesource.com/483935 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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>
Stanislav Chiknavaryan ee218f27 2017-03-22T15:39:13 Re-land eglGetSyncValuesCHROMIUM extension. This reverts commit 20c97cac2a15144b61ceec7404a9e6249c40f50a and adds a few trivial changes to make it build with the current version of ANGLE code. Please see https://bugs.chromium.org/p/chromium/issues/detail?id=614147 for more details on how this extension will be used. Original description: This change adds implementation of eglGetSyncValuesCHROMIUM extension on D3D11 with Direct Composition. This should work on Windows 8.1 and above. The implementation is based on IDXGISwapChain::GetFrameStatistics. Extension documentation: https://chromium.googlesource.com/chromium/src/gpu/+/master/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_get_sync_values.txt BUG=angleproject:1402 Change-Id: I4b77899f31a4c4cf1fa7f20ab12de5a02ccf74d8 Reviewed-on: https://chromium-review.googlesource.com/459217 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang c5a2a172 2017-01-13T15:55:07 Add EGL_EXT_pixel_format_float support, enables float EGL surfaces. Add floating point EGL configs for the D3D11 backend. BUG=angleproject:1707 Change-Id: Ic84cd3a0d41e78cc39d0275d83e7695f55673ddf Reviewed-on: https://chromium-review.googlesource.com/428294 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
John Bauman 2add15ef 2016-12-14T17:34:05 Fix creating pbuffers on IDCompositionSurfaces. IDCompositionSurfaces can't be bound as SRVs, so don't try to create SRVs for them. Also, OMSetRenderTargets must have NumViews <= 1 if an IDCompositionSurface is being bound. MRT doesn't work with them, and just having the remaining elements be null isn't enough. BUG=678800 Change-Id: I76b28de7cbda772bff286eae2b83b70c9dcd2232 Reviewed-on: https://chromium-review.googlesource.com/431134 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: John Bauman <jbauman@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>
Stanislav Chiknavaryan 20c97cac 2016-11-04T18:27:56 Squashed commit of the following: commit 0146dfeefa47b520e71f0e74230abd7dac163a79 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:43:03 2016 -0700 Revert "Implementation of eglGetSyncValuesCHROMIUM extension." This reverts commit 5d9f5df01ac5a384d9b7cbb49d9f98a76b62c7ad. commit 0d920fe27bd8e73d831a9002548bde00fea78709 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:23:11 2016 -0700 Revert "Fix EGLSyncControlTest.SyncValuesTest timeout on Windowse Server 2012 R2" This reverts commit d258ca045f31eb43ec01b5501c84e9afd8e82cd6. commit bde8defe53741855bb71fbf27bcb0a91cfafbd01 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:22:58 2016 -0700 Revert "Disabling EGLSyncControlTest.SyncValuesTest" This reverts commit a74183613955bd891f56f6a979a5391c16c64138. commit f78e4b7e97b9d1259878f6902bb6ddeb0aeded87 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:22:36 2016 -0700 Revert "Fix and re-enable EGLSyncControlTest.SyncValuesTest" This reverts commit 138ec92f52da7c0fc8e6df08ac4e4e572bbf6b39. commit f3933e6a04bd23473077d2fd74616023db3c9601 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:20:26 2016 -0700 Revert "Handle nullptr mSwapChain in SwapChain11::getSyncValues" This reverts commit af7f301f6ba9e5f31d1511142a936a9ba84169d0. BUG=angleproject:1402 Change-Id: I99969e906e316574e9f739141de0e360d1edebd9 Reviewed-on: https://chromium-review.googlesource.com/408752 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stanislav Chiknavaryan <stanisc@chromium.org>
Geoff Lang 9fdc2c67 2016-11-01T10:45:13 Fix incorrect assertion in SwapChain11.cpp. BUG=angleproject:1144 Change-Id: I6186381d1aad13bbb07af47b3cf94d6ec7cbb566 Reviewed-on: https://chromium-review.googlesource.com/405693 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 60e6edfa 2016-10-31T12:17:19 Make ASSERT reference the conditional expression. This should prevent further unexpected bot breakage due to unreferenced variables in the ASSERT expression. Also remove the no longer needed variable referencing macro. BUG=angleproject:1586 Change-Id: I127695165bdfe39c51fe8d17e00daf6bf2fa8252 Reviewed-on: https://chromium-review.googlesource.com/404948 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiawei-Shao bc78fc61 2016-10-28T11:21:37 Fix a compile error in SwapChain11.cpp In function resetOffscreenColorBuffer, the local variable 'result' is never used in its scope, so when attempting to build a release version of Chromium with latest ANGLE on Windows, ninja will report a compile warning and stop the compilation: 'result': local variable is initialized but not referenced. The build failure starts at: https://chromium-review.googlesource.com/#/c/316804/ Change-Id: I29c05653f0d2e4f34c2e0402848f403ec2af8e5a Reviewed-on: https://chromium-review.googlesource.com/404515 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2018c0ba 2015-12-08T11:48:51 Add a EGL_ANGLE_d3d_texture_client_buffer extension. Allows creation of pbuffers from D3D texture objects. BUG=540829 BUG=angleproject:1144 Change-Id: If8ea717ef011608cd01357c217837133d726d3ea Reviewed-on: https://chromium-review.googlesource.com/316804 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stanislav Chiknavaryan af7f301f 2016-10-24T18:29:09 Handle nullptr mSwapChain in SwapChain11::getSyncValues There are 6 crashes in SwapChain11::getSyncValues on crash server. I looked at one of them and it is due to a nullptr mSwapChain which appears to be a valid state that is handled in other SwapChain11 methods. This change adds a similar check / returning an error to SwapChain11::getSyncValues. BUG=angleproject:1402 Change-Id: I9c17b884704b8aaaddf2d802911cd0ca961ae0b4 Reviewed-on: https://chromium-review.googlesource.com/402613 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stanislav Chiknavaryan <stanisc@chromium.org>
Stanislav Chiknavaryan 5d9f5df0 2016-09-27T13:28:25 Implementation of eglGetSyncValuesCHROMIUM extension. This change adds implementation of eglGetSyncValuesCHROMIUM extension on D3D11 with Direct Composition. This should work on Windows 8.1 and above. The implementation is based on IDXGISwapChain::GetFrameStatistics. Extension documentation: https://chromium.googlesource.com/chromium/src/gpu/+/master/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_get_sync_values.txt BUG=angleproject:1402 Change-Id: I306434dd8d85d618b14edfa38fc2a22e50fddacc Reviewed-on: https://chromium-review.googlesource.com/390351 Commit-Queue: Stanislav Chiknavaryan <stanisc@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 8cf70d55 2016-08-09T11:10:35 D3D11: Rename ANGLEFormatSet to Format. BUG=angleproject:1455 Change-Id: I896b3ed2d5e4ff3ad72de9a3a4b554841129e4e9 Reviewed-on: https://chromium-review.googlesource.com/367093 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c98cd326 2016-08-09T11:10:33 D3D11: Merge d3d11::TextureFormat and ANGLEFormatSet. BUG=angleproject:1455 Change-Id: I7fc2640ec9d73528feb526b4d8b89cabccda4d17 Reviewed-on: https://chromium-review.googlesource.com/367092 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 17b10a9a 2016-08-03T14:10:06 D3D11: Store more format info by-reference. This CL stores the d3d11::TextureFormat by reference in the texture storage. Adding the internalFormat to the TextureFormat allows us to store a single ref instead of three per TextureStorage11. Also store the format sets in a d3d11::TextureFormat by-ref instead of by-pointer, making the code a bit cleaner. BUG=angleproject:1455 Change-Id: I3c0e966d948c694435577d7d45dc0cd156480cdb Reviewed-on: https://chromium-review.googlesource.com/365412 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang b0a53105 2016-04-01T11:43:54 Add a NativeWindowD3D abstract class to handle native window interactions. The previous NativeWindow class included D3D11 headers while being included in all D3D backds and had platform-dependent includes and members. This turns it into an abstract class that only implements the minimal functionality for each renderer. BUG=angleproject:1345 Change-Id: I8f20339dd6bba719e574a1dcb3ec859897c9228f Reviewed-on: https://chromium-review.googlesource.com/336780 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 1a4523f3 2016-03-18T15:33:55 Avoid copying of texture format info structures Use const pointers to the statically allocated structures instead of copying them in TextureStorage11. This avoids the cost of copying and saves a little bit of memory. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: Ib59fddd68ba9bc53e491d55683416c0661f26e0e Reviewed-on: https://chromium-review.googlesource.com/333930 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill e9e15349 2016-03-04T15:16:42 D3D11: Remove RTV and DSV cache vars from Renderer11. These were only referenced by the StateManager11. Instead of using these cache variables, ensure the StateManager11 marks the RT as dirty and apply the RenderTarget state. Also remove the RenderTarget setters from Renderer11, and don't unapply RTs after a one-time set operation. The StateManager11 should take care of updating the necessary changes itself. BUG=angleproject:1321 Change-Id: Idc8d22ea9e92ac8d07392ab10d067df6084403bb Reviewed-on: https://chromium-review.googlesource.com/330462 Reviewed-by: John Bauman <jbauman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho f434906c 2016-02-22T14:53:26 Group D3D11 DXGI format info under a struct This patch refactors how DXGI format info is stored. The goal is to make it easier to make changes that affect both swizzle formats and regular texture formats, and make it easier to pass the format sets around. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I1cc220bccbbdde9200a41829fdc37c8ec123c6a1 Reviewed-on: https://chromium-review.googlesource.com/329072 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Austin Kinross 2a63b3f8 2016-02-08T12:29:08 Re-land "Implement EGL_experimental_present_path_angle" - Re-land with clang fix. This allows ANGLE to render directly onto a D3D swapchain in the correct orientation when using the D3D11 renderer. The trick is to add an extra uniform to each shader which takes either the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this value to -1.0. When rendering to the default framebuffer, ANGLE sets this value to +1.0. ANGLE multiplies vertex positions by this value in the VS to invert rendering when appropriate. It also corrects other state (e.g. viewport/scissor rect) and shader built-in values (e.g. gl_FragCoord). This saves a substantial amount of GPU time and lowers power consumption. For example, the old method (where ANGLE renders all content onto an offscreen texture, and then copies/inverts this onto the swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame on a Lumia 630. Verification: + dEQP GL ES2 tests pass when "present path fast" is enabled + all ANGLE_end2end_tests pass when "present path fast" is enabled BUG=angleproject:1219 Change-Id: I56b339897828753a616d7bae837a2f354dba9c63 Reviewed-on: https://chromium-review.googlesource.com/326730 Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c9bdeff4 2016-02-08T12:36:55 D3D11: Refactor RenderTarget apply into StateManager11. This is a refactoring patch only, and doesn't change the behaviour. The intent is to make it easy to turn on the Framebuffer dirty bits in a subsequent patch, once we can cleanly handle textures and renderbuffers getting recreated. BUG=angleproject:1260 Change-Id: Iaa5cfe222b020724e088eee5f1ae909b6f981a08 Reviewed-on: https://chromium-review.googlesource.com/325423 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d1c46228 2016-02-08T14:51:18 Revert "Implement EGL_experimental_present_path_angle" Compile failure on Clang/Win: The reason for reverting is: FAILED: ninja -t msvc -e environment.x86 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj.rsp /c ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp /Foobj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj /Fdobj\gpu\angle_end2end_tests.cc.pdb In file included from ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp:7: In file included from ..\..\third_party\angle\src\tests\test_utils/ANGLETest.h:13: ..\..\testing\gtest\include\gtest/gtest.h(1392,16) : error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ ..\..\testing\gtest\include\gtest/gtest.h(1422,12) : note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp(281,9) : note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here ASSERT_EQ(mWindowWidth * 4, mappedSubresource.RowPitch); ^ ..\..\testing\gtest\include\gtest/gtest.h(1960,32) : note: expanded from macro 'ASSERT_EQ' # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) ^ ..\..\testing\gtest\include\gtest/gtest.h(1943,67) : note: expanded from macro 'GTEST_ASSERT_EQ' EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ ^ BUG=angleproject:1219 This reverts commit 6b3c1db5170450bbc4946d8f18ba0d8619da43a0. Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6 Reviewed-on: https://chromium-review.googlesource.com/326680 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 6b3c1db5 2015-12-18T14:01:46 Implement EGL_experimental_present_path_angle This allows ANGLE to render directly onto a D3D swapchain in the correct orientation when using the D3D11 renderer. The trick is to add an extra uniform to each shader which takes either the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this value to -1.0. When rendering to the default framebuffer, ANGLE sets this value to +1.0. ANGLE multiplies vertex positions by this value in the VS to invert rendering when appropriate. It also corrects other state (e.g. viewport/scissor rect) and shader built-in values (e.g. gl_FragCoord). This saves a substantial amount of GPU time and lowers power consumption. For example, the old method (where ANGLE renders all content onto an offscreen texture, and then copies/inverts this onto the swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame on a Lumia 630. Verification: + dEQP GL ES2 tests pass when "present path fast" is enabled + all ANGLE_end2end_tests pass when "present path fast" is enabled BUG=angleproject:1219 Change-Id: Ib6eeea46bafa6ebce4adada0ae9db3a433b8fc4c Reviewed-on: https://chromium-review.googlesource.com/321360 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
John Bauman 7718c05b 2015-12-28T20:34:34 Enable EGL_ANGLE_keyed_mutex on D3D11 Pbuffers created using eglCreatePbufferFromClientBuffer from share handles created using keyed mutexes can now have their keyed mutex queried. All other pbuffers will continue to be created without keyed mutexes. BUG=337606 Change-Id: Id9039064dd8c89fe1706cc8ecb31111c994761fc Reviewed-on: https://chromium-review.googlesource.com/324253 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 89853e84 2016-01-28T10:36:36 Clean up unused variable macros. We might want UNUSED_ASSERTION as a special case but the unused trace variable macro was being abused in places. BUG=angleproject:1290 Change-Id: I5f9252b3ff0484d2e859b9fcf68d5d060b28f1fc Reviewed-on: https://chromium-review.googlesource.com/324290 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Hans Wennborg e1743f37 2016-01-06T05:24:22 Clang warning fixes This fixes member initialization order and unused private member warnings that broke the Clang build after the last Angle roll. BUG=82385 Change-Id: If866f352bda6d66093c180fdbec6c16bf902b628 Reviewed-on: https://chromium-review.googlesource.com/320466 Reviewed-by: Nico Weber <thakis@chromium.org> Tryjob-Request: Nico Weber <thakis@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Geoff Lang <geofflang@chromium.org> Tested-by: Nico Weber <thakis@chromium.org>
John Bauman 49ae88ba 2015-12-09T16:44:29 Implement EGL_ANGLE_direct_composition extension On D3D11, if dcomp.dll can be loaded then EGL_ANGLE_direct_composition is exposed. Setting EGL_DIRECT_COMPOSITION_ANGLE as an attrib on a surface will force it to use DirectComposition to draw to the screen, possibly saving power. BUG=524838 Change-Id: I3ea175a97bbca1a3388ffe52fdd1587a2f0c2ce7 Reviewed-on: https://chromium-review.googlesource.com/319214 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: John Bauman <jbauman@chromium.org>
Geoff Lang 7f448b58 2015-12-16T13:31:57 Add an EGL_ANGLE_surface_orientation extension. BUG=angleproject:1262 Change-Id: Ifbb0f5302311a68a0c6f02baaea706cbb7055a52 Reviewed-on: https://chromium-review.googlesource.com/320011 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 666cb828 2016-01-04T17:44:09 Revert "Add an EGL_ANGLE_surface_orientation extension." Compilation warnings on clang. This reverts commit 18cc14b5951842ede85c06dcbc0bba230bcedc45. Change-Id: If58047486116e34ef30c4b317d3fb47cd2349d15 Reviewed-on: https://chromium-review.googlesource.com/319822 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 18cc14b5 2015-12-16T13:31:57 Add an EGL_ANGLE_surface_orientation extension. BUG=angleproject:1262 Change-Id: I863c46c8557604da045447550f7d69831c9f06b5 Reviewed-on: https://chromium-review.googlesource.com/318780 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Dian Xiang db3dd083 2015-09-16T20:16:01 Refactoring TextureFormat and its helper functions to individual classes BUG=angleproject:1160 This is the first step to BUG=angleproject:1160, optimizing GetTextureFormatInfo to use static switching rather than building maps and using the find function. Also reordered the includes in alphabetical, src files first format The next step is to modify the GetTextureFormatInfo not to build a map but to use static switching. The step after that is to use a JSON generator to generate the switching, hence refactoring TextureFormat to be in its own class so we only need to generate what's necesary. The helper functions such as swizzle texture format can also be done using the same approach. Hence, they're also refactored into their own files. Change-Id: I753f437ca0df69ee5584d254fe0d2ea8b09a857e Reviewed-on: https://chromium-review.googlesource.com/300288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
Jeff Muizelaar d17c016b 2014-10-27T14:10:35 Add support for RESOURCE_MISC_SHARED_KEYEDMUTEX Change-Id: I225f38b4616ac47e690dccbcb67074fedc571d61 Reviewed-on: https://chromium-review.googlesource.com/225642 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 0bf58eab 2015-07-09T12:47:29 Renderer11: expose a metric for the Buffer11 CPU copies size This will allow us to measure the impact of subsequent optimizations on the memory consumption of Chrome. BUG=angleproject:916 Change-Id: Ib57fdfcc2950917eff33080bfb3db574595ecb6d Reviewed-on: https://chromium-review.googlesource.com/284637 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Nico Weber cb8ff7fb 2015-07-09T21:52:54 clang/win: Fix a -Wreorder warning ..\..\third_party\angle\src\libANGLE\renderer\d3d\d3d11\SwapChain11.cpp(30,7) : error: field 'mDepthStencilRenderTarget' will be initialized after field 'mPassThroughResourcesInit' [-Werror,-Wreorder] mDepthStencilRenderTarget(this, renderer, true), ^ While here, also reorder the fields that are initialized in the constructor to match the order the fields are declared in, to make it easier to see if any are missing. No intended behavior change. BUG=505304 Change-Id: If48195c84161868d33d4361088d3ad22b7a0fc31 Reviewed-on: https://chromium-review.googlesource.com/284682 Reviewed-by: Nico Weber <thakis@chromium.org> Tested-by: Nico Weber <thakis@chromium.org>
Jamie Madill 8fc55c8e 2015-06-30T11:04:18 Lazily load SwapChain11 pass-through resources. This allows Chromium to avoid initializing a whole bunch of resources and a shader when it collects GPU information. This should speed up startup. BUG=angleproject:1014 Change-Id: Id1e777c6ea86d66ad812540f9d8494744cda64de Reviewed-on: https://chromium-review.googlesource.com/282553 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cooper Partin 1bd7dd45 2015-06-11T08:58:53 Added 16-bit formats to GLConfigs to reduce offscreen texture memory usage. BUG=angleproject:1042 Change-Id: I7024bd47601a21b08cafbf6460d512151b53d035 Reviewed-on: https://chromium-review.googlesource.com/277002 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@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 6ee1e786 2015-05-29T17:05:37 Implement GL_EXT_debug_marker in D3D9/D3D11 renderers BUG=angleproject:1043 Change-Id: I7f3bfb35050662520b901828d0478719fa8d11b3 Reviewed-on: https://chromium-review.googlesource.com/274054 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Cooper Partin ab4fd98f 2015-05-15T14:58:22 Small fixes for passing code analysis tools. BUG=angleproject:1005 Change-Id: I8f2a6c0a5a6157303e436b96cc4c4ff1c29cfe18 Reviewed-on: https://chromium-review.googlesource.com/271600 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Sunny Sachanandani d176dbd7 2015-05-07T16:25:51 Enable postSubBuffer on D3D11 with DXGI 1.2. BUG=147291 Change-Id: Iafddb83b4949168f1c59272a99ae0244d86ce3f9 Reviewed-on: https://chromium-review.googlesource.com/270572 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Sunny Sachanandani <sunnyps@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>
Jamie Madill c9d13d2d 2015-04-14T14:53:06 Add trace events for D3D11 initialization. This helps a local user profile their D3D11 startup time. BUG=436191 BUG=angleproject:966 Change-Id: Ib1b3d62194233cd502980d87c316a95e9bd3a04c Reviewed-on: https://chromium-review.googlesource.com/264935 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
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>
Jamie Madill f4bf3811 2015-04-01T16:15:32 Use GetAs/GetImplAs whenever possible. This patch cleans up the rest of our custom casting helper functions. Change-Id: I41975c736765fca855c4498acca31116df3e8317 Reviewed-on: https://chromium-review.googlesource.com/263477 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
Jamie Madill c46f45d9 2015-03-31T13:20:55 Refactor DefaultAttachments. Instead of using an Impl type for default attachments, store the egl::Surface pointer where possible. BUG=angleproject:963 Change-Id: I3e34849e8b1ccae0c91a79617ec6f64aaaab6b10 Reviewed-on: https://chromium-review.googlesource.com/263483 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross b8af723d 2015-03-16T22:33:25 Fix and enable warning C4245 (signed/unsigned mismatch) Change-Id: If48043835fcc98341a0626e3ece7d0e3f7958059 Reviewed-on: https://chromium-review.googlesource.com/260630 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cooper Partin <coopp@microsoft.com> Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>