#Bevy 0.16 - Crashes due to the Depth Buffer

1 messages Β· Page 1 of 1 (latest)

torpid notch
#

More trouble in polder town!

Within POLDERS, I've disabled the depth buffer for some time now. After the 0.12 -> 0.16 migration, I haven't been able to get it to work again. I'm unsure if there is a particular custom shader which leads to trouble, or some other setting complicating matters.

After enabling the depth prepass in the camera, I get a:

wgpu error: Validation Error

Caused by:
  In RenderPass::end
    In a draw command, kind: Draw
      The BindGroupLayout with 'mesh_view_layout_multisampled_depth' label of current set BindGroup with 'mesh_view_bind_group' label at index 0 is not compatible with the corresponding BindGroupLayout with 'mesh_view_layout' label of RenderPipeline with 'opaque_mesh_pipeline' label
        Assigned entry with binding 28 not found in expected bind group layout

Some AI told me the following, but not sure if that is actually true

        // NOTE: Bevy 0.16 has a compatibility issue where MSAA + DepthPrepass causes
        // bind group layout mismatches (mesh_view_layout_multisampled_depth vs mesh_view_layout).
        // When depth prepass is enabled with MSAA, Bevy creates view bind groups with the
        // multisampled_depth layout, but main pass pipelines expect the regular layout.
        // Disable MSAA when depth prepass is enabled to work around this.
        // FXAA is enabled below as an alternative anti-aliasing method.
        #[cfg(feature = "depth_prepass")

Afterwards I get this:

Caused by:
  In Device::create_render_pipeline, label = 'prepass_pipeline'
    Error matching ShaderStages(VERTEX) shader requirements against the pipeline
      Location[1] Float32x2 interpolated as Some(Perspective) with sampling Some(Center) is not provided by the previous stage outputs
        Input type is not compatible with the provided Float32

Anyone who worked on the prepass pipeline knows what this could be about? I want my water foamlines back πŸ˜…

#

Bevy 0.16 - Crashes due to the Depth Buffer

#

@soft dock Hi man! Can I bother you about this?

soft dock
#

Input type is not compatible with the provided Float32
This seems to be a render target issue perhaps?

#

it kinda looks like in your vertex shader somewhere you have something sampling depth

#

and that format changed?

soft dock
#

@torpid notch ^

torpid notch
#

thanks for taking a look man!

torpid notch
soft dock
#

its failing in prepass which is weird though

torpid notch
#

hmmm lets see ...

#

@sullen silo hey man! πŸ˜… any words of wisdom? πŸ˜›

ripe granite
torpid notch
#
Yeah, changing the vertex layout in specialize is most likely the issue.

There's a few solution

    Only modify the vertex layout when the prepass is not enabled. You can do it by checking if the vertex shader defs contains the depth or normal prepass shader def.
    Alternatively, you'll need to define a custom vertex prepass that matches your custom vertex prepass. I think you can even reuse the same shader file.

The reason this happens even if you don't actually use the prepass is because the shadows reuse the depth prepass shaders.
#

I do need these vertex layouts. So I guess I should define a custom vertex prepass

#

Can I also just ignore a material in the prepass? like don't do anything with it? Just for debugging purposes, it would be nice

sullen silo
#

Sorry, I haven't had time to look at this yet, but yeah, in general, if you are using a custom vertex layout you'll also need a custom prepass shader that uses that vertex layout. The prepass should be pretty easy to write though because it just needs to output depth

torpid notch
#

this is promising though, I'm cutting a new build of POLDERS first, but afterwards, Ill take the christmas times to deep dive this depth buffer business once and for all πŸ™‚

torpid notch
#

I indeed had to write a whole bunch of custom vertex prepasses. Had some trouble debugging which exactly I needed to update, but with some cursor prompting and some work of my own, the depth buffer is back in business

#

thanks for the pointers, @sullen silo !

sullen silo
#

Nice! So much cool stuff happening in the bevy community over the holiday break!

ripe granite
torpid notch
#

cooking anything?

sullen silo
# torpid notch how are your projects going?

On my side, I wrote exactly 0 lines of rust during the holiday πŸ˜…. But aevyrie posted a ton of really cool rendering PRs and there were also other bevy contributors that took the opportunity to make cool PRs.

torpid notch
#

god knows you deserve it πŸ˜›

#

fun rendering PR's?

#

I'm almost scared, I'm barely keeping up with the rendering pipeline as it is πŸ˜…

#

hitting a ton of not enough memory left's

sullen silo
torpid notch
#

but that does mean both snowboarding & family celebrations

sullen silo
torpid notch
#

not bad things no?

sullen silo
torpid notch
#

hehe yeah I understand πŸ™‚

#

no worries man ull find some time eventually

sullen silo
#

And some of aev's PR should be essentially free performance

torpid notch
#

that's sick

#

still, I think I need to be stuck on 0.16