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


Log

Author Commit Date CI Message
Jamie Madill 4d3a0f60 2020-09-11T12:36:05 GN: Componentize D3D format tables. These tables are used by both the GL and D3D11 back-ends. Also moves them to renderer_utils to be in a shared place. Bug: angleproject:3943 Change-Id: I1f5d79842396a87e795547fa03c6855d6f9c5e9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2405805 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.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 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>
Frank Henigman d633b156 2018-10-04T23:34:31 Get rid of VertexFormatType. The enum VertexFormatType is redundant with angle::FormatID. The Vulkan back end has already eschewed VertexFormatType, this change updates the D3D back ends. BUG=angleproject:2531 Change-Id: I67ea2203ca80be828f4c757a37810fe67a279364 Reviewed-on: https://chromium-review.googlesource.com/c/1263899 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Frank Henigman 16fdde13 2018-06-02T15:38:21 Move vertex data copy functions out of D3D. Move the vertex buffer copying and conversion functions from the D3D back end so the Vulkan back end can use them. No functional change. BUG=angleproject:2405 Change-Id: If3c04a6c0dc37c78c1779d8b5d3cece263e8a031 Reviewed-on: https://chromium-review.googlesource.com/1083817 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman aa7203ef 2017-05-03T23:32:29 Inherit privately from angle::NonCopyable. Make all inheritance from angle::NonCopyable private so the compiler complains about this (admittedly unlikely) code: class Foo: angle::NonCopyable { virtual ~Foo() { ... } }; angle::NonCopyable *p = new Foo; delete p; In the above code ~Foo() is not called, only ~NonCopyable(), because the latter is not virtual. Making it virtual would add overhead to all derived classes which don't already have a virtual method. Also tighten access in NonCopyable, because we can. BUG=angleproject:2026 Change-Id: Id0dc4d959cfb7bb82cf49382118129abb1d3a4f0 Reviewed-on: https://chromium-review.googlesource.com/495352 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 9cec39f6 2016-10-31T16:14:14 D3D11: Convert the FL 9_3 vertex format table to constexpr. This removes a static global map initialization. BUG=angleproject:1389 BUG=angleproject:1459 Change-Id: I6eb19f6649280e72682c6806ea0bf6eb70173984 Reviewed-on: https://chromium-review.googlesource.com/405487 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Jamie Madill b7fe49db 2016-10-05T16:39:11 D3D11: Fold mipmap gen caps into the support table. This change is two-fold: first it allows us to remove the std::map for D3D11 format info, which was only being used in a single place. Secondly, it fixed the support table to use the correct 9_3 caps for texture support, determined by running the D3D11FormatTablesTest. This should reduce the number of format queries we need to run on 9_3 startup. BUG=angleproject:1389 BUG=angleproject:1459 Change-Id: I2435a47fc221e73c96337bc7c1c4ed37b527bc1f Reviewed-on: https://chromium-review.googlesource.com/392210 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e0548ad2 2016-10-06T15:55:35 D3D11: Split off DXGI component type query. This query is currently a part of a std::map. Split it off to its own switch using auto-generation based on the format string. Also introduce a DXGI-to-angle format map. This map is not totally complete because some more esoteric formats don't have corresponding ANGLE formats yet. We should add these other formats (EG NV12) if we need them. BUG=angleproject:1389 BUG=angleproject:1459 Change-Id: I49e045bdc04a52166299c9e22a4c4d3f24069dbc Reviewed-on: https://chromium-review.googlesource.com/392209 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 30712068 2016-08-09T11:10:36 Move fast copy functions into angle::Format. These tables were duplicated in D3D11 and D3D9, and would have to be further duplicated into Vulkan. BUG=angleproject:1455 Change-Id: Ice1b81417d7b14f933b61861c4a9997c260ef72e Reviewed-on: https://chromium-review.googlesource.com/367690 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2b50a0b 2016-06-09T00:13:35 Move ReadPixels logic to helper methods. These routines were pretty much duplicated between D3D9 and D3D11. Since I was going to have to rewrite them again for Vulkan, I figured it would be best to move them into a common location and clean them up a bit. BUG=angleproject:1319 Change-Id: I15d39b052daf3e1020dbd0880f01ae84f3686a0a Reviewed-on: https://chromium-review.googlesource.com/349630 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 7828c521 2016-02-26T14:05:12 D3D11: Check packPixels memcpy support based on ANGLEFormat Instead of querying DXGI format info to determine whether framebuffer data can be copied to packPixels target memory with memcpy, compare the internal format information from the ANGLE format to the packing format. This makes it possible to change some of the DXGI formats used for integer textures without breaking packPixels. This makes it possible to entirely remove the DXGI format to GL internal format mapping from the DXGI format info table. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.* (no regressions), dEQP-GLES3.functional.pbo.* (no regressions), Change-Id: Id5ffd581349e7afe39872d69cb05381f3e78d352 Reviewed-on: https://chromium-review.googlesource.com/329214 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 114d129d 2016-02-26T12:33:00 D3D11: Get color read function from ANGLE format This is done to make it possible to change some of the DXGI formats of integer textures without affecting their color read function associations. The packPixels function gets the ANGLE format from the texture helper, which now requires the ANGLE format to be passed in at the time of creation. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.* (no regressions), dEQP-GLES3.functional.pbo.* (all pass) Change-Id: I368337cfe5f8c86ff3292009ccf29e9d01409a07 Reviewed-on: https://chromium-review.googlesource.com/329213 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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 9cb1df4f 2016-02-25T16:16:41 D3D11: Get mip generation function from ANGLE format This is done to make it possible to change some of the DXGI formats of integer textures without affecting their mip generation function associations. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.texture.mipmap.*generate* (all pass) Change-Id: Ie83dd0e1883e9d8e267fbd4bf54b1e466fb0b210 Reviewed-on: https://chromium-review.googlesource.com/328963 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
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>
Geoff Lang c5b2ba53 2015-09-17T19:54:27 Revert "Avoid a copy in TextureStorage11::setData" Speculative fix for performance regression. BUG=532647 This reverts commit 9cf9bcbecaa1e54a47a92eb784e7f591f7b65c57. Change-Id: I53e41f6c17f89c400e38bfcdf3147946c27906c0 Reviewed-on: https://chromium-review.googlesource.com/300540 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Matt Woodrow 9cf9bcbe 2015-08-17T14:50:31 Avoid a copy in TextureStorage11::setData This code always allocates a new memory buffer for the texture memory, picks a load function to copy/convert the input data into it, and the uploads. In the case where the input format matches the upload format we should be able to skip the allocation and copy and be much happier. Change-Id: I8b8c106e0d397bef1c4bcfdb0df60669030776a3 Reviewed-on: https://chromium-review.googlesource.com/293742 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0342253e 2015-07-09T11:30:29 D3D11: Refactor vertex format tables. Use switch statements based on the format type enum, instead of a map from the old VertexFormat structure to the info payload. This saves on lookup and initialization time. BUG=angleproject:959 Change-Id: I6d1bf282c88f67272ca067cb64bc71e77824a12e Reviewed-on: https://chromium-review.googlesource.com/277290 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d3dfda2b 2015-07-06T08:28:49 Refactor how we store vertex formats. Instead of storing a vertex format as a struct with the full info, instead use an enum, and look up the info when we need it. This saves a lot of constructor initialization time, operator comparison time, and storage. It also will allow us to look up D3D format info more quickly. BUG=angleproject:959 Change-Id: I202fd1ea96981073bc1b5b232b1ec3efa91485cb Reviewed-on: https://chromium-review.googlesource.com/277289 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@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>
Gregoire Payen de La Garanderie 752ce192 2015-04-14T11:11:12 D3D11: Use DX generateMips to generate mipmaps whenever possible. BUG=angleproject:974 Change-Id: I95937fe7a0833de77c52f838ebb3ecba55dfbf8a Reviewed-on: https://chromium-review.googlesource.com/265640 Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 051dbc79 2015-01-05T15:48:58 Create a formatutilsD3D and move some functions from formatutils. BUG=angle:681 Change-Id: I694073c50dccd05c3117761e446eba0d15c03293 Reviewed-on: https://chromium-review.googlesource.com/238480 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 049743a9 2014-12-23T13:05:11 Restrict depth buffer formats on D3D11 Feature Level 9_3 *_TYPELESS formats weren't supported in D3D10Level9 until Windows 8. Some Win8 D3D9 drivers don't support them either. To workaround this, we avoid _TYPELESS formats on D3D11 FL9_3. BUG=angle:856 BUG=435726 Change-Id: I280dc7f87e3a2c737c14284ebb744188e7f10616 Reviewed-on: https://chromium-review.googlesource.com/237292 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 932b465b 2014-12-17T15:25:31 Add format size information for DXGI_FORMATs. Change-Id: I14d0b8ebd631e5c9c3c3b63c047c9ef7c11bf310 Reviewed-on: https://chromium-review.googlesource.com/236304 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross c9878cb1 2014-12-11T10:43:48 Fix normalized GL_BYTE vertex attributes on D3D11 9_3 Feature Level 9_3 doesn't support as many formats for Input Layouts as 10_0+. On 9_3, we have to make sure that GL vertex attributes are converted into formats that 9_3 supports. Change-Id: I27b9a85a6eb21a37bd36e60bf011b83fce743fd0 Reviewed-on: https://chromium-review.googlesource.com/234523 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0a73dd85 2014-11-19T16:18:08 Fix include guards. BUG=angle:733 Change-Id: I08b2c11c4831f1161c178c1842b10e807185aced Reviewed-on: https://chromium-review.googlesource.com/230831 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2b5420c0 2014-11-19T14:20:15 Merge libGLESv2 and libEGL classes into libANGLE. BUG=angle:733 Change-Id: Ic491c971411fe82c56cd97c5c8325ac14ec218df Reviewed-on: https://chromium-review.googlesource.com/230830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>