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


Log

Author Commit Date CI Message
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>
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>
Alexey Knyazev caf7becc 2020-02-11T19:05:11 Move dither from blend state to rasterizer state Dither is technically not a part of blend state so it was removed from there as a first step towards exposing OES_draw_buffers_indexed (that defines independent blend state for each draw buffer). Rasterizer state seems to be the closest (although also not accurate) place for it to keep code changes to a minimum. ANGLE's D3D11, Vulkan, and Metal renderers ignore dithering altogether. Bug: angleproject:4394 Change-Id: Ib138624b9218851d18cd63e2033e8e8ac8ca71d9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2050464 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xinyi He 4c7db77e 2019-10-31T15:42:31 Vulkan: Set limitation on maxComputeWorkGroupCount According to Table 20.45 and Chapter 17 in the ES 3.1 spec, MAX_COMPUTE_WORK_GROUP_COUNT is get as a GLint by using GetIntegeri_v. However, it is an unsigned integer in the Vulkan. It needs to set limitation on maxComputeWorkGroupCount[] during translating. 1. Change the data type to GLint stored in Caps. 2. Ensure that the limitation is set during initialization. 3. Add workaround for angleproject:4120 Bug: angleproject:4066 Change-Id: I1659ba1d560e30b9599cace0feeab8a18890c3ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1890586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mingyu Hu 7e44ec26 2019-08-26T15:59:48 GL_EXT_multisampled_render_to_texture extension. Part 1. Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before. Bug: angleproject:980428 Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: 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 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>
Jonah Ryan-Davis beb0eb2d 2019-06-14T15:10:33 Clean up workarounds/features to single location. Rename all workarounds structs to features, and move the lists to a shared location in include/platform (to help with documentation, see: https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?sq=package:chromium&g=0&l=69) Bug: angleproject:1621 Change-Id: I4069f08131db5e886047a007efb5d7764dfee5f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660952 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mingyu Hu 7d64c486 2019-03-12T14:27:40 GL_ANGLE_multiview has been renamed to GL_OVR_multiview2. changes include: 1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change 2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported 3) WebGL 2 (ES3) is required for multiview Bug: angleproject:3341 Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill e4634a13 2018-11-14T09:54:35 Apply code formatting. Several files were formatted by the code generation script. Bug: angleproject:2957 Change-Id: I8a5cbf2c17297a3644686004a8981ab2305c1ada Reviewed-on: https://chromium-review.googlesource.com/c/1334428 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 526392dd 2018-11-16T09:35:14 Use angle::Result in front-end (Part 9) This removes the ANGLE_TRY_HANDLE macro. Also the internal uses of gl::ErrorStreamBase. There are remaining uses in the validation code. Further progress will be blocked on removing egl::Error and the use of gl::Error in the validation layer. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: I3e0481f99738f9f24256c10e73f3efcce9826a35 Reviewed-on: https://chromium-review.googlesource.com/c/1334427 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 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 b1565903 2018-07-27T08:12:48 D3D: Pass gl::Context to many more functions. This makes the Context more available for logging errors. Also includes more refactoring to VertexDataManager to ensure we can access the gl::Context. Bug: angleproject:2738 Change-Id: Iae3d22a1403078d236bfe63a3e2d203c13678dc4 Reviewed-on: https://chromium-review.googlesource.com/1151449 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a2f043d8 2018-07-10T17:21:20 dEQP: Implement platform error handling. Also downgrades several Vulkan UNIMPLEMENTED() to WARN(). Also downgrades a couple D3D-specific errors to warnings. Also downgrades an undefined behaviour integer clear error to warning. Also includes suppressions for failing D3D11 ES 3.1 SSBO tests. Also includes suppressions for failing Android GLES format tests. Also includes suppressions for failing Android Vulkan buffer tests. Bug: angleproject:2552 Bug: angleproject:2567 Bug: angleproject:1951 Bug: angleproject:2405 Change-Id: Ie619085021d42012cd578b669f7ff4252ca41a58 Reviewed-on: https://chromium-review.googlesource.com/1062791 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Bryan Bernhart (Intel Americas Inc) ca71c75d 2017-12-15T13:39:57 Fix error handling of ID3D11DeviceContext::Map Refactors error handling should map() fail to avoid crashing during a device error event. BUG=angleproject:2284 Change-Id: Ib1eb676860fa5c3a81e523f49aab82b7e6700f73 Reviewed-on: https://chromium-review.googlesource.com/826485 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 f1b47e89 2017-11-21T22:58:31 Fix ComputeGenericHash. ANGLE's internal hash maps would run MurmurHash on c++ structs to come up with hash values. Since the hash ran on 4 byte words only, it would have no understanding that sometimes our structs would only have meaninful data in the first N bytes, and would include the garbage at the end in the hash calculation. This fixes the problem by forcing our structs to be aligned at compile-time. It also adds custom copy operators for a few classes to ensure that all bits are copied when the struct is initialized, including the padding. Bug: angleproject:1569 Bug: chromium:721648 Change-Id: I4d11f6e12d9a067b36e1416c7ed15586eff99aab Reviewed-on: https://chromium-review.googlesource.com/783990 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Gilbert 20c285ec 2017-10-31T19:01:09 callClearTwiceOnSmallTarget is needed for all sizes. Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1325733 BUG=angleproject:2214 Change-Id: I6837a0fbf0bbbd0877f333f0625729445a5999aa Reviewed-on: https://chromium-review.googlesource.com/748320 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 05b35b21 2017-10-03T09:01:44 D3D11: Lazy robust resource init. This patch moves the robust resource init logic to the GL front-end. Instead of initializing texture resources immediately on creation in D3D11, it defers the clear until before a draw call in some cases, or skips the update if we can determine if a texture (or other resource) has been fully initialized. Currently lazy init is only implemented for Textures, Renderbuffers, and Surfaces. Various places where lazy resource init is triggered: * Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels) * Texture operations (SubImage, GenerateMipmap, CopyTexImage) Some efficiency gains remain to be implemented, such as when a SubImage call fills the entire object. Similarly for Blit, and a few other operations. In these cases we can skip lazy init as an optimization. Edge cases with EGLImage are mostly untested. BUG=angleproject:2107 Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8 Reviewed-on: https://chromium-review.googlesource.com/576058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill f1581583 2017-09-20T21:57:28 Minor cleanup to setIndexBuffer. This cleans up the point sprites dirtying logic into applyIndexBuffer. This series of small optimizations gives about a 15% improvement on the draw call benchmark for the D3D11 backend with the null driver. BUG=angleproject:1155 Change-Id: I210dd408d11ef5a0b58b0ad32d1255c787a55fba Reviewed-on: https://chromium-review.googlesource.com/666047 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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 5c307292 2017-09-12T18:59:45 Consolidate Index buffer application. Was used in a couple other places. BUG=angleproject:2052 Change-Id: Ib335271a42c9569bbb452b6de8b683023cfc5900 Reviewed-on: https://chromium-review.googlesource.com/659399 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 2cedb58c 2017-09-12T15:23:08 D3D11: Consolidate Scissor state application. BUG=angleproject:2052 Change-Id: Ib6f55be3d71d083a87e845447f174a55413c8a2f Reviewed-on: https://chromium-review.googlesource.com/659398 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 2dc027da 2017-09-12T15:22:58 D3D11: Consolidate constant buffer application. This will let the StateManager11 work more easily with dirty bits. BUG=angleproject:1390 BUG=angleproject:2052 Change-Id: I9738d02e69e2062feeba4237487ad8e9ae86e78b Reviewed-on: https://chromium-review.googlesource.com/659227 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev 18b75bad 2017-08-15T15:50:40 D3D11: Handle Clear* commands for layered framebuffers According to the ANGLE_multiview spec, Clear* commands only affect the range of attached layers to the multi-view layered framebuffer. The patch extends ImageIndex so that the range of attached layers is tracked and a render target view can be created with that range of texture array slices attached. The special case of scissored clears for depth and stencil attachments is handled by instancing the same number of quads as there are views and selecting the layer within a geometry shader. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ibea248b980513f83d918652030a72c62c7ecd88b Reviewed-on: https://chromium-review.googlesource.com/632256 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 92996b0d 2017-08-17T10:39:02 D3D11: Fix masked clear unused RTV warning. This benign warning would show up in the Debug layer messages. It was causing the test to fail in some standalone configurations. This fix implemented here is to keep 8 different pixel shaders, one for each total count of render targets, up to the implementation max. BUG=angleproject:2025 Change-Id: I826ddae686ddb1cfad17879644152be2f6125c5b Reviewed-on: https://chromium-review.googlesource.com/617512 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 5c00d0db 2017-08-07T10:06:59 D3D11: Handle Clear* commands for side-by-side framebuffers The patch modifies Clear11 to add support for clearing the color, depth and stencil attachments to a side-by-side framebuffer: - Color attachments are cleared through the command ClearView. - Depth and stencil attachments are cleared by drawing a quad on top of each view. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I5753a72222216a48cd954eb1219bc58f968735fc Reviewed-on: https://chromium-review.googlesource.com/603853 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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 c174db3a 2017-06-13T15:44:00 D3D11: Apply a non-null blendstate in masked depth clear. In https://chromium-review.googlesource.com/c/453888/, we changed how blendstates were applied in masked clears. This change would apply a null blendstate when all color channels were disabled, but this seems to have an issue on Intel Cherry View drivers. Work around this issue by restoring the prior functionality of making a simple masked blend state. Also clean up some of the code style in the Clear11 class. BUG=chromium:730126 Change-Id: I9a4044201b2f07e9483525513a59e19bb2a8bcd3 Reviewed-on: https://chromium-review.googlesource.com/533684 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 60f6eb20 2017-05-08T15:34:46 Add WebGL test that draws to missing attachment. In WebGL one can Clear, DrawArrays, and DrawElements to a framebuffer with a missing attachment with no error. BUG=angleproject:1822 Change-Id: I4dece2fa8fad31c812e24ae18bdc380c2857a1f8 Reviewed-on: https://chromium-review.googlesource.com/502967 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@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 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 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 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>
Shahmeer Esmail 5416f753 2017-03-09T22:02:43 Clear11 Shader Optimizations and Shader Management Rework - ClearShader made into a class that manages all required shaders and input layouts for clears - ClearShader reuses VS for all clear types. This reduces shader compilation time and memory usage significantly - Use constantBuffer for color/z values instead of VB to decouple VB & VS from clearType and allowing for the same VS to be used for multiple clear types - FL10+ Devices: Generate positions using SV_VertexID in VS to avoid having to bind VB. - FL93 Devices: Use an immutable VB containing only position data (SV_VertexID not supported) - Implement CB cache. Incoming color/Z values checked against cache and CB/cache only updated if there is a mismatch. Significantly reduces the frequency of expensive CB map/rename operations especially in common scenarios where most/all clears use the same color/z values BUG=angleproject:1935 Change-Id: I2015fbdcc135ba08b65dbecbe9c62499c2801037 Reviewed-on: https://chromium-review.googlesource.com/453882 Commit-Queue: Shahmeer Esmail <shahmeer.esmail@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Geoff Lang d90d388c 2017-03-21T10:49:54 Make sure the default framebuffer has enough draw buffer states. Querying the draw buffer states of the default framebuffer would lead to crashes because it only had one state. The spec says that all non-zero attachments default to GL_NONE and makes no mention of special cased errors for querying the default framebuffer. Also fix the validation to check for extensions and ES version when querying draw buffer state. BUG=703508 Change-Id: I7db5443141c65a3f9c638f07ba90f78d76e4e7b4 Reviewed-on: https://chromium-review.googlesource.com/457524 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7bb425c6 2017-02-03T18:10:05 Revert "D3D11: Clean up blendState code." This reverts commit 786ad3876730c72311c64cf2f297e671ced847a5. Reason for revert: Seems to have a bug with binding the BlendStates, causing a crash on Intel. https://luci-milo.appspot.com/buildbot/chromium.gpu.fyi/Win10%20Release%20%28Intel%20HD%20530%29/141 Failing WebGL 2 tests WebglConformance_conformance2_reading_read_pixels_from_fbo_test WebglConformance_deqp_functional_gles3_readpixel Also generates D3D11 runtime warnings: D3D11 ERROR: ID3D11DeviceContext::Draw: The renderTarget bound to slot 0 has a format (R8_UINT) that does not support blending. The Pixel Shader output signature indicates this output could be written, and the Blend State indicates blending is enabled for this slot. [ EXECUTION ERROR #376: DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING] BUG=angleproject:1632 BUG=chromium:688419 Original change's description: > D3D11: Clean up blendState code. > > Masked Clear Draw Changes: > - Use universal blendstate object > - Eliminate blendState cache for masked clears > - Use rasterState and scissor rect for scissoring instead of adjusting vertex positions > - VB contains only static position data (per vertex color removed) > - Clear color(s) and depth clear values now passed in using a constant buffer > - MultiColorclear shader used for float clears to workaround alpha rounding issues > - Update shader compile script and shader source and bytecode headers > - Remove unused shaders (source and bytecode headers) > - Use com pointers where possible for D3D11 objects > > BUG=angleproject:1632 > > Change-Id: I98e38451bd453f53b772fe93ec9dcceb4196ea58 > Reviewed-on: https://chromium-review.googlesource.com/413736 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Shahmeer Esmail <shahmeer.esmail@intel.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> > TBR=geofflang@chromium.org,jmadill@chromium.org,shahmeer.esmail@intel.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=angleproject:1632 Change-Id: Iea537505d8cce7241edaba1f1d9f404abb1d9a10 Reviewed-on: https://chromium-review.googlesource.com/437306 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahmeer Esmail 786ad387 2016-11-22T14:56:27 D3D11: Clean up blendState code. Masked Clear Draw Changes: - Use universal blendstate object - Eliminate blendState cache for masked clears - Use rasterState and scissor rect for scissoring instead of adjusting vertex positions - VB contains only static position data (per vertex color removed) - Clear color(s) and depth clear values now passed in using a constant buffer - MultiColorclear shader used for float clears to workaround alpha rounding issues - Update shader compile script and shader source and bytecode headers - Remove unused shaders (source and bytecode headers) - Use com pointers where possible for D3D11 objects BUG=angleproject:1632 Change-Id: I98e38451bd453f53b772fe93ec9dcceb4196ea58 Reviewed-on: https://chromium-review.googlesource.com/413736 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahmeer Esmail <shahmeer.esmail@intel.com> 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>
Jiawei-Shao b0e6e412 2016-10-14T15:59:47 Workaround clear issue on Intel Skylake D3D driver On some Intel D3D drivers on Skylake, calling clear may take no effect. To work around this bug, we call clear() twice when we attempt to do clear on these platforms. BUG=chromium:655534 Change-Id: I3b05892e80e5797d268861e8f52e080f5175855b Reviewed-on: https://chromium-review.googlesource.com/398522 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f57e5f9 2016-10-27T17:36:53 D3D11: Make several format tables constexpr. This should guarantee the best memory access patterns. It introduces some indirections for some format queries, but most of these should be direct array lookups, or used infrequently. We can optimize this later if necessary. BUG=angleproject:1389 Change-Id: I5e2c8c530a07798494afd3ea36b6164d7564c02c Reviewed-on: https://chromium-review.googlesource.com/403314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 7efe747c 2016-10-07T16:12:46 D3D11: Fix style in the entire back-end. BUG=None Change-Id: I32cbcd4daa1f386654ea5e8f0a25d8635b5df731 Reviewed-on: https://chromium-review.googlesource.com/402016 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8234e7b3 2016-10-07T15:12:10 Refactor some errors into ANGLE_TRY macros. BUG=None Change-Id: I00ff2523995cb49d1af60cae62c2bba0d020eed4 Reviewed-on: https://chromium-review.googlesource.com/395569 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b80a5e9c 2016-10-05T16:39:09 Store channel bits info in angle::Format. This allows us to delete some duplicated code in the D3D11-side. BUG=angleproject:1389 BUG=angleproject:1459 Change-Id: Ifdcfcd4a56e06ff2ae8f5ca0bda72281d52c2964 Reviewed-on: https://chromium-review.googlesource.com/392208 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 9e3d7aa0 2016-09-02T15:19:43 D3D11: Work around small mipped stencil textures. AMD has a bug with 2x2 and 1x1 mips of depth/stencil textures. Formats D24S8 and D32FS8 both seem to render black for the very small mips. We can work around this by selectively caching a copy of the texture data that only has depth information, since stencil isn't filterable in OpenGL ES. BUG=angleproject:1493 BUG=chromium:638323 Change-Id: Iebef42c4680018d9854dbe789d677823167213dd Reviewed-on: https://chromium-review.googlesource.com/380037 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 11b30612 2016-08-02T12:31:58 D3D11: Store ANGLEFormatSets instead of ANGLEFormats. This saves us looking up the FormatSet repeatedly. BUG=angleproject:1455 Change-Id: I77890c1eb427e7d087ceaf194a5001b8b03585d4 Reviewed-on: https://chromium-review.googlesource.com/359084 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a3944d4f 2016-07-22T22:13:26 Add gl::Format to represent a texture/rb/surface format. This has a few advantages: it preserves all the information of the internal format, such as if it is sized or unsized. It also saves looking up the format multiple times in the table, which should improve speed in some cases. The extra sized-ness information will allow us to perform the correct validation in CopyTexSubImage calls. BUG=angleproject:1228 Change-Id: I42954771b0a9a968f5d787b8cf6e0af721791855 Reviewed-on: https://chromium-review.googlesource.com/362626 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 53ea9cc6 2016-05-17T10:12:52 Replace rx::Renderer with rx::ContextImpl. Previously Context had no Impl class, but had a special relationship with the instanced Renderer class. Having a ContextImpl backing every Context will allow new designs to enable things like multithreading (where each ContextImpl stores a Context-specific device) or non- virtual Contexts on Android or other platforms where it is more efficient. A large refactoring patch that touches every back-end. BUG=angleproject:1363 Change-Id: Icb73a7d37447f08a664eeb499a310ba05d71a57e Reviewed-on: https://chromium-review.googlesource.com/342052 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 48ef11b2 2016-04-27T15:21:52 Rename gl::Framebuffer::Data to gl::FramebufferState. Moving this out of the Framebuffer class allows us to forward- declare it. BUG=angleproject:1363 Change-Id: I91971c37a92151df508cdf7f0eb8c3e93506d112 Reviewed-on: https://chromium-review.googlesource.com/340741 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 99cdca03 2016-02-24T14:45:06 Remove getDXGIFormat() function from RenderTarget11 This query would return either the RTV format, the DSV format or the texture format depending on the render target. This made the code hard to understand. getDXGIFormat() calls are replaced by querying the ANGLE format, and explicitly choosing which associated DXGI format to query info for (RTV format or DSV format). This refactoring makes changing some format associations for integer texture formats easier in the future. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.blit.* (no regressions) Change-Id: Ibe3c03fc6b7768af1a131d4df3909a1e20a71228 Reviewed-on: https://chromium-review.googlesource.com/329102 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 6b120b9f 2015-11-24T13:00:07 Add checks for FBO attachment layer. We would allow the app to attach layers that were out-of-bounds. Fix this by checking against the underlying resource dimensions. Also rework the code a bit to clean up the texture size query, which is available from the ImageDesc. BUG=angleproject:869 Change-Id: I984f1db16daea6ca650d795884d8ec2cb8f05ebb Reviewed-on: https://chromium-review.googlesource.com/313991 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b195643c 2015-08-12T17:35:20 Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'" Seems to have quite a few warnings in 64-bit on my machine. BUG=angleproject:1120 This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc. Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9 Reviewed-on: https://chromium-review.googlesource.com/293280 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin c5cf9bc4 2015-08-06T10:46:48 Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' BUG=angleproject:1120 Change-Id: I01ef10bea7f487c2b394d030c76628f38d2ea645 Reviewed-on: https://chromium-review.googlesource.com/292780 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin b459fb04 2015-08-07T16:12:39 Fixed compiler warning C4456 'declaration of variable hides previous local declaration'. BUG=angleproject:1119 Change-Id: I99572711ceeae94fb920d197c86e741945d3b60b Reviewed-on: https://chromium-review.googlesource.com/292279 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e62cedd0 2015-06-30T11:03:54 Load Clear11 resources lazily. Again this saves on startup time and memory use. BUG=angleproject:1014 Change-Id: I3890dc2ea50ff4e4f1ff9d7cb223e1ab57c330ce Reviewed-on: https://chromium-review.googlesource.com/282552 Reviewed-by: Brandon Jones <bajones@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>
Austin Kinross 405f3471 2015-06-04T13:09:06 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 The last patch added new tests which failed on some Intel Win7 machines. This was due to a driver bug. Windows Updates have been applied to the failing machine, and the tests now pass. Changes between second and current (third) failed 16-bit patch: - Reenable usage of 16-bit DXGI textures on all Intel cards - Disable 16bpp tests on Intel D3D11 until the bots are updated - Updated Win7 test machine. Tests now pass Changes between first and second failed 16-bit patch: - Disabled usage of 16-bit DXGI textures on all Intel cards - Added DXGI->GL conversion entries for 16-bit formats, which fixes FBO readback issues. The ES CTS and dEQP tests which failed with the last patch now pass. Change-Id: Id8ea89bfbc450beea54afdd398956bc97ecf3c01 Reviewed-on: https://chromium-review.googlesource.com/275082 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Geoff Lang 6bef4ff7 2015-06-01T21:08:31 Revert "In D3D11, check for 16-bit texture support and use if possible" Seeing failures on Win7 + Intel machines. Example build: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28Intel%29/builds/11756 This reverts commit 673115d9cc4251cd690e14a98ef0c717ba9de0b9. Change-Id: Ie2b6cc1ae9c4e83dde3a531e38252c95ac2e2a0a Reviewed-on: https://chromium-review.googlesource.com/274450 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 673115d9 2015-05-28T09:27:57 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 Changed since last failed 16-bit patch: - Disabled usage of 16-bit DXGI textures on all Intel cards - Added DXGI->GL conversion entries for 16-bit formats, which fixes FBO readback issues. The ES CTS and dEQP tests which failed with the last patch now pass. Change-Id: Ib66abf73f23dbb4329f0a32d7f3dafbbc23e6c08 Reviewed-on: https://chromium-review.googlesource.com/273712 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8e7549bd 2015-05-27T14:05:10 Revert "In D3D11, check for 16-bit texture support and use if possible" Causing failures on Windows 8 bots running ES CTS and Windows 7 Intel bot running angle tests. Example failures: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win8%20Release%20%28NVIDIA%29/builds/14442 https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28Intel%29/builds/11627 This reverts commit d63f08fcc32ea17bac2b025f0ad3261664ff79c9. Change-Id: I841aee5fb0973432f249277126424b909d5b3e17 Reviewed-on: https://chromium-review.googlesource.com/273416 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross d63f08fc 2015-05-21T10:22:04 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 Change-Id: I36a5ee774b38e9865b2eb6c6789afd316c4eff16 Reviewed-on: https://chromium-review.googlesource.com/272061 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
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 8cf813c7 2015-05-04T12:55:18 Query attachment render targets from Impl class. *re-land with fix for D3D9* This allows us to eradicate the GetAttachmentRenderTarget methods. This improves potential performance, at the cost of exposing a Renderer-specific function at the API object level. BUG=angleproject:963 Change-Id: Iee9f985ddaed668df0c622228004b348eb4d2ea8 Reviewed-on: https://chromium-review.googlesource.com/269006 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e737b06c 2015-05-04T16:53:56 Revert "Query attachment render targets from Impl class." D3D9 bug is causing failures in the WebGL depth texture test. BUG=angleproject:963 This reverts commit 804e8436f91733e1d0f769ec10082e4741f2e549. Change-Id: I660f05033360e97258794138cb50b604f5ac16b6 Reviewed-on: https://chromium-review.googlesource.com/269005 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 804e8436 2015-04-30T09:42:23 Query attachment render targets from Impl class. This allows us to eradicate the GetAttachmentRenderTarget methods. This improves potential performance, at the cost of exposing a Renderer-specific function at the API object level. BUG=angleproject:963 Change-Id: Ifc227b5f42e87bd4deb451d685618cf61fea39f1 Reviewed-on: https://chromium-review.googlesource.com/263491 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2d06b738 2015-04-20T12:53:28 Store value types for FBO attachments. *re-land with fix for Mac* This prevents us from re-allocating FBO attachments every set. This change requires quite a bit of refactoring. BUG=angleproject:963 Change-Id: Ia1f83e3c427d446ddbe16c6703db136942149e91 Reviewed-on: https://chromium-review.googlesource.com/266691 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill aed081ce 2015-04-21T13:55:21 Revert "Store value types for FBO attachments." In file included from ../../third_party/angle/src/libANGLE/Framebuffer.cpp:10: In file included from ../../third_party/angle/src/libANGLE/Framebuffer.h:13: In file included from /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/vector:68: /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_construct.h:81:38: error: call to implicitly-deleted copy constructor of 'gl::FramebufferAttachment' ::new(static_cast<void*>(__p)) _T1(__value); ^ ~~~~~~~ This reverts commit 13773b26dfb29b963ea727e1ebf7bdabdc5892b1. Change-Id: If79f2797fe46798cbe5b39d83c9bcb1a7e87026d Reviewed-on: https://chromium-review.googlesource.com/266643 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 13773b26 2015-04-20T12:53:28 Store value types for FBO attachments. This prevents us from re-allocating FBO attachments every set. This change requires quite a bit of refactoring. BUG=angleproject:963 Change-Id: Iafa4e4a0f3dd66c9e7452e0e96a0cbb9753487bb Reviewed-on: https://chromium-review.googlesource.com/263489 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>