-
Notifications
You must be signed in to change notification settings - Fork 335
Add depth/stencil GPUTextureFormats #211
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending an investigation of which texture format and capabilities are supported on all platforms. Thanks!
Vulkan story is fun: one of a list of formats has to support being a depth/stencil attachment:
This is quite annoying. It would be good to find out what the actual support is for the GPUs. |
AFAIUI, combined depth/stencil formats are basically an API-level lie, and no hardware actually combines them, resulting what might seem like a bizarre format, 32/8. I imagine almost all hardware will be able to support that. http://vulkan.gpuinfo.org/listformats.php suggests that 32/8 is supported by 99% of reported Vulkan implementations, and 24/8 is supported by 75% of them. |
@magcius I see 32/8 (with optimal tiling) not being supported on a solid portion of devices. Given that From the user perspective, in this day and age, I believe D32F_S8 is critical to have: a typical high-performance 3D application would want to use D32F for the reverse-Z depth and S8 for masking out things. Thinking of what we can do to support it on platforms that don't have it natively... these are all Android devices, so we only need Vulkan backend to support this path. This is a good thing, since on Vulkan we can have different surfaces for depth and stencil attachments, so we could manage stencil as a separate texture, internally, as long as the user never needs to sample from both of them (as different channels of a texture view). |
Metal story is more complicated than I thought. Depth16unorm and Depth24_stencil8 aren't available on iOS, only Mac. I'll update. |
Huh, there are only 32-bit depth formats on iOS? (I think you're right based on the tables.) That seems like a waste of bandwidth - AFAIK lots of apps don't need that much precision. |
Follow-up to #206. I didn't see @Kangz suggestion that we just infer these until I'd already created the PR so 🤷♂️