Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

JusSn
Copy link
Contributor

@JusSn JusSn commented Feb 19, 2019

Follow-up to #206. I didn't see @Kangz suggestion that we just infer these until I'd already created the PR so 🤷‍♂️

Copy link
Contributor

@Kangz Kangz left a 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!

@kvark
Copy link
Contributor

kvark commented Feb 25, 2019

Vulkan story is fun: one of a list of formats has to support being a depth/stencil attachment:

VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT feature must be supported for at least one of VK_FORMAT_X8_D24_UNORM_PACK32 and VK_FORMAT_D32_SFLOAT, and must be supported for at least one of VK_FORMAT_D24_UNORM_S8_UINT and VK_FORMAT_D32_SFLOAT_S8_UINT.

This is quite annoying. It would be good to find out what the actual support is for the GPUs.

@magcius
Copy link

magcius commented Feb 25, 2019

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.

@kvark
Copy link
Contributor

kvark commented Feb 25, 2019

@magcius I see 32/8 (with optimal tiling) not being supported on a solid portion of devices. Given that S8 isn't available on D3D12, we end up with a situation where there is no format with stencil that is supported everywhere...

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

@JusSn
Copy link
Contributor Author

JusSn commented Mar 21, 2019

Metal story is more complicated than I thought. Depth16unorm and Depth24_stencil8 aren't available on iOS, only Mac. I'll update.

@kainino0x
Copy link
Contributor

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.

@kdashg kdashg merged commit e481c8e into gpuweb:master Mar 25, 2019
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants