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

Vulkan Mobile: Tilemap has rendering issues on MediaTek Dimensity SoC #85750

Closed
ModuleCode opened this issue Dec 4, 2023 · 16 comments
Closed

Comments

@ModuleCode
Copy link

ModuleCode commented Dec 4, 2023

Godot version

v4.2.stable.official [46dc277]

System information

Windows 11- Godot v4.2.stable.official [46dc277] - Vulkan (Forward+)

Issue description

When I used Godot's Tilemap to package it for mobile Android, I found that if your phone has a Dimensity processor, it will cause tearing of the screen.
f43b320f90dbf74ebe678820676075a2
I don't have this problem when running on a Snapdragon processor
42be6062a982868fcdf9c89b05f0b9c3

This problem exists in version 4.x
And this problem is randomly generated ,it is uncertain

Steps to reproduce

Use Android emulator or Dimensity to run it and you can see the error effect.

Minimal reproduction project

bug.zip

@clayjohn
Copy link
Member

clayjohn commented Dec 4, 2023

I have a feeling that this is a similar issue to those fixed by #84852 (but for textures) It might even be the same issue as #83481

In other words, I think it is likely an issue with how we readback memory from the GPU

CC @Alex2782 You may be interested in this issue.

@Calinou Calinou changed the title Mobile Tilemap has rendering issues on Dimensity processor Vulkan Mobile: Tilemap has rendering issues on MediaTek Dimensity SoC Dec 5, 2023
@Alex2782
Copy link
Contributor

Alex2782 commented Dec 5, 2023

@ModuleCode:

  • how were you able to test it in the emulator? (as far as I know, the emulators do not have vulkan drivers)
  • what system information / API version does adb show (emulator and MediaTek Dimensity)? see adb-examples below

Emulator Android 11 on Windows 10:
USER ERROR: vkEnumeratePhysicalDevices reported zero accessible devices. / vkEnumeratePhysicalDevices Failure

Settings -> Advanced
Bildschirmfoto 2023-12-05 um 17 13 00


adb logcat -s godot

Emulator Android 11

--------- beginning of main  
--------- beginning of system
12-05 16:07:06.777  7493  7538 I godot   : Godot Engine v4.2.stable.official.46dc27791 - https://godotengine.org        
12-05 16:07:07.203  7493  7538 E godot   : USER ERROR: vkEnumeratePhysicalDevices reported zero accessible devices.     
12-05 16:07:07.203  7493  7538 E godot   : 
12-05 16:07:07.203  7493  7538 E godot   : Do you have a compatible Vulkan installable client driver (ICD) installed?   
12-05 16:07:07.203  7493  7538 E godot   : vkEnumeratePhysicalDevices Failure
12-05 16:07:07.203  7493  7538 E godot   :    at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:1186)      
12-05 16:07:07.204  7493  7538 E godot   : USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE        
12-05 16:07:07.204  7493  7538 E godot   :    at: _window_create (drivers/vulkan/vulkan_context.cpp:1837)
12-05 16:07:07.204  7493  7538 E godot   : USER ERROR: Failed to create Vulkan window.
12-05 16:07:07.204  7493  7538 E godot   :    at: DisplayServerAndroid (platform/android/display_server_android.cpp:573)

Samsung Tab S7 (Snapdragon), I could not reproduce either

12-05 16:49:13.552 30227 30367 I godot   : Godot Engine v4.2.stable.official.46dc27791 - https://godotengine.org
12-05 16:49:13.754 30227 30367 I godot   : Vulkan API 1.1.128 - Forward Mobile - Using Vulkan Device #0: Qualcomm - Adreno (TM) 650

@ModuleCode
Copy link
Author

ModuleCode commented Dec 5, 2023

@Alex2782
I tested many mobile phones (not simulators), but this problem does not occur on Snapdragon processors. This problem occurs on Dimensity processors, and it is uncertain. Sometimes the problem will occur, sometimes not. Running on a real phone requires a mobile phone with a Dimensity processor.
Emulator (Android 13):
image

12-06 02:30:31.410 15680 15930 I godot   : Godot Engine v4.2.stable.official.46dc27791 - https://godotengine.org
12-06 02:30:31.585 15680 15930 I godot   : Vulkan API 1.1.177 - Forward Mobile - Using Vulkan Device #0: ARM - Mali-G57 MC3
12-06 02:30:32.986 15680 15930 I godot   :
12-06 02:30:34.200 15680 15930 E godot   : USER ERROR: Error calling from signal 'body_entered' to callable: 'Node2D(test_scene.gd)::_on_area_2d_3_body_entered': Cannot convert argument 1 from Object to Object.
12-06 02:30:34.200 15680 15930 E godot   :    at: emit_signalp (core/object/object.cpp:1140)

OPPO A72(Dimensity):
image

12-06 02:30:31.410 15680 15930 I godot   : Godot Engine v4.2.stable.official.46dc27791 - https://godotengine.org
12-06 02:30:31.585 15680 15930 I godot   : Vulkan API 1.1.177 - Forward Mobile - Using Vulkan Device #0: ARM - Mali-G57 MC3
12-06 02:30:32.986 15680 15930 I godot   :
12-06 02:30:34.200 15680 15930 E godot   : USER ERROR: Error calling from signal 'body_entered' to callable: 'Node2D(test_scene.gd)::_on_area_2d_3_body_entered': Cannot convert argument 1 from Object to Object.
12-06 02:30:34.200 15680 15930 E godot   :    at: emit_signalp (core/object/object.cpp:1140)

@ModuleCode
Copy link
Author

This problem is solved
image
I set this option!!

@ModuleCode
Copy link
Author

ModuleCode commented Dec 6, 2023

@Alex2782 Although my problem has been solved, logically speaking, it should also be able to run normally in Mobile mode (Dimensity processor), right? Because the Snapdragon processor can run normally in Mobile mode.

@ModuleCode
Copy link
Author

ModuleCode commented Dec 6, 2023

image

The picture above shows the operation of the Dimensity processor. The picture below shows the operation of the Snapdragon processor.Uncertain white stripes will appear in the picture above.

@Alex2782
Copy link
Contributor

Alex2782 commented Dec 6, 2023

@ModuleCode: please use adb exec-out screencap -p > screen.png screenshot via ADB, this way we can better compare the differences.

Your last picture, above Dimensity processor with GL / OpenGL also has errors? Or was that Mobile / Vulkan API?
--> adb logcat -s godot


It is difficult to recognise errors in pixel art graphics. But I can now also see them on my Samsung Tab S7 (Vulkan API / Mobile)

v4.2.stable.official [46dc277]. (Later I will try to check the last master branch.)

A) MacOS: Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple M1
B) Android (Mobile): Vulkan API 1.1.128 - Forward Mobile - Using Vulkan Device #0: Qualcomm - Adreno (TM) 650
C) Android (GL): OpenGL API OpenGL ES 3.2 [email protected] (GIT@193b2ee, I593c16c433, 1633593732) (Date:10/07/21) - Compatibility - Using Device: Qualcomm - Adreno (TM) 650

A and C B
Bildschirmfoto 2023-12-06 um 16 24 11 Bildschirmfoto 2023-12-06 um 16 24 23

@Alex2782
Copy link
Contributor

Alex2782 commented Dec 6, 2023

That's strange, I see that the errors are constantly changing at startup. But copying "Tileset" once fixes the problem.

func _ready():
	$TileMap.tile_set = $TileMap.tile_set.duplicate()

@ModuleCode
Copy link
Author

ModuleCode commented Dec 6, 2023

@Alex2782

  1. The last picture has no errors when using GL/OpenGL, but there are problems when using Mobile/Vulkan API

  2. All problems will not occur when set to GL/OpenGL, but problems will occur when set to Mobile/Vulkan API on devices with Dimensity processors and emulators

  3. After I rewrite it according to your method, the problem still occurs in the case of (Mobile/Vulkan API)
    image
    screen
    (There will be stripes on the tree on the right)

@Alex2782
Copy link
Contributor

Alex2782 commented Dec 6, 2023

@clayjohn's "feelings" were right 😃 , fixed by #84852
maybe same issue? #71020


@ModuleCode: You could try again later with MediaTek Dimensity SoC and Vulkan API when version 4.3 is released.

Godot Engine v4.3.dev: I have restarted the demo over 10 times and could no longer recognise any errors. (Samsung Tab S7)

12-06 18:45:49.292 17074 17148 I godot   : Godot Engine v4.3.dev.custom_build.2f73a059c - https://godotengine.org
12-06 18:45:49.412 17074 17148 I godot   : Vulkan API 1.1.128 - Forward Mobile - Using Vulkan Device #0: Qualcomm - Adreno (TM) 650

@akien-mga
Copy link
Member

That fix was cherry-picked for 4.2.1, so please test 4.2.1-rc1 when it's released in a few days.

@ModuleCode
Copy link
Author

@clayjohn的“感觉”是对的 😃 ,已由#84852修复,也许是同样的问题?#71020

@ModuleCode:您可以稍后MediaTek Dimensity SoC在 4.3 版本发布时使用 Vulkan API 重试。

Godot Engine v4.3.dev:我已经重新启动演示超过10次,并且无法再识别任何错误。(Samsung Tab S7)

12-06 18:45:49.292 17074 17148 I godot   : Godot Engine v4.3.dev.custom_build.2f73a059c - https://godotengine.org
12-06 18:45:49.412 17074 17148 I godot   : Vulkan API 1.1.128 - Forward Mobile - Using Vulkan Device #0: Qualcomm - Adreno (TM) 650

ok

@Alex2782
Copy link
Contributor

Alex2782 commented Dec 6, 2023

TODO Tiles, Tiles, Tiles + Android

maybe same:
#61789
#71020

@ModuleCode
Copy link
Author

I think my problem is same :#71020

@clayjohn
Copy link
Member

clayjohn commented Dec 6, 2023

@Alex2782 Thank you very much for taking a look!

@ModuleCode
Copy link
Author

@Alex2782 Thank you very much for taking a look!

TODO Tiles, Tiles, Tiles + Android

maybe same: #61789 #71020

Thank you very much, I tried to use 4.3 export Android running, the problem does not exist

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

No branches or pull requests

6 participants