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>
The interlock mode these shaders implement is clockwiseAtomic. Let's be
more specific with the naming so we can support other clockwise modes.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
* 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>
If a pipeline failed to acquire for a draw batch that required barriers of any kind, we were skipping the barriers as well as attempting to draw.
Now the code will apply the barriers and only skip drawing.
Co-authored-by: Josh Jersild <joshua@rive.app>
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>
Our MSVC builds are building with C++latest (instead of C++17), and what that means is that filesystem::path::u8string returns a std::u8string instead of std::string (see https://en.cppreference.com/w/cpp/filesystem/path/string.html), causing a compilation failure for the shader hotload rebuild command. This change adds back in the reinterpret_cast to a char pointer (but still stores the temp string correctly).
Co-authored-by: Josh Jersild <joshua@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>
Referencing ClipDistance (via gl_ClipDistance) in a SPIR-V shader, even if it is in a specialization branch that is not taken, is a validation error on systems that don't support ClipDistance. To get around this, there are now noclipdistance variations of the shaders that use it, and they (along with the MSAA shaders that never use ClipDistance) all define `DISABLE_CLIP_RECT_FOR_VULKAN_MSAA`, which ensures that it never tries to compile it in except where it matters.
Co-authored-by: Josh Jersild <joshua@rive.app>
The order of destroying the vulkan device and destroying all of the assets in the riv data was backwards - a loaded riv scene needs to be fully destructed before the Vulkan fiddle context can be, otherwise you'll get validation failures on fiddle context destruction (Because there are still buffers held by things in the artboards) or, if validation is off, crashes when trying to destroy the buffers using a now-defunct vulkan context.
Co-authored-by: Josh Jersild <joshua@rive.app>
Address a couple of issues:
When an artboard has a host, at the time the artboard has a layout marked dirty, we mark the hosting layout dirty (if it is a LayoutNodeProvider such as a NestedArtboardLayout or ArtboardComponentList). In cases where the host is not a LayoutNodeProvider (ie, NestedArtboardLeaf) we should also mark the host's transform dirty so it can redraw itself using the Artboard's updated size. This surfaced recently when we started using the artboard's hugged size with NestedArtboardLeaf mode.
In Artboard xChanged/yChanged we should mark the host's transform dirty rather than marking layout dirty (because we don't want to recompute layout at that time).
Co-authored-by: Philip Chung <philterdesign@gmail.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>
When items contained in a scroll constraint's layout are scrolled with snapping enabled, we exclude the hidden items from the snap list so they will not be settled on when the user swipes.
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>
This workaround came with an unacceptable performance cost. Let's revert
while we work out a better solution.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
fix(gl): Only do memory barrier workarouns on Mali
We introduced a spurious memory barrier per flush in order to work
around corruption on Mali-G78. But ironically, this barrier introduced
corruption on Adreno 610. Add some logic to only do the barrier on
Mali.
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>