Harbor

branch main
showing the latest snapshot on main
varying_test.wgsl 933 B · Plain text
shader/tests/golden/varying_test.wgsl 0644 Raw
struct VertexInput {
	@location(0) position: vec3<f32>,
	@location(1) uv: vec2<f32>,
}

struct Interpolated {
	@builtin(position) position: vec4<f32>,
	@location(0) uv: vec2<f32>,
	@location(1) normal: vec3<f32>,
}

struct Interpolated {
	@location(0) uv: vec2<f32>,
	@location(1) normal: vec3<f32>,
}

struct FragmentOutput {
	@location(0) color: vec4<f32>,
}

struct Uniforms {
	mvp: mat4x4<f32>,
}

@group(0) @binding(0) var<uniform> uniforms: Uniforms;

@vertex
fn vs_main(input: VertexInput) -> Interpolated {
	var __luma_output: Interpolated;
	let clip_pos = (uniforms.mvp * vec4<f32>(input.position, 1.0));
	__luma_output.position = clip_pos;
	__luma_output.uv = input.uv;
	__luma_output.normal = vec3<f32>(0.0, 1.0, 0.0);
	return __luma_output;
}

@fragment
fn fs_main(input: Interpolated) -> FragmentOutput {
	var __luma_output: FragmentOutput;
	__luma_output.color = vec4<f32>(input.uv, 0.0, 1.0);
	return __luma_output;
}