Repository navigation
feat(embed): attach custom Compositor to LayerHost and use iOS adapter limits - #48
Merged
Merged
Conversation
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.
Embedded
CAMetalLayerhosts can now attach a customCompositorfor effect-slot shaders and initialize cleanly on iOS Metal adapters.LayerHostwithout a compositor and all desktop GPU limits remain unchanged.❌ Before
LayerHost::framealways ran the plainRenderer::drawpath withrt.track_marks == false, so embeddedCAMetalLayerviews could not runCompositor<S>passes onEl::effectslots.Gpu::try_forrequestedwgpu::Limits::default()(max_inter_stage_shader_variables = 16) unconditionally, failing device creation on iOS Metal adapters where the ceiling is15.✅ After
LayerHost::with_compositorenablesrt.track_marks, hands acompose::FrametoCompositor::render, and includesCompositor::animating()inEmbedFrame::animating.target_os = "ios",Gpu::try_forbasesrequired_limitsonadapter.limits()(Rune's uber shader uses 9 inter-stage locations).📊 Proof
El::effect(mark)+CompositorinsideLayerHostmarksuntracked)marksGpu::try_newon iOS / iOS Simulator Metalmax_inter_stage_shader_variables16 > 15adapter.limits()New test
embed::tests::layer_host_runs_compositor_with_tracked_marksfails without the change; 1 new test + iOS target checks pass.👀 Read:
crates/rune/src/embed.rs(LayerHost::with_compositorand the compositor branch inLayerHost::frame). The rest is routine.🔍 Built while spiking an embedded iOS Metal host with custom WGSL effect-slot shaders
Checks run
cargo test -p rune embed::tests: passcargo check -p rune --no-default-features --features embedded-fonts --target aarch64-apple-ios-sim: passcargo check -p rune-kit --no-default-features --target aarch64-apple-ios-sim: pass