editor: fold shaderexp into editor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
a3ec0fb7a9
commit
4c34a65020
14 changed files with 47 additions and 226 deletions
23
src/editor/vert.wgsl
Executable file
23
src/editor/vert.wgsl
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
struct VertexOut {
|
||||
@builtin(position) position_clip : vec4<f32>,
|
||||
@location(0) frag_uv : vec2<f32>,
|
||||
}
|
||||
|
||||
@vertex fn main(@builtin(vertex_index) index : u32) -> VertexOut {
|
||||
var pos = array<vec2<f32>, 3>(
|
||||
vec2<f32>(-1.0, -1.0),
|
||||
vec2<f32>( 3.0, -1.0),
|
||||
vec2<f32>(-1.0, 3.0),
|
||||
);
|
||||
|
||||
var uv = array<vec2<f32>, 3>(
|
||||
vec2<f32>(0.0, 0.0),
|
||||
vec2<f32>(2.0, 0.0),
|
||||
vec2<f32>(0.0, 2.0),
|
||||
);
|
||||
|
||||
var output : VertexOut;
|
||||
output.position_clip = vec4<f32>(pos[index], 0.0, 1.0);
|
||||
output.frag_uv = uv[index];
|
||||
return output;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue