Fix segfault with 2d gizmos (#8223)

# Objective

- Don't segfault with gizmos in 2d
- Fixes #8144, Fixes #8211 

## Solution

- Don't use depth in 2d
This commit is contained in:
François 2023-03-29 20:05:03 +02:00 committed by GitHub
parent 0859f675c3
commit 36ada9dd4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,9 @@ struct VertexOutput {
}
struct FragmentOutput {
#ifdef GIZMO_LINES_3D
@builtin(frag_depth) depth: f32,
#endif
@location(0) color: vec4<f32>,
}
@ -33,10 +35,12 @@ fn vertex(in: VertexInput) -> VertexOutput {
fn fragment(in: VertexOutput) -> FragmentOutput {
var out: FragmentOutput;
#ifdef GIZMO_LINES_3D
#ifdef DEPTH_TEST
out.depth = in.pos.z;
#else
out.depth = 1.0;
#endif
#endif
out.color = in.color;