Skip to content

fix(postfx): drop duplicate VertexOutput in outline_shader (#48)#52

Merged
proggeramlug merged 1 commit intomainfrom
fix/outline-shader-redef
May 1, 2026
Merged

fix(postfx): drop duplicate VertexOutput in outline_shader (#48)#52
proggeramlug merged 1 commit intomainfrom
fix/outline-shader-redef

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #51. After that PR landed, @adevart re-tested and the bind-group validation error in `test-gltf-watch` was replaced by a shader compile error:

```
Shader 'outline_shader' parsing error: redefinition of `VertexOutput`
```

Both `FULLSCREEN_VERT` and `OUTLINE_FRAG` declared `struct VertexOutput`, which becomes a redefinition once `format!("{}\n{}", ...)` concatenates them in `PostFxPipeline::new`. This was a latent bug — naga was previously masking it behind the earlier bind-group filterable validation error that #51 fixed. Now that the bind-group error is gone, the shader-parse error surfaces and breaks the entire post-FX pipeline init on every example, which is why `sponza` started crashing on load and several others regressed.

Fix: remove the duplicate from `OUTLINE_FRAG`. The fragment shader picks up `VertexOutput` from the concatenated vertex shader prefix.

Test plan

  • `cargo check` (`native/macos`)
  • Validated the concatenated WGSL source with `naga 29.0.0` CLI — "Validation successful"
  • Re-run `examples/test-gltf-watch` on macOS to confirm the redefinition error is gone and outlines render
  • Re-run `examples/sponza` on macOS to confirm it no longer crashes on load (previously regressed by the shader compile failure)

FULLSCREEN_VERT and OUTLINE_FRAG both declared `struct VertexOutput`,
which becomes a redefinition once `format!("{}\n{}", ...)` concatenates
them. Naga used to mask this behind the earlier bind-group filterable
validation error; now that #51 fixed that, the shader-parse error
surfaces and breaks the entire post-FX pipeline init on every example.

Validated by parsing the concatenated source with naga 29.0.0 — passes.
@proggeramlug proggeramlug merged commit 2170437 into main May 1, 2026
8 checks passed
@proggeramlug proggeramlug deleted the fix/outline-shader-redef branch May 1, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant