qt-tracing/src/render/simple.wgsl
2025-11-23 13:29:24 +03:00

28 lines
481 B
WebGPU Shading Language

struct LookParams {
m: mat4x4f,
}
struct Vertex {
@location(0) pos: vec3f,
@location(1) color: vec3f,
}
struct Varying {
@builtin(position) screen: vec4f,
@location(0) color: vec4f,
}
@group(0) @binding(0) var<uniform> look: LookParams;
@vertex
fn on_vertex(in: Vertex) -> Varying {
let pos = look.m * vec4f(in.pos, 1.0);
let color = vec4f(in.color, 1.0);
return Varying(pos, color);
}
@fragment
fn on_fragment(in: Varying) -> @location(0) vec4f {
return in.color;
}