Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texture_create: Format 'R8_Uint' does not support usage as storage image. #67430

Closed
norrath-hero-cn opened this issue Oct 15, 2022 · 20 comments · Fixed by #70122, #71939 or #72068
Closed

texture_create: Format 'R8_Uint' does not support usage as storage image. #67430

norrath-hero-cn opened this issue Oct 15, 2022 · 20 comments · Fixed by #70122, #71939 or #72068

Comments

@norrath-hero-cn
Copy link

norrath-hero-cn commented Oct 15, 2022

Godot version

Godot Engine v4.0.beta3.official.01ae26d31

System information

VIVO Z3, Android 9, Snapdragon 710AIE, Vulkan API 1.1.0 - Using Vulkan Device #0: Qualcomm - Adreno (TM) 616

Issue description

Just re-tested #67146 on beta3 this time reveal a new issue, still black screen
image

Steps to reproduce

please use the reproduction project

Minimal reproduction project

demo.zip

@clayjohn
Copy link
Member

After a little investigation, this appears to be related to the VRS texture as it is the only texture using the R8uint type.

@BastiaanOlij Looks like we need to make a shader version that excludes VRS entirely from the GI shader instead of using a specialization constant and then when VRS is not supported, we can disable creating the default VRS texture entirely.

@BastiaanOlij
Copy link
Contributor

@clayjohn the scene shader doesn't specifically do anything here, it's all handled by how the VRS texture is bound to the frame buffer. The only shader I think where this is specifically included is the vrs shader itself but in that it's no more then layout(location = 0) out uint frag_color;.

Our problem may be stemming from the code creating our default VRS texture (in TextureStorage::TextureStorage for our RD texture storage) as that is created regardless of whether we end up using VRS. I guess we can change this to RD::DATA_FORMAT_R8_UNORM without any real risk..

@BastiaanOlij
Copy link
Contributor

(the only other place where we use DATA_FORMAT_R8_UINT is when we create our internal VRS texture however this is only done if VRS is actually used).

@norrath-hero-cn
Copy link
Author

Just re-tested on beta4 and report new logs

--------- beginning of system
--------- beginning of main
11-02 01:30:30.976 25746 25785 I godot : Godot Engine v4.0.beta4.official.e6751549c - https://godotengine.org
11-02 01:30:30.997 25746 25785 I godot : Vulkan API 1.1.0 - Using Vulkan Device #0: Qualcomm - Adreno (TM) 616
11-02 01:30:31.034 25746 25785 E godot : USER ERROR: Format 'R8_Uint' does not support usage as storage image.
11-02 01:30:31.034 25746 25785 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1829)
11-02 01:30:31.967 25746 25785 I godot :
11-02 01:30:32.182 25746 25785 E godot : USER WARNING: Icon not supported by this display server.
11-02 01:30:32.182 25746 25785 E godot : at: set_icon (servers/display_server.cpp:515)
11-02 01:30:32.182 25746 25785 I godot : Hello Godot
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.
11-02 01:30:32.188 25746 25785 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1829)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
11-02 01:30:32.188 25746 25785 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2271)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: All attachments unused.
11-02 01:30:32.188 25746 25785 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4168)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
11-02 01:30:32.188 25746 25785 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2271)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: All attachments unused.
11-02 01:30:32.188 25746 25785 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4168)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
11-02 01:30:32.188 25746 25785 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2271)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: All attachments unused.
11-02 01:30:32.188 25746 25785 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4168)
11-02 01:30:32.188 25746 25785 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
11-02 01:30:32.188 25746 25785 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2271)
...

Here is full logs
logcat.log

@norrath-hero-cn
Copy link
Author

Re-tested on Beta5

--------- beginning of main
--------- beginning of system
11-17 21:42:49.777 29788 29821 I godot : Godot Engine v4.0.beta5.official.89a33d28f - https://godotengine.org
11-17 21:42:49.799 29788 29821 I godot : Vulkan API 1.1.0 - Using Vulkan Device #0: Qualcomm - Adreno (TM) 616
11-17 21:42:49.877 29788 29821 E godot : USER ERROR: Format 'R8_Uint' does not support usage as storage image.
11-17 21:42:49.877 29788 29821 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1829)
11-17 21:42:50.845 29788 29821 I godot :
11-17 21:42:51.439 29788 29821 E godot : USER WARNING: Icon not supported by this display server.
11-17 21:42:51.439 29788 29821 E godot : at: set_icon (servers/display_server.cpp:508)
...

Here is full logs
logcat.log

@dave2
Copy link

dave2 commented Nov 24, 2022

Can confirm I've tested my code on 4.0 beta 6, same error message as noted previously.

@norrath-hero-cn
Copy link
Author

Re-tested on Beta7

--------- beginning of system
--------- beginning of main
12-02 03:06:39.223 11455 11488 I godot : Godot Engine v4.0.beta7.official.0ff874291 - https://godotengine.org
12-02 03:06:39.281 11455 11488 I godot : Vulkan API 1.1.0 - Using Vulkan Device #0: Qualcomm - Adreno (TM) 616
12-02 03:06:39.319 11455 11488 E godot : USER ERROR: Format 'R8_Uint' does not support usage as storage image.
12-02 03:06:39.319 11455 11488 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1829)
12-02 03:06:40.294 11455 11488 I godot :
12-02 03:06:40.517 11455 11488 I godot : Hello Godot
12-02 03:06:40.524 11455 11488 E godot : USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.
12-02 03:06:40.524 11455 11488 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1829)
12-02 03:06:40.524 11455 11488 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
12-02 03:06:40.524 11455 11488 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2292)
12-02 03:06:40.524 11455 11488 E godot : USER ERROR: All attachments unused.
12-02 03:06:40.524 11455 11488 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4192)
12-02 03:06:40.524 11455 11488 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
12-02 03:06:40.524 11455 11488 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2292)
12-02 03:06:40.524 11455 11488 E godot : USER ERROR: All attachments unused.
...

full logs
logcat.log

@Bucham
Copy link

Bucham commented Dec 5, 2022

Hello, I think my problem is being addressed here. If not, please correct me. In my case I get the error "E 0:00:00:0381 texture_create: Format 'R8_Uint' does not support usage as storage image. <C++ Error> Method/function failed. Returning: RID() <C++ Source> drivers/vulkan /rendering_device_vulkan.cpp:1829 @ texture_create()", when I try to use one_click_deploy.

It happens to me in Godot 4.0 beta7 in any of the two project creation options (forward and mobile). My mobile android is a Redmi Note 4. the android version is 7.0 NRD90M (I don't know if the android version could be the problem, but it is no longer updated). The project stops on the PC and on the mobile screen only a gray screen of the default background color of the 2d world appears.
My game is pixel art. I don't understand what VRS is, (at the moment I haven't needed it), but I see that you talk about it. To try, I have looked in the project configuration and I have seen that in the only place where I have seen it, it is in disabled mode (Rendering/VRS), I have also tried it in texture mode, but I cannot get any other result. I have also tested it on a Galaxy s21 with android 12, and it works correctly on that one. If you need more information or whatever, just ask, thank you very much and best regards.

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Dec 19, 2022

Just checked #70122, issue still exists, and also reports:

Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.

this time crash app not dead loop. please re-open this issue

...
12-19 15:52:27.396 9687 9718 E godot : USER ERROR: Format 'R8_Unorm' does not support usage as storage image.
12-19 15:52:27.396 9687 9718 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1828)
...
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.
12-19 15:52:28.490 9687 9718 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1828)
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
12-19 15:52:28.490 9687 9718 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2291)
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: All attachments unused.
12-19 15:52:28.490 9687 9718 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4191)
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
12-19 15:52:28.490 9687 9718 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2291)
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: All attachments unused.
12-19 15:52:28.490 9687 9718 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4191)
12-19 15:52:28.490 9687 9718 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
...
12-19 15:52:28.698 9741 9741 F DEBUG : Softversion: PD1813D_A_7.8.30
12-19 15:52:28.698 9741 9741 F DEBUG : Time: 2022-12-19 15:52:28
12-19 15:52:28.698 9741 9741 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-19 15:52:28.698 9741 9741 F DEBUG : Build fingerprint: 'vivo/PD1813D/PD1813D:9/PKQ1.181030.001/compiler07221602:user/release-keys'
12-19 15:52:28.698 9741 9741 F DEBUG : Revision: '0'
12-19 15:52:28.698 9741 9741 F DEBUG : ABI: 'arm64'
12-19 15:52:28.698 9741 9741 F DEBUG : pid: 9687, tid: 9718, name: VkThread >>> org.godotengine.demo <<<
12-19 15:52:28.698 9741 9741 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x821fd03ea8
12-19 15:52:28.698 9741 9741 F DEBUG : x0 0000007a21ffc830 x1 0000000000000000 x2 0000000000000048 x3 0000000000000000
12-19 15:52:28.698 9741 9741 F DEBUG : x4 0000007a1fd03eb0 x5 0000000000000003 x6 0000007a21ffcbf0 x7 0000000000000001
12-19 15:52:28.698 9741 9741 F DEBUG : x8 0000000000000002 x9 0000000000000018 x10 0000000000000018 x11 0000007a1d010b10
12-19 15:52:28.698 9741 9741 F DEBUG : x12 0000000000000048 x13 0000000000000000 x14 0000007a1d010b10 x15 0000000000000070
12-19 15:52:28.698 9741 9741 F DEBUG : x16 0000007a211e2ad0 x17 0000007ace221270 x18 0000007a1c9a5660 x19 0000007a2134b800
12-19 15:52:28.698 9741 9741 F DEBUG : x20 0000000000000001 x21 0000007a1cfd2a50 x22 0000007a1c9a5660 x23 0000000000000000
12-19 15:52:28.698 9741 9741 F DEBUG : x24 0000007a1c9a58c0 x25 0000007a1c9a5668 x26 0000000000000005 x27 00000000ffffffff
12-19 15:52:28.698 9741 9741 F DEBUG : x28 0000007a1c8c9e00 x29 0000007a21ffc8d0
12-19 15:52:28.698 9741 9741 F DEBUG : sp 0000007a21ffc7b0 lr 0000007a20f907a4 pc 0000007a20f907c4
12-19 15:52:28.701 9741 9741 F DEBUG :
12-19 15:52:28.701 9741 9741 F DEBUG : backtrace:
12-19 15:52:28.701 9741 9741 F DEBUG : #00 pc 00000000000747c4 /vendor/lib64/hw/vulkan.sdm710.so (QglCommandBuffer::WriteAttachmentClears(QglAttachmentsClearInfo const*)+780)
12-19 15:52:28.701 9741 9741 F DEBUG : #1 pc 0000000000058c28 /vendor/lib64/hw/vulkan.sdm710.so (qglinternal::vkCmdClearAttachments(VkCommandBuffer_T*, unsigned int, VkClearAttachment const*, unsigned int, VkClearRect const*)+1344)
12-19 15:52:28.701 9741 9741 F DEBUG : #2 pc 00000000014d9d34 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #3 pc 00000000014da370 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #4 pc 000000000276054c /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #5 pc 000000000275e9b4 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #6 pc 0000000002761264 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #7 pc 00000000026a833c /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #8 pc 0000000002608934 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #9 pc 0000000002602d8c /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #10 pc 00000000025ce23c /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #11 pc 00000000025ce6dc /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #12 pc 00000000025d0da0 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #13 pc 0000000002580ea8 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #14 pc 0000000000b1a2bc /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #15 pc 0000000000ad78e4 /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)
12-19 15:52:28.701 9741 9741 F DEBUG : #16 pc 0000000000aeb90c /data/app/org.godotengine.demo-sf-ftzmoj2dd1S9c6-HcFA==/lib/arm64/libgodot_android.so (offset 0xad5000)

full logs
logcat.log

@clayjohn
Copy link
Member

@norrath-hero-cn Can you post the logs you get when running Godot with the --verbose command line flag? I'm not sure how that will work on Android though.

@m4gr3d Do you know how to enable verbose output on an Android APK?

@akien-mga
Copy link
Member

There's a project setting for verbose stdout.

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Dec 19, 2022

image

the logs here
godot.log

@clayjohn
Copy link
Member

Thank you!

Looking through the logs I can see the VRS is not supported on this device and the error messages are different than the ones in the OP, but are related:

USER ERROR: Format 'R8_Unorm' does not support usage as storage image.

and

USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Dec 19, 2022

Thank you!

Looking through the logs I can see the VRS is not supported on this device and the error messages are different than the ones in the OP, but are related:

USER ERROR: Format 'R8_Unorm' does not support usage as storage image.

and

USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.

Thanks for dive deeper on this issue!

It's an relative old device, but it's powerful enough to run Pascal's Wager smoothly, so I always use it as primary test device, and I also set it as a goal to reach the performance for mid to low end device

@clayjohn
Copy link
Member

Screenshot from 2022-12-19 15-23-45
Screenshot from 2022-12-19 15-21-33
Screenshot from 2022-12-19 15-22-18

Looks like none of these formats are well supported as storage images. The R8_UNORM issue is easy to fix, we just won't pass the SAMPLED image flag when VRS is not supported. But the A2B10G10R10_Unorm_Pack32 issue will be a bit more challenging as it the format used by the mobile render buffers. Will need more investigation

@norrath-hero-cn
Copy link
Author

re-tested to check #71939

still crashes, this time not a single 'R8_Uint' appears in the logs, but there is still 'A2B10G10R10_Unorm_Pack32'.

Feeling one step closer to removing the barrier to Android altogether

01-25 22:44:20.381 32270 32302 E godot : USER ERROR: Format 'A2B10G10R10_Unorm_Pack32' does not support usage as storage image.
01-25 22:44:20.381 32270 32302 E godot : at: texture_create (drivers/vulkan/rendering_device_vulkan.cpp:1833)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
01-25 22:44:20.381 32270 32302 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2301)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: All attachments unused.
01-25 22:44:20.381 32270 32302 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4201)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
01-25 22:44:20.381 32270 32302 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2301)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: All attachments unused.
01-25 22:44:20.381 32270 32302 E godot : at: framebuffer_create_multipass (drivers/vulkan/rendering_device_vulkan.cpp:4201)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: Condition "!src_texture" is true. Returning: RID()
01-25 22:44:20.381 32270 32302 E godot : at: texture_create_shared_from_slice (drivers/vulkan/rendering_device_vulkan.cpp:2301)
01-25 22:44:20.381 32270 32302 E godot : USER ERROR: All attachments unused.

full logs with "verbose stdout" enabled:
godot.log

@clayjohn
Copy link
Member

clayjohn commented Jan 25, 2023

@norrath-hero-cn What features are you using in the project that reproduces this? I fixed all the cases of using A2B10G10R10_Unorm_Pack32 as storage that I could find, but I am clearly missing a combination of features/settings that you are using

And to confirm, you are using the mobile renderer right?

@norrath-hero-cn
Copy link
Author

@norrath-hero-cn What features are you using in the project that reproduces this? I fixed all the cases of using A2B10G10R10_Unorm_Pack32 as storage that I could find, but I am clearly missing a combination of features/settings that you are using

And to confirm, you are using the mobile renderer right?

Yes, mobile renderer, just checked #72068

Still crashing, but this time not a single R8_Uint' or 'A2B10G10R10_Unorm_Pack32' presents, I think the storage image problem is handled, remaining problem is some detail processing.

Should I open a new issue to track the crashes? @clayjohn

full logs with "verbose stdout" enabled:
godot.log

@clayjohn
Copy link
Member

Should I open a new issue to track the crashes?

Yes please. The error message in this issue was not the source of the crash, it was just an indicator that we were utilizing resource types that aren't supported by your GPU

@norrath-hero-cn
Copy link
Author

Should I open a new issue to track the crashes?

Yes please. The error message in this issue was not the source of the crash, it was just an indicator that we were utilizing resource types that aren't supported by your GPU

OK, I will try to build a debug android-template then re-test it to see if we can get symbols for the stacktrace in crash log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment