Skip to content

feat(shader): add Shader support - #1288

Merged
Kyle-Ye merged 7 commits into
mainfrom
feature/shader
Dec 5, 2026
Merged

Kyle-Ye merged 7 commits into
mainfrom
feature/shader

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Shader, ShaderLibrary, and ShaderFunction with argument binding and asynchronous compilation.
  • Add color, distortion, and layer-effect modifiers and the GraphicsContext.Shading.shader factory.
  • Integrate shader paints with decoding and argument animation.
  • Use the shared shader fill and filter flags from OpenRenderBox Shims.

Close #1223.

Dependency

Decode Shader.ResolvedShader in CodableResolvedPaint, add
GraphicsContext.Shading.shader(_:bounds:), and animate shader arguments
through _ShapeStyle_Pack.Fill.AnimatableData.
Update DarwinPrivateFrameworks and OpenRenderBox to the device API changes.
Keep Shader.compile(as:) available on targets without Dispatch.
Update the RenderBox dependencies and use their shared fill and filter
options in shader resolution and tests.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T04:46:15.642737Z 3ad087c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability. labels Nov 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6dc6b45b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +869 to +870
case (1, let .float4(x, y, z, w)), (5, let .float4(x, y, z, w)):
shader.setArgument((x, y, z, w), at: index, type: argument.type, flags: argument.flags)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match argument type 4 when updating float4 animation values

When a shader's .float4(...) argument is animated, it is bound with RenderBox type 4 and extracted as a .float4 animation element, but this branch matches types 1 and 5 instead. Consequently, updating(rbShader:) falls through without writing the interpolated value, leaving float4 uniforms unchanged during animations of shader fills and effects. Match type 4 rather than 1 here so the animated components reach the copied shader.

Useful? React with 👍 / 👎.

@Kyle-Ye Kyle-Ye added this to the 0.27.0 milestone Nov 29, 2026
@tuist

tuist Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 24df84869

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 44.1s 24df84869

Reported by Tuist, faster builds and reliable tests for Xcode, Gradle, Bazel, and more.

@codecov

codecov Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.11111% with 158 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.80%. Comparing base (96bd2aa) to head (3ad087c).

Files with missing lines Patch % Lines
...ources/OpenSwiftUICore/Graphic/Shader/Shader.swift 55.95% 148 Missing ⚠️
...rces/OpenSwiftUICore/Graphic/GraphicsContext.swift 0.00% 5 Missing ⚠️
...nSwiftUICore/Shape/ShapeStyle/ShapeStylePack.swift 82.35% 3 Missing ⚠️
Sources/OpenSwiftUICore/Graphic/Color/Paint.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1288      +/-   ##
==========================================
+ Coverage   34.65%   34.80%   +0.14%     
==========================================
  Files        1081     1081              
  Lines       87398    87749     +351     
==========================================
+ Hits        30290    30537     +247     
- Misses      57108    57212     +104     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 381e239 into main Dec 5, 2026
7 of 8 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/shader branch December 5, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Shader support

1 participant