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


Log

Author Commit Date CI Message
Olli Etuaho e8528d89 2016-05-16T17:50:52 Fix determining texture mipmap completeness The code didn't previously take base level properly into account when determining how many levels to check when checking for texture completeness. The code is refactored so that the "q" value in spec, that is the maximum mipmap level for determining completeness, can be queried from TextureState. This value is used now for checking completeness. This requires moving ImageDescs under TextureState. Functions that operate on the ImageDesc array are also moved from Texture to TextureState. TextureState members are also renamed to start with the "m" prefix and made private. Also handle levels outside the base/max level range consistently in eglCreateImageKHR validation. We interpret the spec so that if the level used for the EGL image is not a part of the texture levels that affect texture completeness, an error is generated. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: I038ef24aa83e0a6905ca3c0bbada5989eecb00d9 Reviewed-on: https://chromium-review.googlesource.com/344880 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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 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 4b66f055 2016-02-25T16:53:38 Make copyDepthStencil more robust to texture format table changes This will make it easier to verify changes to integer texture DXGI formats. Currently the DXGI format info table contains some values that wouldn't make sense after the integer formats are changed, such as R32_TYPELESS being recorded as a depth format, and we need to make sure no code relies on this kind of information to make changing the table safe. Includes cleaning up unused depth/stencil offset fields from DXGIFormatInfo. BUG=angleproject:1244 TEST=dEQP-GLES3.functional.fbo.blit.*depth* Change-Id: I0149f28e4c6f961af99ac2f5a656f3fbfe13aee6 Reviewed-on: https://chromium-review.googlesource.com/328964 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho b1853096 2016-02-24T16:07:39 D3D11: Don't use DXGI to GL format map in copy functions The swizzle or copy shader needs to be chosen according to the component type of the source SRV. Before this patch, the component type was obtained by going through the mapping from the SRV DXGI formats to GL formats. This mapping is problematic, because it has entries that don't really make sense, like R16_UNORM and R16_TYPELESS formats being mapped to GL_DEPTH_COMPONENT16. This is an issue particularly because these formats will be used for integer RED textures in the future. For this reason the mapping should be removed. In the case addressed by this specific commit, rather than look up the component type of the SRV indirectly through the GL format table using the GL internal format that corresponds to the DXGI format, just use the component type of the DXGI format. The depth+stencil swizzle cases where the component type is not well defined are handled as a special case. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.texture.swizzle.* (all pass), dEQP-GLES3.functional.fbo.blit.* (no regressions) Change-Id: I39fb8a14921b89d299e0077b3bea8b4e66ef218d Reviewed-on: https://chromium-review.googlesource.com/329103 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 8a854d68 2016-02-17T11:54:04 Replace GetDXGIFormatInfo with a GetDXGIFormatSizeInfo where possible It's not always clear which format should be passed to GetDXGIFormatInfo, since a resource is associated with multiple formats. In some cases, one of the formats is typeless and one of them is typed, which would return different type information depending on which one is used. In some cases, one of the formats may even be a depth format while another is not. GetDXGIFormatSizeInfo will return correct data no matter which format associated with a certain resource is passed to it. Remaining uses of GetDXGIFormatInfo will need to be addressed separately, either making sure that they always use the format that makes sense in a given context, or plumbing in the required information in some other way. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: If3cb03ab68d27743b1fdeb539234ec621dfa3c04 Reviewed-on: https://chromium-review.googlesource.com/328230 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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 a5ed56ee 2015-12-07T16:32:59 D3D11: Mask off alpha channel for RGBA->RGB blits. We emulate RGB8 in D3D11 with RGBA8 textures. Make sure when we blit that we don't copy the unused texture channel. BUG=angleproject:1245 TEST=dEQP-GLES3.functional.fbo.blit.* Change-Id: I805132fda984860a6d84ad4c1fc7169973938df9 Reviewed-on: https://chromium-review.googlesource.com/316010 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang aa71b58c 2015-08-27T13:11:20 Lazily load the Blit11 buffers and state objects. BUG=angleproject:1014 Change-Id: I46629253d164a7522c3a97574fcf591f395b04ea Reviewed-on: https://chromium-review.googlesource.com/295144 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@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>
Jamie Madill cea74be4 2015-07-20T14:36:54 D3D11: Fix regression with R32I blits. The blit refactoring mislabeled one shader as GL_RED instead of GL_RED_INTEGER. BUG=angleproject:1076 TEST= dEQP-GLES3.functional.fbo.render.shared_depth_stencil.* Change-Id: I262b218c72d955a88a2d2c00b470d6a4f3568451 Reviewed-on: https://chromium-review.googlesource.com/286774 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 86a07aec 2015-06-30T11:03:18 Add LazyInputLayout to defer loading input layouts. Lazily loading input layouts can also save memory and startup time. There are several cases where we don't need these resources until later, or sometimes, at all. BUG=angleproject:1014 Change-Id: I4e0d45353b5d3969bd1ed86ad26f47d34e542ed5 Reviewed-on: https://chromium-review.googlesource.com/282551 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
Jamie Madill 517ccdf8 2015-06-30T11:02:55 Rename DeferredShader to LazyShader. Deferred rendering is a shading technique, and "lazy" is the more correct term. Also rename a few methods so we can use a shared interface for other types of lazy D3D11 resources. BUG=angleproject:1014 Change-Id: I2fd2c823291d414003690066eaec063f1cd0bc4c Reviewed-on: https://chromium-review.googlesource.com/282550 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Brandon Jones <bajones@google.com>
Jamie Madill 3975ddec 2015-06-10T18:56:12 Blit11: Defer loading some resources until we use them. We can also defer loading InputLayouts and other resources in Blit11 if we don't need them immediately. BUG=angleproject:1014 Change-Id: I859583e4696e5864dfd8d436143ed9ddbc2fd60d Reviewed-on: https://chromium-review.googlesource.com/275779 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill e636e140 2015-06-10T18:56:11 Blit11: Defer built-in shader loads. Introduce a 'DeferredShader' utility class. Other classes can use DeferredShader to delay loading shader resources until we render with them, which saves on loading time as well as memory, if we aren't using particular shaders. BUG=angleproject:1014 Change-Id: Ic6767c3c422a7fedbf23cce5d0c9d822aaf2e652 Reviewed-on: https://chromium-review.googlesource.com/275778 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill 31906ecf 2015-04-14T14:53:07 Generate blit shaders on demand. This saves a ms or two on D3D11 startup. Change-Id: I156c25029a0b2aeb48e5b76b31737c155111e07f Reviewed-on: https://chromium-review.googlesource.com/264936 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
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>
Jacek Caban e842eabd 2015-03-26T16:50:35 Fixed compilation with mingw. Change-Id: I027cedc383efbd215e55a7ddf4e41eb1c368a1ae Reviewed-on: https://chromium-review.googlesource.com/262590 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jacek Caban <cjacek@gmail.com>
Gregoire Payen de La Garanderie 32334afe 2015-01-30T11:38:21 Implement the copy from a 3D texture to Image11. Fixes the generation of 3D texture mipmaps. BUG=angle:915 Change-Id: Icc0c91099f60713d511ebe1a2248a21b63efddaa Reviewed-on: https://chromium-review.googlesource.com/244720 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Austin Kinross 0dbda057 2014-12-04T18:13:04 Add basic D3D11 Feature Level 9.3 support Change-Id: I660c74791ddb9917bd4796bb652eefab2a3e4863 Reviewed-on: https://chromium-review.googlesource.com/233660 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Geoff Lang 2b5420c0 2014-11-19T14:20:15 Merge libGLESv2 and libEGL classes into libANGLE. BUG=angle:733 Change-Id: Ic491c971411fe82c56cd97c5c8325ac14ec218df Reviewed-on: https://chromium-review.googlesource.com/230830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>