Issue 7501 in angleproject: Reinterpreting (casting) image2D types failing on D3D11

52 views
Skip to first unread message

senor… via monorail

unread,
Jul 14, 2022, 3:41:29 PM7/14/22
to angleproj...@googlegroups.com
Status: Assigned
Owner: senor...@chromium.org
Priority: Medium
Type: Defect

New issue 7501 by senor...@chromium.org: Reinterpreting (casting) image2D types failing on D3D11
https://bugs.chromium.org/p/angleproject/issues/detail?id=7501

Reinterpreting the pixel format of an image2D binding does not work on D3D11.

E.g.,
1) out\Debug\angle_deqp_gles31_tests.exe --gtest_filter=dEQP-GLES31.functional.image_load_store.2d.format_reinterpret.r32i_r32f --use-angle=d3d11

Result:

WARN: Debug.cpp:186 (insertMessage): GL error: HIGH: Error: 0x00000502, in ..\..\src\libANGLE\renderer\d3d\d3d11\ResourceManager11.cpp, allocate:404. Internal D3D11 error: HRESULT: 0x80070057: Error allocating ShaderResourceView

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

senor… via monorail

unread,
Jul 14, 2022, 3:44:20 PM7/14/22
to angleproj...@googlegroups.com
Updates:
Labels: OS-Windows Renderer-D3D11

Comment #1 on issue 7501 by senor...@chromium.org: Reinterpreting (casting) image2D types failing on D3D11
https://bugs.chromium.org/p/angleproject/issues/detail?id=7501#c1

The texture is created with the format R32_SINT but TextureStorage11_2D::createSRVForImage() is attempting to create an SRV of format R32_FLOAT.

AFAICT, this will only work if the texture was originally created with the R32_TYPELESS format.

senor… via monorail

unread,
Jul 14, 2022, 4:48:31 PM7/14/22
to angleproj...@googlegroups.com
Updates:
Status: Started

Comment #2 on issue 7501 by senor...@chromium.org: Reinterpreting (casting) image2D types failing on D3D11
https://bugs.chromium.org/p/angleproject/issues/detail?id=7501#c2

Note that a simple hack to use DXGI_FORMAT_R32_TYPELESS for all of the R32 formats (R32_FLOAT, R32_SINT, R32_UINT) causes the SRV creation to succeed.

However, the test fails further along when it tries to create a render target from that TYPELESS texture with a null desc:

WARN: Debug.cpp:186 (insertMessage): GL error: HIGH: Error: 0x00000502, in ..\..\src\libANGLE\renderer\d3d\d3d11\ResourceManager11.cpp, allocate:404. Internal D3D11 error: HRESULT: 0x80070057: Error allocating RenderTargetView

So obviously this hack is not a real solution, just confirms the problem.

senor… via monorail

unread,
Jul 14, 2022, 7:51:09 PM7/14/22
to angleproj...@googlegroups.com

Comment #3 on issue 7501 by senor...@chromium.org: Reinterpreting (casting) image2D types failing on D3D11
https://bugs.chromium.org/p/angleproject/issues/detail?id=7501#c3

Continuing the hacks, giving an explicit D3D11_RENDER_TARGET_VIEW_DESC and converting the TYPELESS format back to typed causes the test to pass.

Hacks here: https://chromium-review.googlesource.com/c/angle/angle/+/3763072

Git Watcher via monorail

unread,
Jul 26, 2022, 5:30:11 PM7/26/22
to angleproj...@googlegroups.com

Comment #4 on issue 7501 by Git Watcher: Reinterpreting (casting) image2D types failing on D3D11
https://bugs.chromium.org/p/angleproject/issues/detail?id=7501#c4

The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/3f59c28562680c5369ec78a61f48ee828b13c897

commit 3f59c28562680c5369ec78a61f48ee828b13c897
Author: Stephen White <senor...@chromium.org>
Date: Tue Jul 12 21:29:36 2022

D3D11: implement image load/store format reinterpretation.

Reinterpretation requires all UAV textures to be in a TYPELESS
format. Implement an ensureUnorderedAccess() that converts the
texture's storage to one with the D3D11_BIND_UNORDERED_ACCESS
flag, which, prior to this change, was set unconditionally for
all textures in an >= ES 3.1 context. If this flag is set at
D3D texture creation time, use the appropriate TYPELESS format.

Implementation uses a BindFlags struct, which subsumes the
existing renderTarget for clarity. Factor out the relevant bits
of ensureRenderTarget() into an ensureBindFlags() helper function,
and make ensureRenderTarget() and ensureUnorderedAccess() wrappers
around it.

Add the corresponding typeless formats to the texture format table.

Bug: angleproject:7501, angleproject:7520
Change-Id: Id21b9db3229aceca121da6ba6507704417034ec4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780588
Reviewed-by: Jamie Madill <jma...@chromium.org>
Reviewed-by: Geoff Lang <geof...@chromium.org>
Commit-Queue: Stephen White <senor...@chromium.org>

[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/scripts/code_generation_hashes/D3D11_format.json
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/TextureStorage.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/tests/deqp_support/deqp_gles31_test_expectations.txt
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/texture_format_data.json
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/TextureD3D.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/TextureD3D.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/texture_format_table.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
[modify] https://crrev.com/3f59c28562680c5369ec78a61f48ee828b13c897/src/libANGLE/renderer/d3d/RendererD3D.h
Reply all
Reply to author
Forward
0 new messages