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:
parent
0859f675c3
commit
36ada9dd4e
@ -15,7 +15,9 @@ struct VertexOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct FragmentOutput {
|
struct FragmentOutput {
|
||||||
|
#ifdef GIZMO_LINES_3D
|
||||||
@builtin(frag_depth) depth: f32,
|
@builtin(frag_depth) depth: f32,
|
||||||
|
#endif
|
||||||
@location(0) color: vec4<f32>,
|
@location(0) color: vec4<f32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,10 +35,12 @@ fn vertex(in: VertexInput) -> VertexOutput {
|
|||||||
fn fragment(in: VertexOutput) -> FragmentOutput {
|
fn fragment(in: VertexOutput) -> FragmentOutput {
|
||||||
var out: FragmentOutput;
|
var out: FragmentOutput;
|
||||||
|
|
||||||
|
#ifdef GIZMO_LINES_3D
|
||||||
#ifdef DEPTH_TEST
|
#ifdef DEPTH_TEST
|
||||||
out.depth = in.pos.z;
|
out.depth = in.pos.z;
|
||||||
#else
|
#else
|
||||||
out.depth = 1.0;
|
out.depth = 1.0;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
out.color = in.color;
|
out.color = in.color;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user