feat(watchos): wire SCNTechnique post-fx via keyed-subscript uniforms (#16, #18)#49
Open
proggeramlug wants to merge 1 commit intomainfrom
Open
feat(watchos): wire SCNTechnique post-fx via keyed-subscript uniforms (#16, #18)#49proggeramlug wants to merge 1 commit intomainfrom
proggeramlug wants to merge 1 commit intomainfrom
Conversation
…#16, #18) The previous BloomPostFXTechnique was a no-op based on the (wrong) conclusion that watchOS had no path to push per-frame uniforms into a SCNTechnique. The handleBindingOfSymbol:usingBlock: route is genuinely unreachable — SCNRenderer isn't in the watchOS SDK — but the keyed-subscript path on the technique itself doesn't need SCNRenderer. SceneKit translates `technique[symbol] = NSData(bytes:length:)` into the matching `[[buffer(N)]]` slot when the symbol is declared with a `type` in the technique dictionary; this is the documented Metal uniform-binding API and works on every Apple platform that ships SCNTechnique, watchOS included. Build the technique once with three vec4 symbols (params0/1/2 → buffer(0/1/2) in declaration order, matching bloom_postfx.metal) and push the chromatic-aberration / film-grain / sun-shafts strengths each frame from the existing PostFx state poll. Sun position defaults to top-center; bloom_set_sun_shafts has no positional argument so this matches the implicit "above the viewport" behavior the issue calls out. Updates the surrounding architecture comments and the postfx.rs docstring, both of which still claimed Metal post-fx was deferred. Needs simulator/device verification — the Rust check passes but the Swift compile happens through Perry's toolchain.
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.
Summary
The previous `BloomPostFXTechnique` was a no-op based on the conclusion that watchOS had no path to push per-frame uniforms into an `SCNTechnique`. `handleBindingOfSymbol:usingBlock:` is genuinely unreachable (SCNRenderer isn't in the watchOS SDK), but the keyed-subscript path on the technique itself doesn't need SCNRenderer. SceneKit translates `technique[symbol] = NSData(bytes:length:)` into the matching `[[buffer(N)]]` slot whenever the symbol is declared with a `type` in the technique dictionary — this is the documented Metal uniform-binding API and works wherever SCNTechnique ships, watchOS included.
This PR:
Closes #16, closes #18.
Test plan