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


Log

Author Commit Date CI Message
Olli Etuaho 1a4523f3 2016-03-18T15:33:55 Avoid copying of texture format info structures Use const pointers to the statically allocated structures instead of copying them in TextureStorage11. This avoids the cost of copying and saves a little bit of memory. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: Ib59fddd68ba9bc53e491d55683416c0661f26e0e Reviewed-on: https://chromium-review.googlesource.com/333930 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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 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 f434906c 2016-02-22T14:53:26 Group D3D11 DXGI format info under a struct This patch refactors how DXGI format info is stored. The goal is to make it easier to make changes that affect both swizzle formats and regular texture formats, and make it easier to pass the format sets around. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I1cc220bccbbdde9200a41829fdc37c8ec123c6a1 Reviewed-on: https://chromium-review.googlesource.com/329072 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
John Bauman 0ecb18b9 2016-02-03T13:40:37 Avoid a copy in TextureStorage11::setData This is essentially a reland of 9cf9bcbecaa1e54a47a92eb784e7f591f7b65c57 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: If4281aeb4cd7bbbebba60122a10610a916833052 Reviewed-on: https://chromium-review.googlesource.com/326852 Tryjob-Request: John Bauman <jbauman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: John Bauman <jbauman@chromium.org>
Corentin Wallez 1eabcf41 2016-02-02T13:54:00 Replace '> >' with '>>' BUG=angleproject:1308 Change-Id: I00bd2ea939b633817662205eb7879efb7f99965f Reviewed-on: https://chromium-review.googlesource.com/326400 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 3a913264 2016-02-06T01:34:25 Revert "Avoid a copy in TextureStorage11::setData" Fails on the Windows builders: https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Builder/builds/42201 e:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\libangle\renderer\d3d\d3d11\load_functions_table_autogen.cpp(787) : error C2440: 'return' : cannot convert from 'const std::map<GLenum,rx::LoadImageFunction,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' to 'const std::map<GLenum,rx::d3d11::LoadImageFunctionInfo,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &' with [ _Kty=GLuint , _Ty=rx::LoadImageFunction ] and [ _Kty=GLuint , _Ty=rx::d3d11::LoadImageFunctionInfo ] Reason: cannot convert from 'const std::map<GLenum,rx::LoadImageFunction,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' to 'const std::map<GLenum,rx::d3d11::LoadImageFunctionInfo,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' with [ _Kty=GLuint , _Ty=rx::LoadImageFunction ] and [ _Kty=GLuint , _Ty=rx::d3d11::LoadImageFunctionInfo ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called This reverts commit 52d3e43b66478b07d26c95a5511d4132cec26000. Change-Id: I83774ea09ccbb2b92ff609714e1c7201beb775bc Reviewed-on: https://chromium-review.googlesource.com/326540 Reviewed-by: Jamie Madill <jmadill@chromium.org>
John Bauman 52d3e43b 2016-02-03T13:40:37 Avoid a copy in TextureStorage11::setData This is essentially a reland of 9cf9bcbecaa1e54a47a92eb784e7f591f7b65c57 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: I3c1a0ab34be91c7d39eb2d0866029d01352b6056 Reviewed-on: https://chromium-review.googlesource.com/325526 Tryjob-Request: John Bauman <jbauman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9c757b12 2016-02-01T14:09:06 D3D11: Fix ReadPixels with layer 3D attachments. Non-zero layer attachments are FBO attachments of 3D textures bound from a layer other than zero. These haven't ever worked AFAIK. Fix them by retrieving the correct layer from the FBO attachment. Note: 3D attachments are still broken with PBO ReadPixels. The fix for those will come in a subsequent patch. BUG=angleproject:1290 Change-Id: I5417e7374188dd320e1209d006723ce070f98561 Reviewed-on: https://chromium-review.googlesource.com/323472 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e2509a39 2016-02-01T14:09:05 D3D11: Fix basic ReadPixels from 3D attachments. Use the TextureHelper class to abstractly handle 2D and 3d textures. Also refactor the Image11 copy methods to be a bit cleaner and not use the copy conversion path when unnecessary. This patch does not yet fix layer attachments - the fix for that will come up in a subsequent patch. BUG=angleproject:1290 Change-Id: If8b7aa8848ca4260e0dde690e7a99e115a97fabb Reviewed-on: https://chromium-review.googlesource.com/323442 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c1069a08 2016-01-22T15:27:20 D3D11: Add a TextureHelper class to wrap 2D+3D reads. In some cases in our code we had hard-coded ID3D11Texture2D, where the code should handle 2D and 3D textures. This happens in ReadPixels, where we have to handle 3D textures when the user binds a layer of a 3D textures with FramebufferTextureLayer. This is a refactoring patch only, which makes the error cleaner. Tests and the bug fix to come in a follow-up patch. BUG=angleproject:1290 Change-Id: Ie1c293dead4d5b6b4dd6ce24ba2a9146619b141d Reviewed-on: https://chromium-review.googlesource.com/322680 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong adff67b5 2015-10-14T10:34:45 Re-land "Implements more pack/unpack states." Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels. Note that PBOs are not covered by this change. Re-land with fix for test expectations. BUG=angleproject:512 BUG=angleproject:1095 Change-Id: I71d8d3bd8fc1f2c75ca16ac2634d5eafcbd71f26 Reviewed-on: https://chromium-review.googlesource.com/305522 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c7473924 2015-10-14T14:33:19 Revert "Implements more pack/unpack states. Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels. Note that PBOs are not covered by this change." Expectations still not correct. This removes suppressions for two failing tests: functional.texture.specification.teximage3d_depth_pbo.depth_component32f_2d_array dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth32f_stencil8_2d_array BUG=angleproject:512 BUG=angleproject:1095 This reverts commit 72e7013e68a24107b9082629fc52d59a78998eb2. Change-Id: Id81b6e616e61535b8504890ce57591813e22af69 Reviewed-on: https://chromium-review.googlesource.com/305521 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong 72e7013e 2015-10-01T17:19:45 Implements more pack/unpack states. Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels. Note that PBOs are not covered by this change. BUG=angleproject:512 BUG=angleproject:1095 Change-Id: Ia2fd7e52615d4aa08011dd615fcc20b79672d355 Reviewed-on: https://chromium-review.googlesource.com/304908 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 000b2f49 2015-10-09T15:33:14 Revert "Implements more pack/unpack states. Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels." This is causing failures in dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth_component24_2d_array First failing build on the bot: http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20dEQP%20%28NVIDIA%29/builds/3635 Please fix the failure and re-land your CL with the fix. BUG=angleproject:512 BUG=angleproject:1095 This reverts commit f1bb3f0569d5ef41b17f8ad0add7308f9d0f0de1. Change-Id: I30f61db888b0adf73a1d98bbeeb2428068119627 Reviewed-on: https://chromium-review.googlesource.com/304990 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong f1bb3f05 2015-10-01T17:19:45 Implements more pack/unpack states. Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels. BUG=angleproject:512 BUG=angleproject:1095 Change-Id: I11e3bc05d23419b72c92b96aabd3f0bacd983626 Reviewed-on: https://chromium-review.googlesource.com/304370 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dian Xiang db3dd083 2015-09-16T20:16:01 Refactoring TextureFormat and its helper functions to individual classes BUG=angleproject:1160 This is the first step to BUG=angleproject:1160, optimizing GetTextureFormatInfo to use static switching rather than building maps and using the find function. Also reordered the includes in alphabetical, src files first format The next step is to modify the GetTextureFormatInfo not to build a map but to use static switching. The step after that is to use a JSON generator to generate the switching, hence refactoring TextureFormat to be in its own class so we only need to generate what's necesary. The helper functions such as swizzle texture format can also be done using the same approach. Hence, they're also refactored into their own files. Change-Id: I753f437ca0df69ee5584d254fe0d2ea8b09a857e Reviewed-on: https://chromium-review.googlesource.com/300288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
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 39939686 2015-08-18T10:37:22 Fix improper error handling in Image11. A device lost event would improperly skip returning an error, which could lead us down a code path that would read/write to invalid locations. BUG=519642 Change-Id: Iba437b9b24cdf44320a944a85146f5f73be9f7a6 Reviewed-on: https://chromium-review.googlesource.com/293903 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Austin Kinross ba8a0bf8 2015-05-13T09:48:59 Add plumbing for D3D11 device caps BUG=angleproject:1002 Change-Id: Id24783c75377ea92a73a43f2605693e07f63dc15 Reviewed-on: https://chromium-review.googlesource.com/270545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Jamie Madill f4bf3811 2015-04-01T16:15:32 Use GetAs/GetImplAs whenever possible. This patch cleans up the rest of our custom casting helper functions. Change-Id: I41975c736765fca855c4498acca31116df3e8317 Reviewed-on: https://chromium-review.googlesource.com/263477 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
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>
Minmin Gong b8aee3bc 2015-01-27T14:42:36 Add UNPACK_ROW_LENGTH support to D3D11 renderer Change-Id: I31ccffddcb04a45f19d3c3eb9a396c30e794b218 Reviewed-on: https://chromium-review.googlesource.com/243951 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Minmin Gong <mgong@microsoft.com>
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>
Geoff Lang c2e75afa 2015-01-05T14:26:24 Rename RenderTarget to RenderTargetD3D and move it into the d3d folder. BUG=angle:681 Change-Id: I1946e01ce09d99405c318723c254fe300cc5ac53 Reviewed-on: https://chromium-review.googlesource.com/238471 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang b4dedf3e 2015-01-05T14:08:53 Merge the Image class into ImageD3D. BUG=angle:681 Change-Id: I0c0d41fb3ff9592b08ede58a8c2ec2bd2d94a0b2 Reviewed-on: https://chromium-review.googlesource.com/238470 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0a4f1e27 2014-12-17T12:33:26 Merge the Texture set*Image methods and use objects for sizes and offsets. BUG=angle:681 Change-Id: If2e981c522ca5ba3eab4484594cb41aa23800ec4 Reviewed-on: https://chromium-review.googlesource.com/236261 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d8a2258c 2014-12-17T15:28:23 Remove all uses of "actual" formats. BUG=angle:861 Change-Id: I7cd2d1a56772fdf18bcf926456399322d13e7a4f Reviewed-on: https://chromium-review.googlesource.com/236305 Reviewed-by: Brandon Jones <bajones@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 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>