rendy icon indicating copy to clipboard operation
rendy copied to clipboard

missing depth_stencil on SimpleGraphicsPipelineDesc causes crashes

Open btrepp opened this issue 5 years ago • 4 comments

This took me awhile to figure out when copying the triangle example and working on it my own.

It seems if you omit

    fn depth_stencil(&self) -> Option<hal::pso::DepthStencilDesc> {
        None
    }

In the pipeline desc, you get a perplexing error

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`',

Which even with full stack traces is hard to track down.

This is with rendy 0.5.1 (note: had to tweak winit code, as the triangle example on release-0.5.1 doesn't seem to compile)

btrepp avatar Jun 25 '20 10:06 btrepp

You have an assertion failed for good reason. Removing this method override results in default one being called. As you can see default method implementation reports usage of depth buffer. Which means that you must provide one. But there is no depth-stencil attachment index in the subpass.

zakarumych avatar Jun 25 '20 11:06 zakarumych

Surely assertion should have a message that would explain this

zakarumych avatar Jun 25 '20 11:06 zakarumych

Yeah makes sense that somehow I'm missing something, good enough ergonomics would just be a nicer panic message. With that left/right assert, I struggle to even find where in the rendy source it's being thrown :).

btrepp avatar Jun 25 '20 11:06 btrepp

Yeap. I will leave this issue open to not forget improving this assert.

In any case you get exact file and line in the backtrace.

zakarumych avatar Jun 25 '20 13:06 zakarumych