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


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 7b591905 2016-02-26T14:37:57 D3D11: Use blit SRV format for blits blitSRVFormat stores the format that is used with ANGLE's internal blit shaders. By default, it is the same as the normal SRV format. For integer textures with a red channel, the RTV format is used instead. This makes it possible to change the storage format and the SRV format for the integer textures without affecting the blit format. The blitSRVFormat is used when doing blits in Blit11::copyTexture(). An exception is made for depth/stencil renderbuffer blit - in these cases it is okay to assume that the regular SRV format works for blitting. In the future the regular SRV format for integer textures will be changed to be different from their blit SRV format. TEST=angle_end2end_tests dEQP-GLES3.functional.fbo.blit.* (no regression) dEQP-GLES3.functional.texture.swizzle.* (no regression) BUG=angleproject:1244 Change-Id: Ie0e790e58ec054b64ef5983a09dbfc7754f269ca Reviewed-on: https://chromium-review.googlesource.com/327104 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 f706901e 2016-02-24T15:14:01 D3D11: Associate ANGLE formats with GL internal formats Add a corresponding GL internal format to ANGLE format set. This is one step on the way to removing the problematic DXGI format to GL format mapping. This will also make it possible to stop storing the DXGIFormat field in RenderTarget11. The DXGIFormat field in RenderTarget11 can currently carry either the DSV format, the RTV format or the texture storage format of the resource it is managing, which makes code using it hard to understand. Also fills in missing componentType for some compressed ANGLE formats in texture_format_data.json. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I87eedca8736aeface3fa6a0ec3c9d355cf006b24 Reviewed-on: https://chromium-review.googlesource.com/328961 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho bc21e18b 2016-02-23T16:04:57 D3D11 Texture refactoring: Store ANGLEFormat in TextureStorage11 This is needed to enable removing GetDXGIFormatInfo calls, which are difficult to use correctly due to a texture format being associated with multiple DXGI formats. This is done in preparation of changing some of the DXGI formats associated with integer textures. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.* (no regressions) Change-Id: I992c4c06189887c1b9de02f9b63dd9a474fcffab Reviewed-on: https://chromium-review.googlesource.com/329094 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 7d32aa5f 2016-02-29T14:45:32 Revert "D3D11 Texture refactoring: Store ANGLEFormat in TextureStorage11" Failing Windows Debug WebGL tests: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Debug%20%28NVIDIA%29/builds/13587 Seems to fail in and around: [ FAILED ] WebglConformance.conformance_renderbuffers_framebuffer_object_attachment (320392 ms) [ RUN ] WebglConformance.conformance_renderbuffers_framebuffer_state_restoration BUG=angleproject:1244 This reverts commit d72c61c66e75536681c5fb529a92a2ee2134f0f1. Change-Id: Id84d6988bc1a3530d8dde4c36d18b735f3de06fc Reviewed-on: https://chromium-review.googlesource.com/329621 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho d72c61c6 2016-02-23T16:04:57 D3D11 Texture refactoring: Store ANGLEFormat in TextureStorage11 This is needed to enable removing GetDXGIFormatInfo calls, which are difficult to use correctly due to a texture format being associated with multiple DXGI formats. This is done in preparation of changing some of the DXGI formats associated with integer textures. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.* (no regressions) Change-Id: I820b8331e6f9aacfe9979b13118371687c5fca51 Reviewed-on: https://chromium-review.googlesource.com/329075 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho bc49758c 2016-02-23T14:43:19 Choose D3D11 swizzle formats in gen_texture_format_table.py Making swizzle format data come from the ANGLE format table will make it easier to make changes that affect both swizzle formats and regular texture formats. Swizzle format is now specified manually for some tricky formats, but for most it can be determined automatically from the ANGLE texture format info. The ANGLE texture format info in texture_format_table.json is changed to facilitate this. The componentType field now captures only whether the data is normalized, int or float and its signedness, but not the width of the data type. Bit widths of the individual channels are recorded in a separate "bits" object for each ANGLE format entry. Also, a new 16-bit RGBA UNORM ANGLE format is added to support swizzling 16-bit normalized depth formats. This change is mostly just refactoring, but it fixes swizzling for formats which have less bits for alpha than other channels: - RGB10_A2 - RGB10_A2UI - RGB5_A1 BUG=angleproject:1322 BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.texture.swizzle.* (all pass) Change-Id: I87d8a9cc0b6569191f50c41754d77b20ca6afef9 Reviewed-on: https://chromium-review.googlesource.com/329074 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 11505601 2016-02-17T16:41:50 D3D11 Texture refactoring: Add ANGLEFormat enumeration to C++ code Texture formats that are internal to ANGLE can now be uniquely identified using the ANGLEFormat enum. GetANGLEFormatInfo returns a structure with the DXGI texture formats associated with the ANGLE format. For starters, the ANGLEFormat enum is used when building texture info structures queried from GetTextureFormatInfo. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I58a2027a1d9b7a5621f943cc5ceeb88a858009e3 Reviewed-on: https://chromium-review.googlesource.com/328254 Reviewed-by: Corentin Wallez <cwallez@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 6151af8c 2016-02-19T15:22:07 Remove renderFormat from TextureFormat structure The renderFormat is only ever needed in renderer11_utils when determining which multisample sample counts a format supports. Determine the renderFormat in the context where it is needed instead of storing it in the TextureFormat structure. Extra fallbacks can also be removed from the code. The D3D11FormatTablesTest is restructured so that it doesn't need to use the renderFormat field. This refactoring is done to make it simpler to expand usage of the ANGLE format enumeration in the C++ code. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.fbo.* (no regressions) Change-Id: I980152eb2f3fdaaa1cc5b08e3c9b695c1625e9e5 Reviewed-on: https://chromium-review.googlesource.com/328680 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>
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>
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>