Handle optional depth and stencil views of view depth and prepass depth texture#24725
Handle optional depth and stencil views of view depth and prepass depth texture#24725beicause wants to merge 5 commits into
Conversation
| pub use morph::*; | ||
| pub use skin::{extract_skins, prepare_skins, skins_use_uniform_buffers, SkinUniforms, MAX_JOINTS}; | ||
|
|
||
| pub const CORE_3D_SHADOW_MAP_FORMAT: wgpu_types::TextureFormat = |
There was a problem hiding this comment.
Just to make sure I understand this. Right now this is the same as the default depth format but this is done for when we eventually have configurable depth/stencil attachment so the shadow pass has it's own format?
There was a problem hiding this comment.
Yeah. I think there is no reason to use a dpeth format with stencil for shadow map
There was a problem hiding this comment.
Yep, agreed. I just wanted to make sure that was the intention for this new const.
kfc35
left a comment
There was a problem hiding this comment.
Just comments on whether it’s valuable to re-name in this PR, and some two other smaller things. Looks good to me though
| (None, Some(shadow_occlusion_culling)) => &shadow_occlusion_culling.depth_texture_view, | ||
| (None, None) => { | ||
| // No depth texture | ||
| continue; |
There was a problem hiding this comment.
This used to panic before if I understand correctly. Is this now an acceptable thing to just ignore? Should there be a warning just in case?
Objective
Related: #21358
Supersedes #22556
Solution
To support custom depth formats, we need to handle depth and stencil views depending on usage: only single aspect view can be used as resource binding in shaders, only full aspect view can be used as a render attachment.
Refactor
DepthAttachment,ViewDepthTextureandViewPrepassTextures::depthto handle optional depth and stencil views.This does not yet support custom depth formats. The depth formats needs to be added to pipeline key similar to how color texture formats are handled, as a followup (adopt #21493)
Testing
CI