Color ramps are the final resource texture we need to make interruptible
for old Android GPUs that don't support complex render passes.
Also fix lots_of_tess_spans to look the same on MSAA and not.
* fix(vulkan) Tighten the requirements for destroying/recreating the vulkan gms on Adrenos
This was causing a test failure on a couple devices with the same chipset and driver
* Increase timeout to 5
lots_of_tess_spans_stroke is seeing a histogram result as low as .95087
on a correct image. Bump the default tolerance to .05 so we don't get
false negatives. Hopefully this holds us over until we can work on more
accurate image diffing.
We had a nice comment describing why we shouldn't create the overflow
texture with VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, but then we went ahead
and accidentally created it as an input attachment anyway.
This PR actually applies the workaround described in the comment.
Also apply the "teardown after every GM" workaround to Adreno pre 1.3 GPUs,
since those also experience sporadic crashes and this appears to help.
The Mali Vulkan driver/device was running out of memory internally, occasionally. This adds a hook into the testing window that gets run after each GM finishes, which TestingWindowAndroidVulkan now uses to tear the device down completely. The device then gets rebuilt as needed.
chore(vk): Make the tessellation pass interruptible
We recently worked around some driver crashes on Vulkan by breaking up
atlas & draw render passes that were too complex. This PR makes the
exact same workaround for tessellation passes, and adds a GM to catch
this case.
* feat: working on focusable
* feat: text events to rive native
* feat: runtime text from editor
* feat: text input in the editor
* chore: cleanup
* chore: fix non text builds
* chore: fix warning
* fix: key import in rive_native_web
* feat: text input for web rive_native
* chore: fixes
* chore: cleanup
* fix: remove unused imports
* chore: more tests for missed lines
* Clean up some assumptions in WebGPU that support for PLS meant it was
actually being used. Now that we support MSAA, it might not be in use.
* Clean up a refactoring typo that caused an input attachment to be
deleted before it was used.
Vulkan has always been using minimum sized atlases of 2048x2048 because
we forgot to set PlatformFeatures::maxTextureSize. Start grabbing this
value off the physicalDeviceProps to enable fewer flushes.
Vulkan's LOAD_OP_LOAD cannot be specified on a render pass attachment that is IMAGE_LAYOUT_UNDEFINED - this conditionally makes the image layout GENERAL in those cases (and allows it to stay UNDEFINED for the general case, since the texture may not yet be initialized)
* Added set / reset size for artboarsd to command queue. Use this for render targets in unrel. Set size directly for widgets.
* removed original bounds
* made state machine advance when setting size
Adreno 730, 740, and 830 don't seem to appreciate binding buffers and
updating descriptor sets before beginning the render pass, even though
this appears to be valid usage of the Vulkan API. Re-update atlas
rendering to begin the render pass first.
Some early Android tilers are known to crash when a render pass is too complex. This PR is a first stab at adding an "interrupt" mechanism to atlas and draw render passes, which allows us to break up our rendering into smaller chunks that don't crash. Currently, only rasterOrdering mode is supported for interrupting draw passes. We will need to investigate whether this workaround is also needed for msaa, tessellation, and gradient textures.
This change primarily works around a driver issue that was causing visual corruption on some newer Adreno-based devices.
There are other minor changes as well (displaying the driver version from the bootstrapping code, setting a minimum requirement of Vulkan 1.1 in the renderer)
Some tooling changed today-ish that is causing the 310 es shaders to fail to build with:
```
runner/_work/rive/rive/packages/runtime/tests/unit_tests/out/android_arm64_debug/include/generated/shaders/glsl.minified.glsl:450: 'token pasting (##)' : not supported with this profile: es
ERROR: spirv/blit_texture_as_draw_filtered.main:6: 'stringify (#)' : not supported with this profile: es
ERROR: spirv/blit_texture_as_draw_filtered.main:6: '#' : '#' is not followed by a macro parameter.
ERROR: spirv/blit_texture_as_draw_filtered.main:6: '' : missing #endif
ERROR: spirv/blit_texture_as_draw_filtered.main:6: '' : compilation terminated
ERROR: 5 compilation errors. No code generated.
```
This is only a "310 es" issue, and so since most spir-v shaders are already 460, this moves the rest to be the same.
Fixes a crash when trying to use pointer events when a ViewModel property input is not setup properly on a scripted drawable instance.
The code was checking for ScriptAsset.vm which will always be non-null when bytecode is compiled in the editor. We should be checking instead for ScriptedObject.state because that will only be non-null if the ScriptedObject has validated (and we early out if that is null so we don't crash).
Also added some errors when VM properties are not setup correctly as Script inputs so users will be aware that there is an issue with their VM setup or bindings
Refactors how invalidateEffect in StrokeEffects work. Now there are 2 code paths:
invalidateEffectsFromLocal() - this is called from the StrokeEffect itself. It calls out to ShapePaint::invalidateEffects to let it invalidate any other StrokeEffects that may need to do so. It also calls invalidateEffect on itself.
invalidateEffects() - this can be called from the StrokeEffect (via invalidateEffectsFromLocal) on itself OR by ShapePaint while in the process of determining if any other StrokeEffects should be invalidated via the call above. This adds paint dirt to the StrokeEffect along with any additional work needed when invalidating.
This prevents invalidateEffect from calling ShapePaint::invalidateEffects multiple times.
This also resolves an issue with ScriptedPathEffects in Components
* fix(vk): Implement manual MSAA resolves
Some Android devices have issues with MSAA resolves when the MSAA color
buffer is also read as an input attachment. In the past we've worked
around this by adding an empty subpass at the end of the render pass.
This PR implements fully manual resolves instead, which we now use when
there are blend modes and partial updates. This is hopefully a more
stable workaround than a mystery subpass, and will ideally get better
performance as well when we don't need to resolve the entire render
target.
* Fix synchronization validation (had a write/write hazard between the image state transition and the load op)
* fix(vk): Implement manual MSAA resolves
Some Android devices have issues with MSAA resolves when the MSAA color
buffer is also read as an input attachment. In the past we've worked
around this by adding an empty subpass at the end of the render pass.
This PR implements fully manual resolves instead, which we now use when
there are blend modes and partial updates. This is hopefully a more
stable workaround than a mystery subpass, and will ideally get better
performance as well when we don't need to resolve the entire render
target.
* Fix synchronization validation (had a write/write hazard between the image state transition and the load op)