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>
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>
This redoes the Vulkan bootstrapping used by our test apps to use our own internal bootstrapping (rather than VkBootstrap), as well as fixes swapchain issues with a subtly incorrect use of fences.
Co-authored-by: Josh Jersild <joshua@rive.app>
* Added custom draw function to render targets. Made saving on reimports for rivs not crash. Made generating blueprints 5.6 compatable
* view models now unsettle the state machine.
* now command q gets the view model type name for properties. UE also uses stores this information
* made viewModelProperty work with slashes.
* undo slash support
* removed test slash vm from data_bind_test_cmdq and updated unit tests to match
* updated draw commands
* better saving without crash
* automatic defaults are now working
* don't generate enums every noade. Make them inside the file and cache them.
* make enums public to allow referencing in blueprints
* removed defaults ready delegate
* removed unused class
* PR changes
* missed
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
VkBootstrap will incorrecty error with `vulkan_version_1_1_unavailable` on Vulkan 1.0 systems that do not have the vkEnumerateInstanceVersion function, even when we specifically said that it was fine to fall back to 1.0. To work around this, we will detect that error and then try again to create the Vulkan instance, specifically requesting version 1.0.
Additionally fix a "function must return" error when building in MSVC on Windows, and update LOG_ERROR to be LOG_ERROR_LINE to make it clear that it writes lines (and update its use of fprintf to match what the android logging does)
Co-authored-by: Josh Jersild <joshua@rive.app>
* make file ref counted
* migrate File to refcnt
* add bindable artboard class to keep file reference
* feat(unity): support rcp file and BindableArtboard class (#10228)
* refactor(apple): use updated file bindable artboard apis (#10229)
* update command queue to support bindable artboards
* use bindable artboards on command queue
* self manage view model instances in js runtime
* change remaining viewModelInstanceRuntimes to rcp
* refactor(apple): update view model instances to use rcp (#10298)
* refactor(unity): support rcp ViewModelInstanceRuntime (#10309)
* rebase fix
* deprecate getArtboard in favor of getBindableArtboard
* fix merge
* remove unused lambda capture
* fix rive binding
* feat(Android): RCP File, VMI, and add bindable artboards (#10456)
* refactor: C++ refactors
- Import from long (incorrect) -> jlong
- Header clang-tidy fix
- Use reinterpret_cast instead of C-style cast
- Break out some variables instead of long one liners
- Use auto
- Remove unused env and thisObj
# Conflicts:
# packages/runtime_android/kotlin/src/main/cpp/src/helpers/general.cpp
* docs: Improve documentation on the File class
* feat: Support bindable artboard type and RCP VMIs
# Conflicts:
# packages/runtime_android/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveDataBindingTest.kt
* feat: Support RCP files
* refactor: Change from +1/-1 ref to just release
* fix: Moved to the more appropriate null pointer for GetStringUTFChars
* replace unref with release
Co-authored-by: Adam <67035612+damzobridge@users.noreply.github.com>
Co-authored-by: David Skuza <david@rive.app>
Co-authored-by: Erik <erik@rive.app>
Co-authored-by: hernan <hernan@rive.app>
Vulkan is ready to stabilize. Let's get it on our nightly runs.
Also disable "atomic" mode on Android unless requested explicitly.
Barriers tend to be expensive on Android and MSAA is usually cheap;
let's stabilize MSAA first.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
* fix(vk): Properly preserve render targets when using MSAA
Unfortunately, Vulkan does not provide a mechanism to initialize our
(transient) MSAA texture with the contents of the (non-MSAA)
renderTarget texture at the beginning of a render pass. To work around
this limitation while supporting LoadAction::preserveRenderTarget, we
literally draw the previous render target contents into the framebuffer
at the beginning of the pass.
* Fix one more barrier
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Description
Adds support for passing a string and color vm property to the scripting engine.
Adds support for defining color and string as inputs.
Co-authored-by: Susan Wang <susan@rive.app>
And add a "webserverandroid" target to deploy_tests.py that sets
up reverse port forwarding over ADB so we don't have to rely on the
network.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Since Artboard list items are rendered with z index increasing as the item index increases (ie, later children will sit above earlier children), when doing hit testing, we need to traverse the items in reverse order in order to capture the property z ordering. This is only important when items have overlap.
Co-authored-by: Philip Chung <philterdesign@gmail.com>
This gets the Vulkan runtime running with the async pipeline manager.
This required moving a bunch of the internal render context impl classes up to the header, which made the header a bit unwieldy so they got moved out to their own files.
Additionally, this has some changes to the async pipeline manager:
- Vulkan's pipelines have additional information that the other renders' do not, so PipelineProps is now a property of the pipeline type so that it can have its own pipeline type
- Similarly, Vulkan uses a 64-bit index for its pipeline key (so that it can use 32 bits of it as the standard shader key) so that had to be generalized as well
- Moved the vertex shader manager functionality into the pipeline manager because every pipeline should share vertex shaders
- Generalized it so that vulkan can also use it to share other things. This includes fragment shaders which are now managed as shared like vertex shaders were, because on Vulkan multiple pipelines can share the same fragment shader.
- Changed the std::maps to std::unordered_map because the lookup speed should be better (it's a hash map vs. a binary tree)
Co-authored-by: Josh Jersild <joshua@rive.app>
Adds distinct start, end and offset properties for List's follow path as requested by Creative team, to behave similarly to Trim paths. This also fixes an issue where modifying strength wouldn't modify its rotation accordingly.
Co-authored-by: Philip Chung <philterdesign@gmail.com>
Noticed that the old rive_flutter goldens were removed. With some updates to follow path coming with List follow path, I wanted to make sure those old goldens were captured as silvers prior to the new changes landing. We may want to go back and covert the other goldens in the future.
Co-authored-by: Philip Chung <philterdesign@gmail.com>
- deploy_tests on windows should use `where` which is built in (vs `which` which is not)
- vk bootstrap now displays shaderClipDistance, which was missing from the printing of available features
- vkcore and vksrgb backends now do the correct thing
- added vkmsaacore backend (which currently fails due to a validation error)
Co-authored-by: Josh Jersild <joshua@rive.app>
* feature: add support for color interpolation in converter
* fix: target to source with different types with converter applied
Co-authored-by: hernan <hernan@rive.app>
A layout's collapsed value wasn't being propagated down the tree which resulted in issues if a parent was set to display, but a child layout was set to hidden, it would not hide its contents properly.
Co-authored-by: Philip Chung <philterdesign@gmail.com>
This extension has been an ever-flowing fountain of bugs for us,
especially on PowerVR. Furthermore, it doesn't even work on Pixel 10
(PowerVR D-Series DXT-48-1536).
Let's de-fragment our Android GL renderer and consolidate everything on
MSAA (except for old PowerVR devices where MSAA doesn't work). MSAA is
hopefully a more tried-and-true, less bug-prone rendering mode in the
Android ecosystem anyway, and it's nice to be more consistent across
devices.
The perf story looks positive. On PowerVR, MSAA seems to be generally
faster. On ARM it's always been a mixed bag depending on content.
Either way, this is a nice approach to switch GL to maintenance mode so
we can go all in on Vulkan.
NOTE: We are still keeping EXT_shader_pixel_local_storage as a fallback
for the feather atlas on devices that don't support float rendering.
There are real GPUs where this is our only way to get high quality
feathers.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
* Remove use of `FRHIResourceCreateInfo` which is now deprecated
* Updated to c++20 because that is the new requirement for UE
* Fixed a bug where the state machine name selection would cause a crash if no state machines are in riv file.
* No longer use raw pointers as `TObjectPtr` are preferred now
* Fixed bug where `#ifdef WITH_RIVE_TOOLS` was missing in `FrameOptions` declaration
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
Implement some missing localBounds methods in CPP on core objects that expose this. Basically ported over from Dart. This was requested in order for the new rive_native Flutter runtime to provide a similar API to the legacy Flutter runtime.
Co-authored-by: Philip Chung <philterdesign@gmail.com>
fix(gl): Limit the tess/grad instance conts on Mali/PowerVR
Limit the number of instances we draw at a time when rendering the
tessellation and gradient textures. PowerVR and ARM GPUs have been known
to crash when rendering large instance counts. We're already limiting
the instance counts for main draws, but we missed the tessellation and
gradient passes when we added this workaround.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>