I have a minimal rust shader that just renders a triangle to the screen that I am compiling with an old wrapper around rust-gpu.
I am trying to compile the same shader with cargo gpu as:
cargo gpu build
🦀 Running `spirv-builder-cli` to compile shader at /home/makogan/rust_never_engine/examples/01_spinning_triangle/spinning_triangle_shader...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `force_overwrite_lockfiles_v4_to_v3`", line: 31, column: 3)', src/main.rs:82:62
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2025-03-15T17:36:26Z ERROR cargo_gpu] build failed
Error: build failed
I am within the crate folder when Invoke the command.
I am not entirely sure what the problem actually is. I know the crate has to be correct because it compiles with my custom wrapper.
the shader:
//! Ported to Rust from <https://github.com/Tw1ddle/Sky-Shader/blob/master/src/shaders/glsl/sky.fragment>
#![cfg_attr(target_arch = "spirv", no_std, feature(lang_items))]
#![allow(internal_features)]
extern crate bytemuck;
extern crate spirv_std;
pub use spirv_std::glam::{Mat2, Vec2, Vec3, Vec4};
use spirv_std::spirv;
#[spirv(fragment)]
pub fn main_fs(color: Vec4, output: &mut Vec4)
{
*output = Vec4::new(color.x, color.y, color.z, 1.0); //
}
#[spirv(vertex)]
pub fn main_vs(
#[spirv(uniform, descriptor_set = 1, binding = 0)] transform: &Mat2,
position_bind0: Vec2,
color_bind0: Vec3,
#[spirv(position, invariant)] out_pos: &mut Vec4,
out_color: &mut Vec4,
)
{
let res: Vec2 = *transform * position_bind0;
*out_pos = Vec4::new(res.x, res.y, 0., 1.);
*out_color = Vec4::new(color_bind0.x, color_bind0.y, color_bind0.z, 1.0);
}
The cargo.toml:
[package]
name = "spinning-triangle-shader"
version = "0.0.0"
publish = false
[lib]
crate-type = ["lib", "dylib"]
[dependencies]
spirv-std = "0.9.0"
bytemuck = { version = "1.20.0", features = ["derive"] }
I have a minimal rust shader that just renders a triangle to the screen that I am compiling with an old wrapper around rust-gpu.
I am trying to compile the same shader with cargo gpu as:
I am within the crate folder when Invoke the command.
I am not entirely sure what the problem actually is. I know the crate has to be correct because it compiles with my custom wrapper.
the shader:
The cargo.toml: