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:
- 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.
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.