#![cfg_attr(target_arch = "spirv", no_std)]
use spirv_std::glam::Vec4;
use spirv_std::glam::vec2;
use spirv_std::glam::vec4;
use spirv_std::spirv;

#[spirv(fragment)]
pub fn main_fs(output: &mut Vec4)
{
    *output = vec4(0.2, 1.0, 0.2, 1.0);
}

#[spirv(vertex)]
pub fn main_vs(#[spirv(vertex_id)] in_id: &mut u32, #[spirv(position)] out_pos: &mut Vec4)
{
    let positions = [vec2(-1., 3.), vec2(-1., 1.), vec2(3., 1.)];
    *out_pos = Vec4::new(
        positions[*in_id as usize].x,
        positions[*in_id as usize].y,
        0.,
        1.,
    );
}
