canary-rs/renderers/wgpu/src/shader.wgsl

21 lines
426 B
WebGPU Shading Language
Raw Normal View History

2022-11-08 06:43:35 +00:00
struct VertexOutput {
@builtin(position) position: vec2<f32>,
@location(0) color: vec4<f32>,
};
@vertex
fn vs_main(
@location(0) position: vec2<f32>,
@location(1) color: vec4<f32>,
) -> VertexOutput {
var result: VertexOutput;
result.position = position;
result.color = color;
return result;
}
@fragment
fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> {
return vertex.color;
}