2639 Commits

Author SHA1 Message Date
JoshJRive
5749982961 fix(Vulkan): Various Android Vulkan fixes (#10927) a7d233d7c1
Device fixes:
- Break the MSAA resolve off into a separate render subpass to resolve corruption on some Adreno devices
- Work around an issue where some early Mali drivers report Vulkan 1.1 support but are missing the allocation functions that vma is looking for
- Some of those Mali devices spew incorrect validation errors about the inability to create, say, an RGB8 texture because the maximum mipmap count is 0 (and other similar "oops we queried and got 0" errors) even though the images actually create fine. Added them to an ignore list.
- The MSAA color and depth/stencil textures are now being created with the TRANSIENT bit (this doesn't fix any known device issues but it does seem more correct)

Other improvements:
- vk_check now displays a string representation of the vulkan error instead of just its numeric value
- the abort handler on Android now also prints the stack trace (to make debugging easier)
- fiddle_context_vulkan now requests the correct width and height for image capture
- The queueImageCopy function in swapchain was not properly setting the pixel read bounds to the whole swapchain if passed an empty AABB

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-30 02:17:02 +00:00
luigi-rosso
bd60875016 feat: missing Mat2D.invert to use existing Mat2D ref (#10935) a406176fa6
* feat: missing Mat2D.invert to use existing Mat2D ref

* feature: add bounds

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-29 22:22:05 +00:00
luigi-rosso
bb53d90d1b minor scripting dogfood fixes (mat2d setters & artboard input) (#10934) a15901421d
chore: add missed setters and fix artboard inputs

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-29 19:36:59 +00:00
csmartdalton
f40c37e1ba feat(vk): Use the PLS transient backing resource in Vulkan (#10905) 4e366e3ddb
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-28 19:40:31 +00:00
luigi-rosso
8127c1abfa feature: adding scripted pointer events (#10915) 3ebf132c40
* feature: adding scripted pointer events

* chore: adding pointer event test

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-28 18:24:11 +00:00
luigi-rosso
1977346174 feature: expose width/height setter/getter for scripted artboards (#10917) d01497d380
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-28 17:22:19 +00:00
bodymovin
8181e5d9d4 feature(scripting): add data value color support for scripted converters (#10909) dfa19bdfbb
Co-authored-by: hernan <hernan@rive.app>
2025-10-28 17:03:43 +00:00
luigi-rosso
4559949f5d feature: expose time functions (#10916) 6b70e37991
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-28 02:59:09 +00:00
luigi-rosso
256cb44fb7 rev to rive_luau_18 (#10901) c1e0f7b595
* rev to rive_luau_18

* fix: for change in luau

* fix: default old solver

* adding back missing files

* fix: test

* update .riv files

* chore: updated to luau 0.697

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-10-24 22:07:27 +00:00
csmartdalton
e87c811c38 feat: Initial implementation of a clockwise rendering mode (#10897) 2fb75868b5
Add a new InterlockMode that overwrites all fill rules as clockwise and
implements the clockwise path rendering algorithm using raster ordered
PLS. The only backend to support this so far is GL with shader images,
but more will come.

Notably, when there is no advanced blend, we can set
"fixedFunctionColorOutput" and render directly to the target
framebuffer.

Performance so far looks promising, especially on Intel, but more
in-depth perf optimizations arebyet to come.

This is implemented as its own InterlockMode only to give it soak time.
Once this rendering mode is stable, we can merge it back into
"rasterOrdering" and just select draw shaders based on fill rule.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-24 17:42:24 +00:00
bodymovin
e404932991 chore: add support for zero width spaces as word breakers (#10899) c804e738de
chore: add support for zero width spaces as work breakers

Co-authored-by: hernan <hernan@rive.app>
2025-10-23 23:15:28 +00:00
bodymovin
094ae0c127 fix: set dataContext to nullptr when unbinding (#10898) 684c603b1a
Co-authored-by: hernan <hernan@rive.app>
2025-10-23 22:56:49 +00:00
JoshJRive
48949bb500 fix(vulkan): Fix image/gradient rendering on some Android devices (#10894) d8e7fbdb7b
On some Adreno models, gradients were not properly rendering properly, due to the texture/gradient coordinates always being 0

This was caused by what appears to be a driver bug, in which doing vkUpdateDescriptorSets with multiple descriptors (in our case, updating paintData and paintAuxData in a single call) would fail to properly commit the data from the second one. We're only doing this in the one place. Separating this into two calls causes gradients and images to now display as expected.

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-23 20:22:51 +00:00
csmartdalton
ef4b918e8e chore(vk): Remove a redundant interlock mode from the draw pipeline key (#10887) 979c4feb82
The shader key and render pass key were both including the interlock
mode, and the pipeline key was so full that adding a new interlock mode
would overflow it. Only include the interlock mode once.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-23 19:51:28 +00:00
aliasbinman
c6b6e8bfcf Add fire events to player (#10758) 15693e8ff1
* Add code to player

* Update player.cpp

* Update player.cpp

* Update player.cpp

* Clang format

* Update player.cpp

Co-authored-by: John White <aliasbinman@gmail.com>
2025-10-23 18:01:57 +00:00
bodymovin
c0685ac985 fix: when the artboard is checking for ancestors it should return its… (#10883) d5b8889321
fix: when the artboard is checking for ancestors it should return itself as source when it is not the instance

Co-authored-by: hernan <hernan@rive.app>
2025-10-23 16:02:06 +00:00
aliasbinman
cd1318bd92 Add gamma texture test (#10856) e9b6d8a64e
* Add gamma texture test

* add texture gm

* Create gamma_texture.png

* Create gamma_texture.png

* Create gamma_texture.png

Co-authored-by: John White <aliasbinman@gmail.com>
2025-10-22 22:31:42 +00:00
ErikUggeldahl
9de0e5a497 feat(Android): Multitouch and pointer exit support (#10848) 9bcc4a6d11
Adds multitouch and pointer exit support.

Also bumps the compile and target SDK to 36, adding `core-ktx` dependency for one method.

Co-authored-by: Erik <erik@rive.app>
2025-10-22 21:14:00 +00:00
csmartdalton
0d561aad6f fix(gl): Fix a PLS regression on Oppo & Vivo (#10861) 33c9ac9f95
A recent refactor introduced an issue on Vivo Y21 and Oppo Reno 3 where
writes to pixel local storage got disabled when the color mask was off.
Just leave the color mask enabled in EXT_shader_pixel_local_storage
mode.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-22 00:46:05 +00:00
bodymovin
b5da08bff3 chore: add support for assigning dynamically loaded images from listeners (#10857) 8df6209168
Co-authored-by: hernan <hernan@rive.app>
2025-10-21 23:14:03 +00:00
csmartdalton
43e4e692a1 feat: Merge fragment shaders for atlas blits & image meshes (#10852) 9794d81296
Previously we were trying to shoehorn atlas blits into
draw_raster_order_path.frag, which led to a lot of hard-to-read #ifdefs
since they're so different from paths. In reality, atlas blits are more
similar to image meshes -- both are just triangle meshes that render
directly without having to work out winding numbers -- so handle them in
draw_raster_order_mesh.frag instead (which we renamed from
draw_raster_order_image_mesh.frag).

Additionally, for MSAA, the draws are all so similar that we can just
merge them all into a common "draw_msaa_object.frag" shader.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-21 22:56:23 +00:00
bodymovin
42d61b6c86 add drag event type support (#10807) 2f4ec0a570
* add drag event type support

Co-authored-by: hernan <hernan@rive.app>
2025-10-21 22:21:50 +00:00
JoshJRive
c18e964c42 fix(build): Correct tracking of intended target OS in premake (#10853) c7a0379ab3
We've been testing _TARGET_OS in a lot of places in our build, but that is not actually updated in Android/Emscripten builds (it would continue to report, say, Windows). Among other things, this meant that we would build D3D12 shaders for every Android build, even though they were not needed.

This adds a `rive_target_os` value to `rive_build_config.lua` which is updated manually for those two projects, so that scripts won't do the Windows/mac things when building for android/emscripten on those platforms.

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-21 21:11:40 +00:00
JoshJRive
e1494304d6 fix(vk, android) Workaround for Vulkan driver pipeline linking issues (#10756) 39741ac0c8
* Workaround for Android 9/10 Adreno 5- and 6-series Vulkan driver bug

There's a bug in some of the early Adreno drivers where some of the Rive shaders will fail to compile due to hitting an internal limit. The workaround is to run a shader compilation pre-pass to inline functions before embedding the compiled shaders into the runtime.

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-21 18:39:09 +00:00
philter
52632f65a2 fix(runtime): Address issues requiring double advance (#10842) 5dd872763b
This PR removes the double advanceAndApply(0) when running goldens. There were 3 seperate issues that are resolved here.

NestedInput values which were keyed on a timeline did not take effect until the next frame when they were used to drive a Blend state. Fix: NestedArtboards and ArtboardComponentLists should check if needsAdvance() in addition to tryChangeState()
Layouts where positionType (absolute/relative) were keyed on a timeline were behaving inconsistently depending on whether positionLeft/positionTop were also keyed on the same frame. Fix: Make sure changing positionType only overrides the positionTop/positionLeft values if those were not keyed on the same frame as positionType
Text follow path modifier was rendering incorrectly in a specific case where a Text's width was bound to a VM property which gets its value from a Path's length. Fix: Call updateDataBinds before returning in Artboard::updatePass

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-21 18:01:27 +00:00
aliasbinman
b3854908e6 Fix path extraction (#10823) 76a19909c5
* Update contour_measure.cpp

* Update trim_test.cpp

* Update trim_test.cpp

* Update contour_measure.cpp

* clang format

* Update contour_measure.cpp

Co-authored-by: John White <aliasbinman@gmail.com>
2025-10-21 16:10:56 +00:00
bodymovin
007969f903 feature: add support for pausing nested artboards (#10833) 0a3cb5ac3e
* feature: add support for pausing nested artboards

Co-authored-by: hernan <hernan@rive.app>
2025-10-20 16:10:14 +00:00
philter
f47345a807 feat: Scripted Enum (#10829) 650a980d41
Adds support for ScriptedEnums (ViewModel enums). This PR does not include enums as Inputs, that will follow subsequently

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-18 20:22:26 +00:00
csmartdalton
21b397d17a refactor(renderer): Generalize fixedFunctionColorOutput (#10813) 396c65832e
* refactor(renderer): Generalize fixedFunctionColorOutput

Previously, fixedFunctionColorOutput was called
"atomicFixedFunctionColorOutput" and only applied to atomic mode.
Generalize it so it also applies to msaa, and will be compatible with
clockwise rendering in the near future.

* made build in unreal

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: blakdragan7 <jcopela4@Gmail.com>
2025-10-17 22:39:34 +00:00
bodymovin
33c9051b6a feature: add scroll threshold (#10824) 284c801953
Co-authored-by: hernan <hernan@rive.app>
2025-10-17 22:11:56 +00:00
csmartdalton
d4984fe601 fix(renderer): Fix outputs in the shader Makefile (#10822) 53bc4a7cbb
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-17 21:04:56 +00:00
philter
b76aed4366 feat: Scripted Boolean (#10804) cb93fbb138
Adds support for scripted booleans and boolean inputs.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-17 16:27:01 +00:00
csmartdalton
bf56af7f64 feat: Add PLS backings to the RenderContext resource manager (#10793) 2fe0021c07
Before this change, renderer backends were responsible for allocating
any textures or buffers required to back pixel local storage data. They
all did this by allocating separate backings for each render target,
which is wasteful on systems with multiple render targets.

This change adds PLS backings to the RenderContext's resource tracking
system, and allocates one global PLS backing with the dimensions of the
largest recent render targets. For now, only GL is updated to take
advantage of this resource, but other backends should follow soon.

It also merges the transient PLS backings into a single logical
TEXTURE_2D_ARRAY, as opposed to separate TEXTURE_2Ds. Allocating the PLS
backings in a 3D layout appears to get better cache performance on Intel
Arc GPUs.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-16 18:00:13 +00:00
bodymovin
a2e0b08804 feature: add support for artboards as conditions (#10788) dd59b347fb
* feature: add support for artboards as conditions

Co-authored-by: hernan <hernan@rive.app>
2025-10-16 01:32:31 +00:00
bodymovin
0058064b0c fix: add dirt to data bind after being used on listener (#10789) 4149563244
Co-authored-by: hernan <hernan@rive.app>
2025-10-16 01:17:11 +00:00
JoshJRive
c468e6757b Get the Linux unit tests building and running in the GitHub workflow (#10761) a0b890f273
Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-15 22:11:25 +00:00
philter
57f06b62e3 Scripting support in CPP (#10685) a34d1ffe15
Get scripting working in CPP runtime. This currently only supports in editor workflow, since some additional backend pieces will be required to get it working in CPP in the runtimes.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-15 19:05:13 +00:00
bodymovin
70708343e6 chore: automatically bind view model trees to dependents when any of … (#10782) ae01b2a8c3
* chore: automatically bind view model trees to dependents when any of its children view models is replaced

Co-authored-by: hernan <hernan@rive.app>
2025-10-15 13:56:47 +00:00
philter
6c47e0e4a0 fix(runtime): Font weight layout measure fix (#10766) 0ae985862d
With certain fonts, the expected font features/variations aren't available until a frame after the text is measured, so for example, we measure glyphs using its default weight rather than the weight set in the style, which causes the rendered text not to fit within the measured area, thus incorrectly wrap to the next line. This fix updates variable fonts whenever TextStyle::font() is called IF the variable font hasn't previously been cached.

Specifically this issue was reproducible when using Solos to toggle between components which had text wrapped in layouts.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-14 17:32:00 +00:00
bodymovin
a839f067b0 fix: interpolator in cpp runtime (#10752) 01c1b43af9
* fix: interpolator in cpp runtime

Co-authored-by: hernan <hernan@rive.app>
2025-10-14 02:43:50 +00:00
csmartdalton
e4dae96988 feat(gl): Add scissor to GLState (#10748) a3f6433c00
Start tracking scissor state and use it to limit our clear bounds for
pixel local storage backing.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-13 21:29:17 +00:00
HayesGordon
f2b604e0e0 fix(rive_native): front called on empty vector (#10706) 35953858c3
* fix(rive_native): front called on empty vector

* Update packages/runtime/src/animation/animation_reset.cpp

Co-authored-by: Gordon <pggordonhayes@gmail.com>
Co-authored-by: hernan <hernan@rive.app>
2025-10-13 17:46:59 +00:00
bodymovin
334013f14c feature: scripted converters (#10711) a40f07ee54
Co-authored-by: hernan <hernan@rive.app>
2025-10-12 14:03:25 +00:00
blakdragan7
1b29255449 feat(Unreal) Mac RHI Atomics (#10753) 50e69c8fde
* Added metal rhi support.

Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-10-11 01:31:37 +00:00
bodymovin
3b5f7cb28a fix: handle duplicate data binds on export and on clone (#10751) cd11dd2e60
fix: handle duplicate data binds on export and on clone to avoid inconsistencies

Co-authored-by: hernan <hernan@rive.app>
2025-10-10 19:06:23 +00:00
blakdragan7
2083f1648b fix(unreal): Sometimes would draw black when should be transparent. (#10747) 64f8da473b
fixed advanved blend being black when artboard is transparent

Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-10-10 17:27:50 +00:00
philter
d2a3690956 fix(runtime): Invalidate stroke effects on ForegroundLayoutDrawable (#10733) 2f7bed5eb1
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-08 01:58:08 +00:00
bodymovin
2ee3416c7b fix: keep unprocessed data binds until they are consumed (#10732) f4b36c2d03
Co-authored-by: hernan <hernan@rive.app>
2025-10-08 01:40:25 +00:00
csmartdalton
454d644c3c refactor: Start splitting shaders into separate files (#10698) b73733a052
* refactor: Start splitting shaders into separate files

The draw shaders are getting unruly with #defines all over the place.
Before we can add more, we need to clean these up a little. This PR
splits out the fragment portions of raster ordered and msaa shaders into
separate files. This also required teaching minify.py to handle .vert and
.frag files.

* apply_frag_coverage

* fixwebgpu

* unreal

* fixmetalagain

* formats

* oops

* rm draw_image_mesh.glsl

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-07 22:39:23 +00:00
csmartdalton
196a386b7e feat: Add a mechanism to select the integrated GPU on Windows (#10713) 986c92af9a
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-07 21:36:44 +00:00