Release notes
What’s new
Content Development
Disable accessing invalid game objects exposed by reference
Changes in Binding and Data Binding
Starting with this release, Prysm comes with better binding and databinding safety by improving the way properties of C++ models and objects exposed by reference are accessed in JavaScript.
Until now accessing in JavaScript a property of exposed by-ref object or a data binding model was essentially exposing that property by-ref too. That means that when the pointer to that C++ object is no longer valid, the C++ code is responsible to call additional methods like View::DestroyExposedObject()
. This makes it very easy to create use-after-free bugs in the game, while understanding the reason for the crash is not trivial (i.e. where JavaScript is using an object whose game counterpart has been destroyed or relocated).
Now when caching into a variable a property of a model or exposed by-ref object, instead of storing the pointer to the underlying property, we store the path to reach that property. Every time the property is used, it will be queried from the top level object or model, instead of using a cached pointer that may not be valid any more. You still need to make sure that the top level object or model is valid and call respectively View::DestroyExposedObject()
or View::UnregisterModel()
when it is destroyed.
Behavioral changes
Exposed properties to JavaScript will no longer be cached by address, but by property/index and parent object. That means that caching the nth element of an array for example will always point to the nth element, even if the array was reordered and the nth element is now a different element, while someone may expect that the object that has been kept will be the original one.
Get unsafe reference to a model property in JavaScript
If you still need to have an unsafe reference to a property in JavaScript, you can use engine.pinUnsafeReference(model.property1.property2)
.
There is also a method to disable safe data binding, but we discourage using it: engine.enableSafeDataBinding(false)
Integration
Custom Properties
If you have custom classes that inherit from Property
, you need to make sure that ToArray()
method works correctly if your Property has such semantics, including with C-style arrays.
Custom array types
Binder::TryBindArrayByRef()
has additional parameter typedef void* (*ArrayElementGetter)(void*, size_t)
which returns a pointer to the nth element of the array. You need to provide such argument to TryBindArrayByRef
if your engine has custom array types. You can check Array.h
and Vector.h
headers for example.
Custom map and pair types
Every type that uses Binder::MapBegin()
and Binder::MapEnd()
in the bind function, such as maps, pairs, etc, should wrap the call to CoherentBind
with CoherentBindKeyValueProperty()
. You can check Map.h
, UnorderedMap.h
and Pair.h
for example.
Rendering
Emoji glyphs support
Prysm now supports certain kinds of emoji fonts.
Prysm can load and display emoji from COLRV0 emoji fonts. Those are flat shaded emoji glyphs comprising of several path objects.
Prysm renders the emojis on the GPU and caches them on glyph atlases. This makes the emojis rendering smooth and with no performance bottlenecks.
For more details, see the documentation for the emojis support
Migration guide
Migrating to 1.61
Support for BGRA8 textures
The graphics library has a new pixel format – PF_B8G8R8A8
. All provided backends now support the new texture format and can create textures from it.
New shader types
With this version, Prysm comes with 2 new shader types: ST_CircleTextureRepeat
, ST_EllipseTextureRepeat
. Their corresponding pixel shader types are PST_CircleTextureRepeat
(matching the already existing PST_RoundedRectTextureRepeat
) and PST_EllipseTextureRepeat
.
Note: If you rely on a custom backend, the PST_EllipseTextureRepeat
pixel shader type must be implemented. As for the PST_CircleTextureRepeat
, since it matches the PST_RoundedRectTextureRepeat
shader type, no changes will be required.
You can check CohShadeGeometryRare.ihlsl
, for reference on how the new shader type is used.
Changelog
Version 1.61.0
Released 09 Dec 2024
API | New pixel format for textures PF_B8G8R8A8 |
API | New shader types ST_CircleTextureRepeat and ST_EllipseTextureRepeat |
APIUnreal Engine | Renamed Switch libraries HttpServer.NN.nrs / nro to HttpServerNN.nrs / nro and MediaDecoders.NN.nrs / nro to MediaDecodersNN.nrs / nro to make them package correctly in Unreal Engine 5.5 |
Feature | Added COLRv0 emoji support |
Feature | Disable accessing invalid game objects exposed by reference |
Feature | Added ::slotted pseudo-element |
Feature | Added support for shadow DOM |
Feature | Added the slot element |
Feature | Added the host pseudo-class |
Feature | Added partial support for the ‘all’ css shorthand with value ‘initial’ |
EnhancementUnreal Engine | Support Unreal Engine 5.5 |
Enhancement | Implemented surface cache flushing when changing render target |
Enhancement | Added HDR support in media queries |
Enhancement | Extended View’s API to be able to get the current script stack trace |
Enhancement | Added prebuilt C++20 ICU versions for Sony PlayStation 5 to allow linking with libc++ ABI v2 . The libraries have cpp20 at the end of their filename |
EnhancementUnreal Engine | Added control of texture pool size for Custom Effect textures |
EnhancementUnreal Engine | Added custom effect texture pool APIs |
EnhancementUnreal Engine | Cohtml and Renoir assert failures are now handled with ensureAlways , so they break the code execution only when a debugger is attached |
EnhancementUnreal Engine | Fixed crash when Unreal Engine tries to execute Cohtml tasks one inside another |
Fix | Leaking renoir commands for canvases on platforms with clang based compilers |
Fix | Fixed Sony PlayStation 4 and Sony PlayStation 5 virtual allocator memory protection |
Fix | Fixed the simple opacity when applied to SVGs |
Fix | Fixed crash when using canvas radial gradient |
Fix | Fixed crash when GC happens during cloneNode |
Fix | Custom element callbacks are now executed in the correct order |
Fix | Fixed wrong assert when using SVG as background-image |
FixUnity | Fixed OpenGL Rendering Target support |
Fix | Fixed assert for incorrect lineStart when wrapping inline text that ends with a new line |
Fix | Fixed assert with pseudo elements |
Fix | Fixed stack overflow when using calling .blur() in a focus event handler |
Fix | Fixed assert when removing focused node matching complex selectors |
Fix | Fixed animated GIF frame duration playback (previously each frame was displayed for 10 times longer). |
FixUnity | When an abort request is made, the DefaultResourceHandler responds with success and not displaying any error or warning messages |
FixUnreal Engine | Improved live reload path matching when using non-normalized paths |
Fix | Fixed wrong styles when using important declarations in pseudo-elements |
FixUnity | Fixed crash in Development Unity player builds for Android |