Experimental depth read support#591
Conversation
|
Hi. This is required to create a render pass with a cubemap depth buffer attachment With this change you still need to attach a dummy RGB texture even if you don't use it in the shader. Do you have any plans on fixing that ? I tried but I think it's a bit too complicated for me. |
|
Some updates... I was hoping to allow depth texture access in shaders with #834 but ran into various problems in the other 3D backends (specifically D3D11 - do you know if using the TYPELESS pixel formats has any downsides? I've seen that exact same D3D11 validation layer message, but that looks suspiciously simple as a solution lol). I'll make another attempt after finalizing the WebGPIU backend. Rendering without color attachments is also on the list to fix (this will be easier I think). Basically: first finalize the WebGPU backend, then re-evaluate if the following things can be implemented, either across all backends, or behind a per-backend runtime feature flag:
|
This PR contains experimental support for reading the depth buffer from shaders, see: #576
What works:
What doesn't work:
At this point we are a bit stuck mainly at the Metal implementation. In our testing environment we don't get any errors of any kind when attempting to read the depth buffer, just a black screen. (Our testing environment could be bad, and we readily admit that we are fairly new to Metal compared to other GFX API's) We suspect that it might be related to the difference between
depth2dandtexture2dtypes in MSL shaders.Our time on this has unfortunately run out a bit, and it will take a while until we have more time to look at it. If anyone wants to take a look at and fix issues with this PR it would be greatly appreciated. :)