test: Add snapshot test for GLSL interpolation spec

This commit is contained in:
Andy Leiserson committed 2026-04-17 11:50:51 -07:00
1 parent 878bb1c56a
commit 75ed5df337
2 files changed
+33

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
#version 450
layout(location = 0) in vec2 tex_coord;
layout(location = 1) in int index;
layout(location = 0) out vec4 o_color;
void main() {
o_color = vec4(tex_coord, 0.0, float(index));
}
@@ -0,0 +1,23 @@
struct FragmentOutput {
@location(0) o_color: vec4<f32>,
}
var<private> tex_coord_1: vec2<f32>;
var<private> index_1: i32;
var<private> o_color: vec4<f32>;
fn main_1() {
let _e3 = tex_coord_1;
let _e5 = index_1;
o_color = vec4<f32>(_e3.x, _e3.y, 0f, f32(_e5));
return;
}
@fragment
fn main(@location(0) tex_coord: vec2<f32>, @location(1) @interpolate(flat) index: i32) -> FragmentOutput {
tex_coord_1 = tex_coord;
index_1 = index;
main_1();
let _e5 = o_color;
return FragmentOutput(_e5);
}