Allow depth to be attached to text using metadata

This commit is contained in:
grovesNL 2023-02-14 14:44:09 -03:30 committed by Josh Groves
parent 74e9aa37a1
commit c25f394c16
4 changed files with 45 additions and 8 deletions

View file

@ -5,10 +5,11 @@ struct VertexInput {
@location(2) uv: u32,
@location(3) color: u32,
@location(4) content_type: u32,
@location(5) depth: f32,
}
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@invariant @builtin(position) position: vec4<f32>,
@location(0) color: vec4<f32>,
@location(1) uv: vec2<f32>,
@location(2) content_type: u32,
@ -62,7 +63,7 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput {
vert_output.position = vec4<f32>(
2.0 * vec2<f32>(pos) / vec2<f32>(params.screen_resolution) - 1.0,
0.0,
in_vert.depth,
1.0,
);