Resolve depth buffer on mobile if depth override is used#111322
Resolve depth buffer on mobile if depth override is used#111322BastiaanOlij wants to merge 1 commit intogodotengine:masterfrom
Conversation
|
@dsnopek I haven't tested this yet but as a completion of the fallback logic, you may want to test this yourself as well :) |
7586ecf to
13c3dd5
Compare
|
Ok, looks like I hit a snag with this. Because of the way we're creating our depth buffer in the OpenXR module, we can't write into it with the resolve shader. It's the wrong format, and has the wrong attachment type. I'm looking into verifying those findings but it leaves us with a problem because we have no knowledge or access to the viewport with which we're about to render our XR content, and on which we can detect that MSAA is applicable and we need to change the format. |
|
After a bunch of testing I was able to validate what I thought. I've hardcoded the changes to make it work, this is not a solution but: In And in (this code should really switch on the But as I mentioned in my previous message, we don't have access to the MSAA configuration of the viewport here. |
|
@clayjohn if you have any suggestions on the above, whether we can somehow combine these... |
Small addition to #108636, we need to resolve to overridden depth buffer when depth buffer override is used as we're likely using the overridden depth buffer content elsewhere.
For OpenXR this scenario applies when we're submitting the depth buffer to OpenXR for reprojection.
With resolving to depth buffer, we don't need to resolve again when copying to back buffer or we'd be doubling up.
Note
On mobile hardware such as Quest, this is a very costly way of resolving as we're writing MSAA depth data to the MSAA texture and reading it back in. I still plan on reviving #78598. However for platforms not supporting the needed Vulkan extension, this completes our fallback scenario.