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>
* 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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
* 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>
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>
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>
* 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>
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>
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>
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>
* 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>
* 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>