Commit Graph

7633 Commits

Author SHA1 Message Date
Mathias Agopian
91d4e0e688 Workaround a rendering corruption on Mali
The corruption seems to be triggered with a combination of using:
- spirv-opt
- RGBA16F (as opposed to e.g. RGBA8)
- framebuffer_fetch

In this CL we disable framebuffer_fetch for drivers we know have the
issue.

FIXES=[445721121]
Fix #7794
2025-09-25 16:37:50 -07:00
Mathias Agopian
8af1cb3489 fix build warning (#9263) 2025-09-25 16:37:24 -07:00
Filament Bot
456ae4cabe [automated] Updating /docs due to commit f233b20
Full commit hash is f233b20427

DOCS_ALLOW_DIRECT_EDITS
2025-09-25 21:20:43 +00:00
Powei Feng
f233b20427 renderdiff: add a filter option for local testing (#9257)
This option will allow for rendering and comparing a single
image or files that match a wildcard-style string.

README.md has been updated
2025-09-25 21:18:35 +00:00
Mathias Agopian
a1b825b5b4 performance improvements to CString (#9259)
- make sure CString("foo") calls the literal constructor
- avoid memory allocations when comparing to a literal
2025-09-25 13:57:53 -07:00
Powei Feng
f9beffe3dc vk: add pool for VkSemaphore for re-use and lifetime tracking (#9254)
- Add a VulkanSemaphore ref-counted class to track the references
   of a semamphore - i.e. in a command buffer or in a present.
 - Add a VulkanSemaphoreManager class to keep a pool of
   VkSempahores for better re-use.

This fixes a validation error where we were re-using a semaphore
that is associated with a command buffer while its being used
in a present (as a wait signal).
Error ris VUID-vkQueueSubmit-pSignalSemaphores-00067
2025-09-25 13:39:25 -07:00
Mathias Agopian
db96b262a2 fix another matdbg build breakage (#9255) 2025-09-24 23:13:10 -07:00
Eliza
c0ab447ef7 material cache: address comments (#9253)
* material cache: address comments

* material cache: simplify CRC32 comparison

* material cache: == if same address

* material cache: use plain type for cached crc32
2025-09-24 17:00:14 -07:00
rafadevai
855a8f0b49 Refactor backend getShaderLanguage functions. (#9204)
Allow returning a list of supported shader languages
instead of only one.

Notify the backend which is the preferred language.
In the case of metal, the preferred language will be
the first element in the list.

This change will allow a backend to support multiple
languages as needed, in the case of the noop driver,
it will support a material with any shader languages.
2025-09-24 16:23:42 -07:00
Mathias Agopian
9c455e856d Fix matdbg build 2025-09-24 14:36:55 -07:00
Filament Bot
009de921e2 [automated] Updating /docs due to commit 7663ca8
Full commit hash is 7663ca8dfe

DOCS_ALLOW_DIRECT_EDITS
2025-09-24 18:55:45 +00:00
Powei Feng
7663ca8dfe Release Filament 1.65.2 2025-09-24 11:53:16 -07:00
Powei Feng
ee51c054b9 gl: disable fb fetch for llvmpipe (#9240) 2025-09-24 11:47:19 -07:00
Mathias Agopian
884b7590cb Update remote UI (#9247) 2025-09-24 09:53:49 -07:00
Powei Feng
decf316802 Make check-headers test use c++20 2025-09-23 21:28:37 -07:00
Eliza
5516cd92e7 materials: introduce MaterialCache (#9205)
* materials: introduce MaterialCache

Presently, Filament Materials are instantiated by first parsing a bunch of
read-only data from a material file, then applying a bunch of options from its
Builder before settling on a final, immutable Material object. If two different
Material instances need to be parameterized differently, e.g. setting their spec
constants independently, each has to do all of these steps independently for
each variation.

This change introduces two new concepts: MaterialDefinition, representing the
deserialized, read-only state of a material file, and MaterialCache, a
reference-counted system responsible for managing the lifetimes of
MaterialDefinitions. Now, each Material asks the cache if a MaterialDefinition
exists for the particular UUID of the data it's trying to read; if not,
MaterialCache creates a new entry transparently. If a hundred different
Materials all try to load the same material data, only one
MaterialDefinition (and its associated GPU resources) will be created.

This first PR is the least possible invasive implementation of this feature.
There are a lot of room for improvements (and more planned). For example, each
Material still manages its own compiled shader program cache, but we can easily
move this to the MaterialCache in future PRs, further enabling the planned
mutable spec constants feature.

Additionally, there's room here to add a Material::toBuilder() method, which
could take an extant material and create a Builder object from it already
parameterized with all of the same options, a la the prototype design pattern.

* material cache: key on crc32

* material cache: make materialParser private

* move RefCountedMap to utils and add unit tests

* material cache: make create functions private

* material cache: fix broken tests on iOS/web

* material cache: address more comments
2025-09-24 00:35:59 +00:00
Mathias Agopian
77d6092890 Fix build. broken due to a bad merge (#9249) 2025-09-23 17:14:28 -07:00
Mathias Agopian
4ad619439a use RG32UI for picking instead of RG32F (#8917)
The reason for this is that according to the GLES 3.0 spec, RG32UI is 
guaranteed to be supported for writing, unlike RG32F.

We also use RGBA_INTEGER / UINT for readPixels() which is also a
guaranteed format.

Attempt to Fix #8762
2025-09-23 16:20:57 -07:00
Mathias Agopian
143d59a991 add support for memory mapped buffers in the backend (#9217)
* reorder backend methods

* add new "shared" buffer APIs to backends

We add the equivalent of GL's glMapBufferRange. The new APIs are:
- new "SHARED" flags when creating a BufferObject 
- a new HwMemoryMappedBuffer handle
- mapBuffer() maps a range of the buffer to memory
- unmapBuffer() unmaps the range
- copyToMemoryMappedBuffer() is basically a deferred memcpy, where the
  destination is a HwMemoryMappedBuffer and the source is a
  BufferDecriptor

The actual implementation doesn't have to actually map/unmap the range
on mapBuffer/unmapBuffer. e.g. on Vulkan these method are used mostly
to set offsets (for copyToMemoryMappedBuffer) and trigger the necessary
synchronizations.

Added some basic unit tests.

* add basic support for MemoryMappedBuffer in vk and metal

we implement copyToMemoryMappedBuffer() by calling updateBufferObject(),
which is enough to satisfy the API (And pass the tests).
2025-09-23 16:15:28 -07:00
Mathias Agopian
2a62518e5c imgui: new readme and update script 2025-09-23 16:13:37 -07:00
Powei Feng
edb17200d0 android: fix hello-cam sample appID
Make the application id and namespace consistent.
2025-09-23 16:10:39 -07:00
Ben Doherty
2afd0bd7f7 Metal: add debug labels to Metal resources (#9187) 2025-09-23 10:57:15 -07:00
Ben Doherty
bf2459540e Add Java bindings for setFrameScheduledCallback (#9182) 2025-09-22 18:40:42 -07:00
Powei Feng
09bb9828a2 Update .gitignore for renderdiff deps (#9242) 2025-09-22 21:40:20 +00:00
Sungun Park
8fda29657a Cache isMSAASwapChainSupported() result for EGL (#9235)
This change introduces a caching mechanism to store the results of MSAA
support queries.
2025-09-22 14:10:08 -07:00
Ben Doherty
c53195fa9a Fix frame scheduled callbacks not being latched (#9243) 2025-09-22 14:08:20 -07:00
Powei Feng
1e59032396 vk: guard export fence creation 2025-09-22 12:36:44 -07:00
Ben Doherty
9e79be419d Metal: log command buffer errors (#9224) 2025-09-22 12:10:30 -07:00
Powei Feng
a81d3217e7 github: make linux machines consistent (#9241) 2025-09-22 11:20:23 -07:00
Powei Feng
aa67faefab vk: remove renderstandalone workaround (#9236)
The bug might have been addressed by PR #8952. This workaround
is no longer needed.
2025-09-22 05:38:06 +00:00
Mathias Agopian
e982d8a3c6 pass backend tags by && reference
This saves a CString copy on the backend side and this forces the
frontend to make a copy explicitly.

In theory the CString should now ever be copied just once.
2025-09-19 15:25:31 -07:00
Mathias Agopian
9267563af2 fix clang-tidy warnings 2025-09-19 15:25:31 -07:00
Filament Bot
333d01a0a5 [automated] Updating /docs due to commit 24a6bd3
Full commit hash is 24a6bd30f9

DOCS_ALLOW_DIRECT_EDITS
2025-09-19 15:46:12 +00:00
Sungun Park
24a6bd30f9 Release Filament 1.65.1 2025-09-19 15:42:25 +00:00
Sungun Park
fdc0bc472d Revert workaround default to ALL (#9233)
This makes artifacts on certain mobile devices. Revert them back to ALL.

BUGS=[445721121]
2025-09-18 23:45:08 -07:00
Mathias Agopian
a791665a2c remove the limit to 48 material parameters
FIXES=[445698638]
2025-09-18 17:28:20 -07:00
Powei Feng
20fcce13a4 docs: fix broken renderdiff link 2025-09-18 14:52:17 -07:00
Powei Feng
8233ab1cda Revert "[automated] Updating /docs due to commit 60df8ac"
This reverts commit 656a4b6f32.
2025-09-18 14:40:07 -07:00
Filament Bot
656a4b6f32 [automated] Updating /docs due to commit 60df8ac
Full commit hash is 60df8ac6b8

DOCS_ALLOW_DIRECT_EDITS
2025-09-18 21:32:03 +00:00
Powei Feng
60df8ac6b8 renderdiff: enable webgpu and improvements (#9219)
- Allow for presets to override selected models when presented
   in order.
 - Add 'gltf' for model search path
 - Add a few simple gltf models to the 'base' preset
 - Improve UI so that missing tests do not generate any html
   bits.
 - Add documentation on using the viewer
 - Add renderdiff documentation to the project webpage.

RDIFF_BRANCH=pf/renderdiff-enable-webgpu
2025-09-18 21:29:00 +00:00
Ben Doherty
1fb3d48e90 Fix Metal LoadImageTest.UpdateImageMipLevel (#9229) 2025-09-18 13:57:36 -07:00
Powei Feng
b47110c339 backend: fix read pixels test for vk (#9223)
- The vk readPixels relies heavily on DataReshaper to transform
   the output into the client's requested format. We make
   additions to the DataReshaper to address previously unavailable
   features:
     - A copy for half floats - Assuming input and output are
       both half floats.  We just do memcpy.
     - Reshaping with respect to PixelBufferDescriptor's top and
       left parameters.
 - On the test side, we do a bit of clean-up and add the ability
   to export image correctly when the PBD has dimensions different
   from the readRect and/or non-zero offsets.
 - Also re-enable two LoadImage tests.
2025-09-18 19:53:19 +00:00
Mathias Agopian
10f4632c88 small math::mat3f to GL mat3 optimizations 2025-09-18 12:15:56 -07:00
Mathias Agopian
6dbd702bb5 fix OpenGL backend tests on macOS
multi-sampled textures are only supported at feature level 2, but
on macOS OpenGL is only feature level 1.
2025-09-17 18:11:51 -07:00
Powei Feng
0dd1d3211b backend: fix scissor viewport region test (#9220)
Make sure that the rendertarget dimensions matches the texture
dimensions. Update the expected image for the test.

Also fixed usage, rendertarget parameters to make sure vk does
not have any validation errors.
2025-09-17 21:58:50 +00:00
Filament Bot
33249c6eb8 [automated] Updating /docs due to commit 59f19ae
Full commit hash is 59f19aee0e

DOCS_ALLOW_DIRECT_EDITS
2025-09-16 17:44:15 +00:00
Ben Doherty
59f19aee0e Add documentation and script to publish to Maven Central (#9216) 2025-09-16 13:41:06 -04:00
Sungun Park
06c8fc39c2 Update MATERIAL_VERSION to 64 2025-09-16 10:08:23 -07:00
Powei Feng
a36ad004b7 renderdiff: add ability to diff arbitrary rendered images (#9211)
Add a way to show the difference between two rendererd image.
This is a convenience feature to see the differences between
backends.

Refactor the ExpandedFailedResult to use this new view.
2025-09-16 00:27:42 +00:00
Ivan Mikhalchuk
6ac5f26bb5 fix UB in AtomicFreeList::push and FreeList::push: access to non-static data member without proper lifetime management 2025-09-15 08:50:02 -07:00