Repository navigation
Conversation
This was referenced Nov 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Polyworld terrain, water, particles, and post-processing shaders exposed invalid Metal output for entry uniforms, array textures, promoted float values, matrix narrowing, and builtin stage values. This fixes those translations so the same Shady procedures compile for Metal while retaining existing GLSL and WebGL generation.
Uniform entry parameters now become native buffers or textures. Fragment position and depth use Metal attributes, integer varyings are flat, and vertex early returns populate the stage output before returning. Array sampling now emits native Metal sample/read calls directly, and floor-based modulo expands inline to its arithmetic expression. The shared shader header contains only the Metal include and namespace declaration; it no longer injects the five modulo/array helper functions. When arguments require evaluation, function-local temporaries capture them at the original expression site, preserving single evaluation, argument snapshots, short circuits, ternaries, and loop conditions. Matrix narrowing still emits its helper only when used. Texture buffers return their full texel, and inverse square root uses the native Metal operation. Metal lowers float64 values to float32 because MSL does not support doubles. Fragment coordinates remain native Metal coordinates so renderers can manage texture orientation explicitly.
Validation:
nim checkand Shady golden, backend, CPU, resource, parameter, and builtin regression tests pass.