Fragment shader can be silently compiled out
Open
Nobody has claimed this yet.
bug
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
This works fine:
#[spirv(fragment)]
pub fn main_fs(
in_color: Vec3,
out_frag_color: &mut Vec4,
) {
*out_frag_color = vec4(in_color.x, in_color.y, in_color.z, 1.0);
}
This silently does not output a fragment shader:
#[spirv(fragment)]
pub fn main_fs(
in_color: Vec3,
out_frag_color: &mut Vec4,
) {
out_frag_color.x = in_color.x;
out_frag_color.y = in_color.y;
out_frag_color.z = in_color.z;
}
Rather than failing silently, it should probably be an error when an entire shader is dead code / compiled out and does not produce an artifact.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the two Rust fragment-shader examples from the issue and compare their outputs. Trace the compiler path for a shader that produces no artifact, then determine where an error should be reported. Done means the second example fails explicitly instead of being silently compiled out, while the first continues to produce a fragment shader.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100