mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-13 07:33:34 +00:00
adding nesting to debug logs
This commit is contained in:
44
runtime/Includes/Embedded/Shader2DVertex.nzsl
git.filemode.normal_file
44
runtime/Includes/Embedded/Shader2DVertex.nzsl
git.filemode.normal_file
@@ -0,0 +1,44 @@
|
||||
[nzsl_version("1.0")]
|
||||
module;
|
||||
|
||||
struct VertIn
|
||||
{
|
||||
[location(0)] pos: vec4[f32],
|
||||
[location(1)] uv: vec2[f32]
|
||||
}
|
||||
|
||||
struct VertOut
|
||||
{
|
||||
[location(0)] color: vec4[f32],
|
||||
[location(1)] uv: vec2[f32],
|
||||
[builtin(position)] pos: vec4[f32]
|
||||
}
|
||||
|
||||
struct ViewerData
|
||||
{
|
||||
projection_matrix: mat4[f32]
|
||||
}
|
||||
|
||||
struct SpriteData
|
||||
{
|
||||
color: vec4[f32],
|
||||
position: vec2[f32]
|
||||
}
|
||||
|
||||
external
|
||||
{
|
||||
[set(0), binding(0)] viewer_data: uniform[ViewerData],
|
||||
model: push_constant[SpriteData]
|
||||
}
|
||||
|
||||
[entry(vert)]
|
||||
fn main(input: VertIn) -> VertOut
|
||||
{
|
||||
let position: vec4[f32] = vec4[f32](input.pos.xy + model.position, 1.0, 1.0);
|
||||
input.uv *= -1.0;
|
||||
let output: VertOut;
|
||||
output.uv = input.uv;
|
||||
output.color = model.color;
|
||||
output.pos = viewer_data.projection_matrix * position;
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user