gfx-rs/wgpu

Lavapipe causes access violation accessing `intersection.world_to_object`

Closed this issue · 2 comments

Description
Since I got lavapipe installed I've been testing it with ray-tracing, and it seems that if a section of the intersection struct is accessed that needs a triangle to be hit (not done within the current examples) lavapipe dereferences a null pointer and crashes. I think this is actually our issue, as we gather these members without caring whether we have hit anything or not (this is technically undefined behavior). I think that the best way to deal with this is to emit a function for it for the three different blocks required. I am happy to do this.

Repro steps
add this line to any of the ray cube examples

color  = vec4f(intersection.world_to_object[0].x)

and run with lavapipe

Expected vs observed behavior
it should give an access violation

Platform
latest trunk wgpu w/ change

It would be great to have a (skipped on lavapipe) test for this

I'm already working on the fix for this, so I am planning to integrate a test.