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: Sampling Depth Texture on Forward Mobile with MSAA is corrupted #80991

Open
SeanH-CB opened this issue Aug 25, 2023 · 3 comments
Open

Comments

@SeanH-CB
Copy link

Godot version

4.1.1.stable

System information

Windows 10, Vulkan, NVidia GTX 1060 Driver Version 536.23

Issue description

On Forward Mobile having a Shader Material which samples the Depth Texture and having MSAA X2, X4, X8 enabled, causes the Depth Textures sampled data to be corrupted. Most likely its missing an MSAA Resolve before being bound.

Mobile:
Depth Readback Mobile

Forward+
Depth Readback Forward+

Steps to reproduce

  • New 3D Project
  • Set Renderer to Mobile
  • Set 3D Anti-Aliasing in project settings to MSAA X2
  • Create a MeshInstance3D
  • Create a Shader Material which samples the Depth Texture
  • See Depth Values are not what you'd expect

Minimal reproduction project

Depth Readback Repo.zip

@SeanH-CB
Copy link
Author

SeanH-CB commented Aug 25, 2023

#60255
Seems like its a similar issue which was closed off as not reproducible

@Calinou
Copy link
Member

Calinou commented Aug 25, 2023

@BastiaanOlij
Copy link
Contributor

This is because the subpass system only has resolve for color buffers implemented. So the depth buffer isn't resolved and thus the buffer you're reading from is never properly populated.

I have a fix for this: #78598

But it relies on an extension that hasn't got enough coverage. I'm still looking into a fallback approach that works

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

4 participants