Skip to content

Commit bb5e4a5

Browse files
authored
fix(msl): vertex stage_in for struct args, metal::discard_fragment namespace (v0.14.4)
* test: add coverage tests for MSL/GLSL backends, IR validator - msl/expressions_test.go: MSL expression generation tests - msl/statements_test.go: MSL statement generation tests - msl/types_test.go: MSL type mapping, entry point tests - glsl/expressions_test.go: GLSL type/expression/statement tests - ir/validate_expression_test.go: comprehensive expression/type validation - Removed old validate_test.go (superseded by new comprehensive tests) * fix: remove incorrect gl_GlobalInvocationID assertion in GLSL compute test * fix(msl): vertex stage_in for struct args, metal::discard_fragment namespace - Remove fragment-only gate in writeEntryPointInputStruct, allowing vertex shaders with struct-typed inputs (e.g. fn vs_main(in: VertexInput)) to generate synthesized _Input struct with [[attribute(N)]] members - Use member binding-based attribute generation (locationInputAttribute, builtinInputAttribute) instead of hardcoded position/user attributes - Add metal:: namespace prefix to discard_fragment() call Fixes gogpu/ui#23 * fix: fallback attributes for unbound struct members, lint fixes - Add fallback attribute generation for struct members without explicit bindings (fragment: [[position]]/[[user(locnN)]], vertex: [[attribute(N)]]) - Fix revive lint: globalIdBinding → globalIDBinding - Add cyclop nolint for writeEntryPointInputStruct
1 parent 7b3f74d commit bb5e4a5

File tree

10 files changed

+5076
-390
lines changed

10 files changed

+5076
-390
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.14.4] - 2026-03-01
9+
10+
### Fixed
11+
12+
#### MSL Backend
13+
- **Vertex `[[stage_in]]` for struct-typed arguments** — vertex shaders with struct-typed inputs (e.g., `fn vs_main(in: VertexInput)`) now correctly generate a synthesized `_Input` struct with `[[attribute(N)]]` members and `[[stage_in]]` parameter; previously only fragment stage was handled, causing undefined `in_` reference ([gogpu/ui#23](https://github.com/gogpu/ui/issues/23))
14+
- **`metal::discard_fragment()` namespace**`discard_fragment()` now emits with required `metal::` namespace prefix; bare call was rejected by Metal shader compiler
15+
816
## [0.14.3] - 2026-02-25
917

1018
### Fixed

0 commit comments

Comments
 (0)