fix(editor): Properly remove all script core objects when deleted (#11324) a3e784a1f0
3 Fixes for Script asset deletion in this PR:
- Present a confirmation dialog if the script is being used by any scripted object on any artboard
- When script asset is deleted, make sure to clean up all of the associated core code file/line/points
- Also remove the LibraryCodeFile from the library cache. This fixes a bug where after deleting a library script, you couldn't add it back to the file again.
Testing window was restructured to allow the tests to destroy/recreate the device, but the render target was not being (re)created when the device was.
When the renderTarget doesn't support
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, we have to use an offscreen color
texture instead. Previously, we would copy this offscreen texture back
into the renderTarget after the render pass, which incurred a
substantial amount of memory bandwidth. This PR instead transfers the
offscreen texture to the renderTarget as part of the render pass, and
then discards the offscreen texture, saving a fullscreen copy on TBDR
architectures.
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.