29 lines
631 B
WebGPU Shading Language
29 lines
631 B
WebGPU Shading Language
struct VertexInput {
|
|
@location(0) position: vec2<f32>,
|
|
@location(1) uv: vec2<f32>,
|
|
}
|
|
|
|
struct VertexOutput {
|
|
@builtin(position) clip_position: vec4<f32>,
|
|
@location(0) uv: vec2<f32>,
|
|
}
|
|
|
|
@group(0) @binding(0)
|
|
var t_texture: texture_2d<f32>;
|
|
|
|
@group(0) @binding(1)
|
|
var t_sampler: sampler;
|
|
|
|
@vertex
|
|
fn vs_main(input: VertexInput) -> VertexOutput {
|
|
var output: VertexOutput;
|
|
output.clip_position = vec4<f32>(input.position, 0.0, 1.0);
|
|
output.uv = input.uv;
|
|
return output;
|
|
}
|
|
|
|
@fragment
|
|
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
|
|
return textureSample(t_texture, t_sampler, input.uv);
|
|
}
|