A GameCube/Wii emulator and debugger written in Rust.
struct Uniforms {
color: vec4<f32>,
depth: f32,
};
@group(0) @binding(0)
var<uniform> u: Uniforms;
struct VsOut {
@builtin(position) position: vec4<f32>,
};
@vertex
fn vs_main(@builtin(vertex_index) vi: u32) -> VsOut {
let uv = vec2<f32>(f32((vi << 1u) & 2u), f32(vi & 2u));
var out: VsOut;
out.position = vec4<f32>(uv * 2.0 - 1.0, 0.0, 1.0);
return out;
}
struct FsOut {
@location(0) color: vec4<f32>,
@builtin(frag_depth) depth: f32,
};
@fragment
fn fs_main() -> FsOut {
var out: FsOut;
out.color = u.color;
out.depth = u.depth;
return out;
}