Various Android vendors experience synchronization issues with multiple
flushes per frame. We used to call glFlush every Rive flush on Qualcomm
for this reason. Remove the 'if' and just call glFlush for everyone.
Also call glMemoryBarrier for everyone ES 3.1+ at the end of the flush.
In particular, ARM Mali-G78 needs this barrier in conjunction with a
glFlush to ensure a resolve of EXT_multisampled_render_to_texture. (Note
that the spec says these resolves should all be implicit and automatic.)
* fix(apple): do not use symbolic trait font copy on failure
* fix(apple): release ctfont copy
* refactor(apple): do not manually ref rcp'd font, remove cache
Co-authored-by: David Skuza <david@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.
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.
* 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
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.
This improves the handling of GL parallel shader compile and the ubershader fallback, centered around fixing the Galaxy S22 goldens
- GL ubershaders needed to not set ENABLE_CLIP_RECT in MSAA mode when missing the EXT_clip_cull_distance extension
- avoidMaxShaderCompilerThreadsKHR is no longer necessary because the extension is actually working as expected
- Similarly an explicit null check on glMaxShaderCompilerThreadsKHR is no longer necessary because the Android egl extension function loading code already does so
- The recommended way to use KHR_parallel_shader_compile is to compile the shaders, then start the link, then wait on the link to finish (and then display compilation errors after that if compilation failed). This simplifies the compilation handling
- There was an assert in tryGetPipeline that was intended as a "this should be impossible" test but it turns out it is possible (when the ubershader had completed, but errored), so now on an ubershader error case we will return nullptr (and let the renderer not draw) rather than assert
* fix(ios):fix a metal API validation error in sim.
When running on the simulator, we run in atomics mode. In this mode, we weren't binding the clip plane buffer properly.
It is possible that Android GL drivers report an extension as being present, but the extension functions actually are not. This validates that we get valid pointers for any extension (and turn off trying to use the extension if we cannot).
fix(gl): Fix rendering issues on Xiaomi Watch models (#10527) 8a0dbb9c80
the GL_EXT_clip_cull_distance extension shader code was using a feature of GL_EXT_shader_io_blocks, which was not otherwise being required by the shader. This use has now been removed.
During an attempt to work around some driver issues on an ANGLE device, glsl.glsl was changed to use the EXT_shader_io_blocks extension (which we are otherwise not using) to specify a set number of clip planes for EXT_clip_cull_distance. However, the workaround ended up removing support for EXT_clip_cull_distance in ANGLE and WebGL so the glsl.glsl change was no longer necessary.
More recently, developers on a couple Xiaomi Watch devices discovered a rendering issue, which stemmed from the use of GL_EXT_shader_io_blocks functionality without having required it in the shader code. Rather than add the #extension line to do so, since this use of that functionality isn't currently solving any known issues, it seems better to just remove the shader_io_blocks usage and let the GPU/driver set the clip plane count itself.
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.
We discovered a workaround on older PowerVR devices that involved
enabling EXT_shader_pixel_local_storage2. It seemed safe enough, but it
is responsible for rendering and perf regressions. Just quit using pls2
altogether.
Also disable GL_CULL_FACE when initializing and resolving pixel local
storage. Leaving it on is just one more possible bug to crop up if we
get the wrong face, and if we do get it wrong it's hard to debug because
everything disappears.
* removed aborts and properly handle the error case instead. Don't use printf because nslog allows for proper output to log files in ios
* more converts to nslog
* made checks more specific
* Wiring up multiple synthesized failure types
* Wiring through the new synthesized failure modes to D3D11, 12, and GL
* Move the Metal ubershaderLoad failure synthesis to a better spot
* clang format
* Missed wrapping a variable in #ifdef WITH_RIVE_TOOLS
* Correction: missed *multiple* #ifdef WITH_RIVE_TOOLSes
* Still more
* Testing to see if the D3D12/GL errors are related to the ubershaderLoad synthesis or not
* Removing additional pieces of the testing to see what's causing the issues
* It's important to write your preprocessor directives correctly 🙃
* Trying to figure out what the fence value is that is coming out wrong on the D3D12 tests and why GL is failing
* trying something dumb to see if this re-breaks the oneplus7
* Split the render test up into three tests to see if it is any better on the oneplus7
* Trying to see where the d3d12 device is getting removed (and why), and also what happens if I run 2 of the same synth test on oneplus7
* Sorry everyone it's effectively printf debugging time 🫤
* Changed the CreateEvent call to see if that works for D3D12 and also more printing for GL
* More
* Okay testing some other dumb stuff - this might resolve oneplus 7, still no idea on D3D12 yet
* Testing an alternate fix for the oneplus7 issue plus a different initial frame value for the copy fence
* Adding a comment before push
* Clean up the testing code (the D3D and oneplus7 issues are fixed but now there's a GL issue on windows. sigh.
* clang format again
I'm good at this lol
* Okay I think this will fix the windows GLFW issue at the cost of it might break all the android tests or something (but I hope not!)
* Now debugging why glfw window creation is failing for windows unit tests
* Okay this should "fix" the GL issues on github by just not creating a GL window if GL is not supported.
* Some minor cleanup
* Clarifying a comment, mostly to get the tests to re-kick
Floating point color buffers are only supported via extensions in GL.
Previously, the feather atlas would just break when this functionality
wasn't present.
This PR adds support for multiple different AtlasTypes that make use of
various GL extensions to render the atlas. As a final resort, if none of
the other extensions are available, it can split coverage up into rgba8
compoments. This mode works on unextended GL at the cost of quality.
We revisited how we handle layout display changes and how they related to the collapsed dirt on a LayoutComponent:
We now override isCollapsed in LayoutComponent to take into account both the collapsed dirt that may have been propagated down from a parent AND the LayoutComponent's own display value. If the layout has collapsed dirt, it MUST have been propagated down so it takes precendence, otherwise use its own display value
We removed the need to walk up the parent tree to figure out if any layout in the hierarchy is hidden
We removed a workaround to prevent a 1 frame visual glitch. This workaround was resolved by this fix and is no longer needed.
Work around the S22 rendering issue
Chris figured out that this was broken with the introduction of using KHR_blend_equation_advanced (vs. the coherent one) - the S22s specifically report compatibility with it but the rendering is wrong.
To fix it, unfortunately, the best way we could think of was to (just before the first beginFrame call) do a quick test where we render some known colors with a known blend mode to a tiny texture then read the output and validate it's within a threshold. Right now the threshold is large because the actual error in practice was massive, so this works - only the S22 models trigger the "oops I can't use this" threshold and back out support.
* removed opengl renderer because it never worked anyway
* removed android check that is no longer used
* remove iriverenderer
* prepping for commandQueue
* wip
* wip
* started implementing draw loop
* wip
* now stripped down to no include rendering anywhere its not needed
* rive now attempts to render, but server is not loading ile
* wip
* wip
* started adding support for non uav render targets
* statemachines now update correctly and basic rive leaf widgets draw
* listeners now added for file and artboard
* merge master changes
* made ui draw more performent
* added todo
* added statemachine listener and settled callbacks
* added resource handling for rive handles
* Started implemetning file data in viewer
* now display data about artboards, statemachines and viewmodels. Fixed crash with resizing preview
* fixed bugs, better formating
* Properties now display correctly for URIveFile Asset Editor
* Dynamic View Model Node First implementation
* make view model nodes wip
* make artboard and make view model nodes finished
* wip viewmodels
* Generate view model blueprints
* almost finished data binding
* Unreal MVVM finished. Command Q still needs work
* integrated external images and data binding artboards in unreal
* fixed opening file details
* leaf widget now correctly uses fit and alignment. Fixed a couple of bugs
* added clip path for widget view
* cleanup, data binding finished (probably). smoother reimport. proper enum creation for blueprints.
* Error checks now work for custom bp nodes
* File now saves data instead of requesting it every time
* properly saves and loads file. Now builds for standalone
* added defaults for instances
* auto binding view models, properly holding a ref to bound view models. general cleanup
* dont subscrive to view model properties
* added SetStateMachine to URiveViewModel
* fixed delegate signature
* fixed some bugs related to output pin
* fixed a few bugs with loading / saving nodes
* properties now properly get created with signatured and notifies
* GM module now works with re-rewrite
* now get values on start.
* auto bind now uses rive descriptor
* lists working
* added way to check if you need to get defaults
* now update list size when data updated
* fix build issue
* added way to get view model properties via c++
* audio works
* made audio engine a little easier to use
* started implementing rive render target
* added shader types
* raster order shaders now link
* Now raster ordering plugged in.
* wip
* wip
* wip
* now supports render targets that don;t have render target flag.
* thumbnail renderer now works
* started implementing render target. only needs gamma correction
* removed uneeded message and test file.
* now updated render target dropdown for artboards and state machines
* Removed RiveTextureObject
* removed RiveEvent class
* raster order mode mainly works now
* better copy for back buffer
* made default clear value for back buffer transparent so it uses fast clear
* fixed color mode for render target
* dont setup on cdo's
* added srgb gamma correction
* started getting packaging working
* now packages for windows
* goldens / gms now run with rewrite
* Re added dropdown names for rive actor
* check for null handle
* now builds on mac
* removed uneeded file
* PR comments