You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enabling MSAA on Android with the Vulkan Mobile renderer the screen can end up black. This is not happening on all devices so this seems driver related.
Was able to reproduce this on a Quest Pro and with experimenting found the cause. It's possible this effects certain brands of phones as well.
Depending on what is being rendered, the mobile renderer will attempt to use as many subpasses to perform the rendering as possible to keep data in tile memory for as long as possible. The issue appears if 3 or 4 subpasses are used and MSAA is enabled.
For illustration we'll use a 4 subpass scenario. The 4 subpasses will be:
Rendering opaque objects to MSAA buffer
Rendering our background sky
Rendering our transparent objects to MSAA buffer and resolve to non MSAA buffer
Perform tonemapping and exposure on non MSAA buffer and output to render target.
The issue happens in the 3rd pass. If there are no transparent objects, even though we trigger our 3rd subpass and should thus finish with a resolve, the pass is skipped in its entirety. The resolve does not happen, and our rendering is lost.
Steps to reproduce
Create a new project, set MSAA to 2x, enable OpenXR and enable stereo shaders.
Add an environment and light
Add an XROrigin and XRCamera
Add some opaque geometry
Add some code to the root node:
func _ready():
var xr_interface = XRServer.find_interface("OpenXR")
if xr_interface and xr_interface.is_initialized():
get_viewport().use_xr = true
Install the openxr loader plugin
ENABLE THE PLUGIN!!
Setup android export with the correct loader selected, OpenXR enabled and using gradlew build
Install android templates
Run project
Should give a nice black screen
Add a transparent object visible to the camera
Rendering works fine.
(Make it small, child it to the camera, and we have a workaround)
Minimal reproduction project
See instructions above.
The text was updated successfully, but these errors were encountered:
@Zireael07 very likely the same issue. It's easy to verify by just adding a 3D mesh with a transparent material. If things suddenly work it's the same bug.
Because MSAA barriers are incorrectly setup for MSAA, any MSAA bug is just a symptom of that. We should treat anything that enables MSAA as broken in Godot 4 until it's fixed.
I actually recall an old mobile driver bug in which an empty clear pass would fail to do the job correctly. However the driver version has to be quite old, I don't think that's what's happening here.
@darksylinc it's very possible its due to the barriers though on mobile the situation is a lot simpler than on Forward+. That said, it works correctly on other GPUs, it's only failing on Adreno, so thats weird.
All in all, agree that we should fix the barrier issues first and then see where we stand. That said, your idea of not having separate subpasses for opaque, sky and transparent but just merging them into a single pass would make a world of difference too.
Godot version
4.0 dev e3e2528
System information
Android
Issue description
When enabling MSAA on Android with the Vulkan Mobile renderer the screen can end up black. This is not happening on all devices so this seems driver related.
Was able to reproduce this on a Quest Pro and with experimenting found the cause. It's possible this effects certain brands of phones as well.
Depending on what is being rendered, the mobile renderer will attempt to use as many subpasses to perform the rendering as possible to keep data in tile memory for as long as possible. The issue appears if 3 or 4 subpasses are used and MSAA is enabled.
For illustration we'll use a 4 subpass scenario. The 4 subpasses will be:
The issue happens in the 3rd pass. If there are no transparent objects, even though we trigger our 3rd subpass and should thus finish with a resolve, the pass is skipped in its entirety. The resolve does not happen, and our rendering is lost.
Steps to reproduce
Create a new project, set MSAA to 2x, enable OpenXR and enable stereo shaders.
Add an environment and light
Add an XROrigin and XRCamera
Add some opaque geometry
Add some code to the root node:
Install the openxr loader plugin
ENABLE THE PLUGIN!!
Setup android export with the correct loader selected, OpenXR enabled and using gradlew build
Install android templates
Run project
Should give a nice black screen
Add a transparent object visible to the camera
Rendering works fine.
(Make it small, child it to the camera, and we have a workaround)
Minimal reproduction project
See instructions above.
The text was updated successfully, but these errors were encountered: