Skip to content

Magma shader support#22

Merged
HailToDodongo merged 34 commits into
HailToDodongo:mainfrom
snacchus:magma
Jun 7, 2026
Merged

Magma shader support#22
HailToDodongo merged 34 commits into
HailToDodongo:mainfrom
snacchus:magma

Conversation

@snacchus

@snacchus snacchus commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for writing magma vertex shaders. This is gated behind the new cli flag --magma.
When in "magma mode", the following new syntax is available:

  • uniform: For declaring uniforms.
  • attribute: For declaring attributes.
  • shader: A special kind of function which must be specified exactly once.

These annotations have been added to be used in conjunction with attributes:

  • AtrrLoader: Marks instruction as "attribute loaders".
  • AttrPatch: Marks instructions to be patched when optional attributes are omitted.

Additionally, this PR contains the following changes:

  • Various corrections and improvements for vector multiplication assembly.
  • Preprocessor: Support for #define without a value.
  • Annotations now work correctly on declaration-assignments.
  • Added the coverage report generated by Jest to .gitignore
  • Added -o cli parameter to set the output file name.

snacchus and others added 30 commits January 29, 2025 19:17
Also fix temp register not being used in some places.
Becauase declaration-assignments are split during normalization,
annotations were only applied to the declaration part, but not the
assignment. To fix this, annotations are now duplicated before the
assignment as well.
@snacchus snacchus marked this pull request as ready for review June 7, 2026 10:43
@HailToDodongo HailToDodongo merged commit 3b08e8c into HailToDodongo:main Jun 7, 2026
1 check passed
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.

2 participants