src/libANGLE/renderer/d3d/d3d11/TextureStorage11.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>
Olli Etuaho 77ae8d57 2016-05-06T14:19:01 Share TextureState structure with TextureImpl This refactoring patch removes the need to pass texture state to methods of TextureImpl in some cases. It also adds target value to TextureState, and moves TextureState definition to Texture.h. The effective base level can now also be queried from TextureState, which reduces the need to pass it around. Two different code paths that dealt with the TextureStorage11 SRV cache are combined into one. Besides refactoring, this patch fixes applying mTopLevel twice when determining the amount of mip levels TextureStorage11. BUG=angleproject:596 TEST=angle_end2end_tests, angle_unittests Change-Id: I1add3d9ad847bec56774e394125156cf9cb0fc2a Reviewed-on: https://chromium-review.googlesource.com/342940 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Ian Ewell bda75597 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I39b6ec393ea338e2c843fb911acc1b36cd1158a0 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com> Reviewed-on: https://chromium-review.googlesource.com/341254 Reviewed-by: Ian Ewell <ewell@google.com>
Corentin Wallez 9670b03e 2016-04-29T09:47:47 Revert "Finish NV12 support via streams." Broke Windows Clang compilation, see https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Clang%20Builder%20%28dbg%29/builds/3583/steps/compile/logs/stdio and search for TextureStorage11.h This reverts commit 9b8b359fa3615be7c7492239a48f61103b2e4fcc. Change-Id: I6e54305eba02b40927a35577594df39e951adb32 Reviewed-on: https://chromium-review.googlesource.com/341430 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Ian Ewell 9b8b359f 2016-04-18T17:25:54 Finish NV12 support via streams. The main functionality for NV12 texture support through EGL streams has been added. Updates to the compiler, texture code, and stream code were added to support binding to external D3D11 NV12 textures. An end2end test was also added to test sampling of YUV textures and converting to RGB. There is also a new script to convert BMP files to an NV12 texture ready to load into D3D11 for testing purposes. BUG=angleproject:1332 Change-Id: I098940e6f25e113dcc4fc8d22ffed4b5a16fd860 Reviewed-on: https://chromium-review.googlesource.com/339454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
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 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>
Olli Etuaho 14ed667f 2016-02-24T15:22:11 Remove a few GetDXGIFormatInfo queries It's needlessly complex to query texture info when determining whether a format is a depth/stencil format. It can be tested simply by checking if the dsvFormat field of the format set is set. BUG=angleproject:1244 TEST=angle_end2end_tests, dEQP-GLES3.functional.texture.specification.*depth* (no regressions) Change-Id: I76d008462564657328dae35d664be5f5e22238fa Reviewed-on: https://chromium-review.googlesource.com/329104 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>
Jamie Madill 1fbc59fe 2016-02-24T15:25:51 D3D11: Enable dirty bits for Framebuffer11. This patch works using a notification scheme - whenever a Texture or Renderbuffer changes in such a way as to recreate its RenderTarget, we pass a signal to the Framebuffer to invalidate some internal state. Everything is entirely tracked in the Renderer11 layer, and the GL layer is left untouched. A RenderTarget11 now tracks points to which it is bound, and the Framebuffer11 is mostly responsible for managing those links. The three locations where we notify a Framebuffer when its bound RenderTargets might be dirty are: 1) RenderTarget11::~RenderTarget 2) EGLImageD3D::copyToLocalRendertarget 3) TextureStorage11_2D::useLevelZeroWorkaroundTexture This patch gives about a 10% score increase in the D3D11 draw call benchmark on my system. BUG=angleproject:1260 Change-Id: Ide38aeadff4a2681bf5bd685e8ca3c9e2612a380 Reviewed-on: https://chromium-review.googlesource.com/327255 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d834e3dc 2016-02-24T13:44:43 D3D11: Fix Array texture depth-stencil attachments. We were missing support for these layer depth-stencil attachments. This fixes running a WebGL test for this feature. BUG=angleproject:1260 BUG=angleproject:1315 Change-Id: Ida7d44ba1fe65d5da95d2db721e497bfa685db77 Reviewed-on: https://chromium-review.googlesource.com/327402 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 8fd2ca41 2016-02-23T11:14:39 Fix MSVS 2013 build Implicit conversion from int to boolean was generating a warning on MSVS 2013. Still useful to keep support around at least while build instructions recommend using MSVS 2013. Change-Id: I6975198f4bc6740a745454375f422d9c67ffaea5 Reviewed-on: https://chromium-review.googlesource.com/329070 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
John Bauman 24a504ec 2016-02-18T13:53:00 Clear SRV cache on keyed mutex texture unbind from TextureStorage11 If the calling code releases the keyed mutex after the unbind then D3D will unbind the SRV or RTV from the pipeline without notifying the cache. This allows the SRV to be destroyed, which means that a subsequently-created SRV could have the same address. This would cause the new SRV to not be correctly bound to the pipeline if its slot is the same as the unbound SRV. BUG=588000 Change-Id: I0ad1ba3706a6bcc1fee50745e6148c9b23e578f6 Reviewed-on: https://chromium-review.googlesource.com/328400 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: John Bauman <jbauman@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>
Olli Etuaho 72e6606d 2016-02-15T11:52:54 Add more const qualifiers in TextureStorage11 This makes the code easier to follow. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I7787b04217a6771629e69f6f67586f62ce5cfccf Reviewed-on: https://chromium-review.googlesource.com/327053 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill dc107978 2016-02-12T09:27:23 Clean up the style in TextureStorage11. This is a pure refactoring change, and should behave identically. BUG=angleproject:1260 Change-Id: I44f5ef2f1444ffd8f8dd6ce55c266ec95781a6d8 Reviewed-on: https://chromium-review.googlesource.com/327266 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho ee991799 2016-02-10T18:25:40 Fix texture swizzle cache initialization Texture swizzle cache needs to be initialized so that the keys do not represent a valid swizzle state before any swizzled textures have been cached. BUG=angleproject:1095 TEST=dEQP-GLES3.functional.texture.swizzle.* (all pass) Change-Id: I66c10ed49134875d29b07852488a41a776e8fb67 Reviewed-on: https://chromium-review.googlesource.com/326971 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>
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 5e017349 2016-02-01T11:13:04 Add Debug labels to more D3D11 objects. This makes debugging using graphics tools easier on Windows. BUG=angleproject:1290 BUG=angleproject:1299 Change-Id: Ia3889c10fd8e23486f0122e0b567c470517bc9e0 Reviewed-on: https://chromium-review.googlesource.com/324821 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 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>
Jamie Madill 8d9f35f1 2015-11-24T16:10:20 Re-land "D3D11: Fix Integer Texture Cube mip mapping." We were missing both the correct SRV parameter, as well as the full computation of the mip level in the HLSL. Re-land makes the mip computation only happen with implicit sampling. Before it would confuse the LOD0 computation. BUG=angleproject:1208 TEST=dEQP-GLES3.functional.texture.* Change-Id: I4b579033afe5cd1aca1f2d017e48a74c7fc324cc Reviewed-on: https://chromium-review.googlesource.com/314330 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>
Jamie Madill ee322723 2015-11-24T20:42:48 Revert "D3D11: Fix Integer Texture Cube mip mapping." 2 tests failed: dEQP_GLES3.Default/functional_shaders_texture_functions_texture_isamplercube_vertex (c:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\tests\deqp_support\angle_deqp_gtest.cpp:234) dEQP_GLES3.Default/functional_shaders_texture_functions_texture_usamplercube_vertex (c:\b\build\slave\gpu_win_builder\build\src\third_party\angle\src\tests\deqp_support\angle_deqp_gtest.cpp:234) BUG=angleproject:1208 This reverts commit 5778557fe99e300f245a7bfc2200f6b0179e3fbf. Change-Id: I6f7441bdbfbf937680b0d572645edee8ece649a1 Reviewed-on: https://chromium-review.googlesource.com/314301 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5778557f 2015-11-23T09:37:44 D3D11: Fix Integer Texture Cube mip mapping. We were missing both the correct SRV parameter, as well as the full computation of the mip level in the HLSL. BUG=angleproject:1208 Change-Id: I345b1e0895495654de3863c4ebcc395d9b7371b9 Reviewed-on: https://chromium-review.googlesource.com/312060 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 69cce580 2015-09-17T13:20:36 Split the SamplerState struct into SamplerState and TextureState. SamplerState is now only the members that are overridden by a sampler object, this makes it easy to update those specific members. Opted for getters and setters for each member in Texture and Sampler because it will be required to enable dirty bits for these states. Added maxAnisotropy to the SamplerState instead of texture state. The sampler objects extension mentions it should be there. BUG=angleproject:1162 Change-Id: I5aa6d702bd5915ee9df1976afef3c8c1f69d27c8 Reviewed-on: https://chromium-review.googlesource.com/300490 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
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>
Geoff Lang 362c0a79 2015-08-12T14:44:38 Implement EGL image classes for the D3D renderers. BUG=angleproject:970 Change-Id: I24d393fcd75dd4ee510785e8475b093868701c77 Reviewed-on: https://chromium-review.googlesource.com/295152 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Geoff Lang <geofflang@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 3828b9e7 2015-07-20T14:36:48 D3D11: Use texture format, not SRV format, for mip gen test. Using the SRV format could lead to using R32F for D32F formats, which is incorrect. BUG=angleproject:1075 TEST=dEQP-GLES3.functional.fbo.blit.* Change-Id: Ic81d51b888897a7f7c79e2ba1a24ab69f18d981c Reviewed-on: https://chromium-review.googlesource.com/286770 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang a455824c 2015-07-17T14:25:01 Remove GetAttachmentSerial. Cascades to remove serials from many objects. BUG=angleproject:970 Change-Id: I0a74a14519da3203cd5df7ae0fa19f83393951ce Reviewed-on: https://chromium-review.googlesource.com/286554 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Cooper Partin 1bd7dd45 2015-06-11T08:58:53 Added 16-bit formats to GLConfigs to reduce offscreen texture memory usage. BUG=angleproject:1042 Change-Id: I7024bd47601a21b08cafbf6460d512151b53d035 Reviewed-on: https://chromium-review.googlesource.com/277002 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Sam McNally 5a0edc62 2015-06-30T12:36:07 Change intializer list order to match field order. BUG=505304 Change-Id: I38149e72732f0b4eb7d398f90b5d11660e2a7fbc Reviewed-on: https://chromium-review.googlesource.com/282465 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@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>
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>
Austin Kinross b8af723d 2015-03-16T22:33:25 Fix and enable warning C4245 (signed/unsigned mismatch) Change-Id: If48043835fcc98341a0626e3ece7d0e3f7958059 Reviewed-on: https://chromium-review.googlesource.com/260630 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cooper Partin <coopp@microsoft.com> Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 74ba76c4 2015-02-09T10:31:23 Move rx::MemoryBuffer to common library. This class is not D3D-specific so can be shared among other back-ends, or other parts of the ANGLE codebase. Change-Id: Ie00760eb5dae4db52e465ee7a2f97789bae8c0b0 Reviewed-on: https://chromium-review.googlesource.com/246500 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Gregoire Payen de La Garanderie 88fe1ad7 2015-01-19T15:09:26 Update the texture storage after generateMipmaps and setStorage. Also adds a few assert in SetData and various places to ensure that images are not dirty before modifying the storage. BUG=angle:873 Change-Id: I7cc922b33da0d79a1b5aefe216e9ccfaaf86a306 Reviewed-on: https://chromium-review.googlesource.com/241880 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Jamie Madill b2d298db 2015-01-29T10:29:51 Fix TextureStorage11::setData for 3D textures. Currently this method doesn't handle partial offsets. Fixes dEQP tests in the texture specification group. BUG=angle:899 Change-Id: I20160e49a46957b4f6cf96f529ab4ea7ddf7b343 Reviewed-on: https://chromium-review.googlesource.com/244091 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 3ae6465f 2015-01-26T15:51:39 Fix lots of variable shadowing in ANGLE BUG=angle:877 Change-Id: I3df0fffb19f5ecbe439fbc2a8d6d239a5dc6b638 Reviewed-on: https://chromium-review.googlesource.com/243334 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 74cafab1 2015-01-23T23:17:32 Revert "Fix lots of variable shadowing in ANGLE" Caused WebGL CTS failures on the texture-npot test: https://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/texture-npot.html This reverts commit c67e6e9fade44ef8938724e82db11db725e9c8e5. Change-Id: I089e99859231e0d657084ac3647257c650a9da92 Reviewed-on: https://chromium-review.googlesource.com/243041 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross c67e6e9f 2015-01-21T16:01:07 Fix lots of variable shadowing in ANGLE BUG=angle:877 Change-Id: I15168ae32605b26aee08274464ffe68adb5a7e87 Reviewed-on: https://chromium-review.googlesource.com/242351 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Austin Kinross 62815bf4 2015-01-15T16:32:36 Improve D3D11 FL9_3 zero-LOD workaround (e.g. TextureCubes) D3D11 Feature Level 9_3 can't disable mipmaps on a mipmapped texture, and sample from level zero of it. A previous commit added a workaround for this in ANGLE to Texture2Ds. This commit fixes some minor issues in that commit, and extends the workaround to apply to TextureCubes too. Change-Id: Ic97321af6f8bbf7ad5d96e58655c342db3978a6a Reviewed-on: https://chromium-review.googlesource.com/241944 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@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>
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>
Jamie Madill 155610b9 2015-01-15T16:37:17 Fix off-by-one max mip levels in getSRV. We would try to create SRVs with zero mip levels, when we should be asking for a single mip level. This would happen when the base level is equal to the max level. See the dEQP test: texture.mipmap.2d.max_level.linear_nearest Change-Id: I3f231f159dbdecbf7c2e61b373bfc3545875f36e Reviewed-on: https://chromium-review.googlesource.com/240762 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 215b37a6 2014-12-22T12:56:07 Work around zero-LOD mipmap issue on D3D11 Feature Level 9_3 In OpenGL ES, it is possible to sample from level 0 of a mipmapped texture by setting GL_TEXTURE_MIN_FILTER to GL_NEAREST. This is possible in D3D9 and D3D11 Feature Level 10_0+ via various methods. It's not possible in D3D11 Feature Level 9_3, though. This change works around this restriction by creating two copies of each texture on 9_3. The textures are identical, except one has mipmaps and one doesn't. The D3D11 renderer figures out which texture to use at the right time, and keeps the textures in sync with each other as necessary. Note: each texture is only created when it's needed. It's possible that only one (or even neither) D3D texture will be created for a given GL texture. Change-Id: I3c17137b4f63b9158b3abf067ad8e5d5c49d2191 Reviewed-on: https://chromium-review.googlesource.com/234522 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@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>
Bruce Dawson 36e86234 2014-12-01T16:48:23 Improve image update perf by re-using a MemoryBuffer. Instead of allocating a new MemoryBuffer every frame, we can store one scratch buffer in the Renderer, and occasionally re-create it to ensure we aren't stuck using the maximum amount of memory. BUG=angle:842 Change-Id: Id7c1912921ed8f84b151413453c3268d853352db Reviewed-on: https://chromium-review.googlesource.com/230861 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Bruce Dawson <brucedawson@google.com> Reviewed-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>