Commit Graph
7358 Commits
Author SHA1 Message Date
Sungun Park 86d19e53ea gl: Cleanup code flow in ShaderCompilerService (#9014) 2025-07-31 01:02:24 +00:00
Mathias Agopian 70d41664b5 Add Renderer::shouldRenderFrame() API
FIXES=[410463814]
2025-07-30 15:32:23 -07:00
Juan Caldas 08c783e05f Pass extent for non headless 2025-07-30 13:03:33 -05:00
Ben Doherty ce5c6e3aec Fix incorrect buffer size and memory free issue with prefilter mipmap (#9009) 2025-07-30 10:31:41 -07:00
Juan Caldas 2e6ac18d03 webgpu: support blit 2025-07-30 11:52:35 -05:00
Powei Feng 4b4dd3b70e ppm: add fixed material instance references (#9008)
In the introduction of MaterialInstanceManager, the assumption is
that everytime PostprocessManager wants an instance, we can just
provide a "new" one since all of the instance's content - UBOS,
textures - will not be shared between passes.  But this is not
the right assumption. For `colorGradingPrepareSubpass` and
`customResolvePrepareSubpass`, they are filling in an instance
for later passes to use.

To address this, we add a way to identify a fixed instance in
MaterialInstanceManager. This will allow us to refer to specific
instances of a material across passes (for the duration of a
frame).

This address the following crashes:
 - Enabling custom resolve for MSAA for the metal backend
 - Resizing the gltf_viewer window

Also move the dof instance into the loop to prevent UBO reuse.

Remove instance dependencies in Gaussian Blur Pass (separable).
2025-07-30 05:02:30 +00:00
Mathias Agopian 0976542d67 remove the explicit command queue flushes
Filament used to issue command queue flushes (E.g. glFlush()) after
large passes like the color pass in order to kick the gpu into action
sooner and reduce latency.  This however comes at a high cost on the
gpu timeline as command queue flushes are expensive on vulkan and 
metal. Moreover GL drivers are allowed to ignore glFlush().

So we just remove all these calls.
2025-07-29 16:35:22 -07:00
Sungun Park b51e7f8b50 gl: Expedite shader cancellation in THREAD_POOL mode (#9002)
Previously, cancelling shader compilation tokens in THREAD_POOL mode
would block the engine thread until GL resource loading completed. This
led to unexpected application stalls when numerous shaders were
simultaneously cancelled.

This change moves the token cancellation logic to the compiler thread.
By marking tokens for asynchronous cancellation, we prevent unwanted
main thread stalls, ensuring a smoother user experience during bulk
shader cancellation.

BUGS=[430068776]
2025-07-29 21:38:23 +00:00
Powei Feng b0e2f3a91a ppm: remove incorrectly checked in files 2025-07-29 13:04:25 -07:00
Ben Doherty c25ac68a3a Better set default shader stages for samplers (#8992) 2025-07-29 10:01:36 -07:00
Powei Feng 0f572f797d utils: add method for index of first set bit in bitset (#9006) 2025-07-28 19:58:40 +00:00
Powei Feng 8600295ba4 webgpu: flush before reading pixels (#9003)
- Implement finish() to block until GPU work is done.
 - Implement flush() has the old finish() logic
 - Add flush() before reading pixels
2025-07-28 17:44:23 +00:00
Powei Feng e4aeca28ec matdbg: update monaco dep (#8997)
- Update the monaco editor to the latest available version
   (0.52.2)
- Disable formatting for webgpu since it's already formatted
2025-07-26 00:07:47 +00:00
Filament Bot f14ff6606a [automated] Updating /docs due to commit 5628b8b
Full commit hash is 5628b8b6e7

DOCS_ALLOW_DIRECT_EDITS
2025-07-25 23:31:26 +00:00
Powei Feng 5628b8b6e7 docs: add framegraph to notes (#8987) 2025-07-25 23:28:22 +00:00
Filament Bot c7b919a065 [automated] Updating /docs due to commit 45e74c2
Full commit hash is 45e74c279f

DOCS_ALLOW_DIRECT_EDITS
2025-07-25 23:10:16 +00:00
Powei Feng 45e74c279f docs: add material properties page (#8980)
This is to replace the original "Material Properties.pdf".
2025-07-25 23:07:40 +00:00
Powei Feng 26b68d9654 PPM: add material instance caching (#8988)
We add a class to manage a cache of material instances mapped by
materials. This allows us to re-use instances across frames. Note
hat also it's possible for the same frame to want to use the same
instance multiple times (for example for bilateral blurring or
upsampling), but we allocate separate instances for that case so
that UBOs are not shared across render passes. This allows for
bubble-reduction for vulkan (and possibly other backends).
2025-07-25 22:47:50 +00:00
Powei Feng 8e8f6ad8a4 Update remote UI 2025-07-25 15:27:33 -07:00
Mathias Agopian 9b4ddb9353 update remote UI 2025-07-25 15:24:08 -07:00
Mathias Agopian d7ef6665cc a hybrid instancing sample 2025-07-25 15:03:12 -07:00
chenriji 7048a9847a fixbug: The material Material_MR has not been compiled to include the required GLSL or SPIR-V chunks for the vertex shader (variant=5, filtered=5)
Because the member variable mVariantFilter is not initialized, random values will appear on Windows 10 or others platform, which eventually causes some variants to be filtered out by this mVariantFilter. (#9000)
2025-07-25 11:07:02 -07:00
Powei Feng ff13035aab vk: fix leak in VulkanDescriptorSetCache (#9001)
PR #8946 fixed the caching logic in commit(), but in turn, created
a leak on terminate(). We proplery clean-up on terminate().
2025-07-25 17:19:16 +00:00
bridgewaterrobbie a530497755 webgpu: Implement readPixels 2025-07-25 12:52:11 -04:00
Mathias Agopian de6f7b56da move the management of the InstanceBuffer's UBO into InstanceBuffer
For some reason the UBO was managed by RenderableManager, but it's a
lot cleaner and easier to have this done by InstanceBuffer itself.
2025-07-25 00:36:05 -07:00
Mathias Agopian 2c60740edd cleanup and missing includes 2025-07-25 00:36:05 -07:00
granade-work 660bb5f8fe Add per-byte image comparison to backend tests (#8949)
BUGS=[398199436]
2025-07-24 11:53:19 -07:00
Powei Feng 514ad6ad16 vk: better choice for semaphore wait stage (#8993)
Previously we always waited on the semaphore at
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT. If we be a little bit more
specific for the "in-frame" wait (between two command buffers
within a frame), we can allow for better parallelism.
2025-07-24 17:15:03 +00:00
Powei Feng d339c9d8ca ppm: Use structure descriptor per-view set where appropriate (#8991)
We use it in
 - StructureMipMap
 - Separable Blur Pass
 - Depth Blit (Shader)

These two passes come before the color pass, but the color pass
needs to write the buffer that is referenced by the post-processing
descriptor set. So we set these passes to use the
StructureDescriptorSet (which has its own UBO). This removes a
synchronization dependency between these two passes and the color
pass.
2025-07-24 16:48:33 +00:00
Mathias Agopian 8d88abacf4 add unit tests for CommandBufferQueue and CircularBuffer 2025-07-24 09:29:33 -07:00
Mathias Agopian 8982d7161e add a unit test for Bimap
- rename find(Value&) to findValue() to avoid issues if the key and
values have the same type.

- fix a leak if Bitmap is destroyed and not empty (thankfully this
didn't happen in practice in filament, because the Bimap was always
empty when destroyed)

- fix a use after free in erase. we were destroying the Key before
removing it from the maps, which theoretically could need to access
them.

- slightly improved the API and added some comments about preconditions.
2025-07-24 09:29:06 -07:00
Ben Doherty 1f8248ba99 Metal: re-enable fastmath (#8911) 2025-07-23 13:46:43 -07:00
Doris Wu 04f7837439 Set the blend enabled field (#8983) 2025-07-23 04:57:42 +00:00
Mathias Agopian 85d00831bc minor cleanup and missing includes 2025-07-22 16:53:42 -07:00
Mathias Agopian 4d8f92f087 per-material globals weren't set when generating shadow maps 2025-07-22 16:53:42 -07:00
Mathias Agopian 5850a7eee4 use a separate UBO for the postfx user passes
some of the postfx passes (picking, ssao, structure) are user passes
because they call user materials; these now use their own ubo, which 
should prevent us from having to update a UBO mid frame.
2025-07-22 16:53:42 -07:00
Mathias Agopian 1b2620cdf3 cleanup-up how we update the per-view UBO
The per-view UBO is used in several different contexts, for instance:
- during the color pass
- during the shadow pass
- during the structure pass
- during app postfx passes

For shadows and other passes, its content is actually different because
the camera is very different. In that case, we use a different buffer.

However, the code that was used to set the values into the UBO was
duplicated and did slightly different things. In addition some
UBO values were (and are still) probably missing (e.g. the per-material
data).

To improve this situation we new use a utility class that does the
UBO set up of those "shared" values.

It turns out that the structure, ssr and ssao passes also need a 
slightly different content (because they run at half res) and currently
are sharing the color pass UBO, which causes mid-frame updates.

We introduce a new StructureDescriptorSet which is managing a new UBO,
it too is now implemented in terms of the new utility class. 
StructureDescriptorSet Is not used yet.
2025-07-22 16:53:42 -07:00
Mathias Agopian ddca795cc9 cleanup resgen code
A test for how Gemini can clean-up code. Changes:

- Configuration Struct: Global variables have been grouped into an 
AppConfig struct. This makes the program's configuration explicit and 
avoids polluting the global namespace.

- Clearer Argument Parsing: The handleArguments function now returns an 
AppConfig object, encapsulating all parsing logic and making the main 
function cleaner.

- Helper Functions: Repetitive tasks like string replacement, file I/O, 
and writing file entries have been extracted into small, well-defined 
helper functions (replaceAll, openOutputFile, readFile, etc.).

- Simplified main Function: The main function is now a high-level 
coordinator, delegating work to helper functions. This makes the overall
 program flow much easier to follow.

- Modern C++ Idioms: The code now consistently uses C++ streams 
(std::cout, std::ofstream) and std::string objects, which is more 
idiomatic than a mix of C and C++ styles.

- added short comments
2025-07-22 16:52:11 -07:00
Powei Feng 3a5f558874 vk: VulkanBuffer cannot skip staging buffer after a read (#8946)
The previous introduction of VulkanBufferProxy uses the refcount of
the backing VulkanBuffer as an indication whether there's a write
in progress or not. But we also want to make sure there is no
read in progress (i.e. not referenced in a descriptor set). This
commit fixes the bookkeeping while trying to clean up the relevant
structs.

We add logic to track whether a UBO is actively been read (i.e.
bound to a descriptor set that is itself bound to a command buffer).
2025-07-22 21:47:45 +00:00
Powei Feng 13629ed93a vk: add feature flag for staging buffer bypass (#8958)
- Add a feature flag for bypassing staging buffer for buffer
   updates.  Note that this was assumed on for UMA devices, but
   can cause issue with post-processing.  So now we default the
   path to off and clients can enable it via feature flag.
 - Remove FVK_FORCE_STAGING_FOR_BUFFER_UPDATES since it's intended
   use is subsumed by vulkan_enable_staging_buffer_bypass.
 - Small refactor of FEngine for creating
   backend::Platform::DriverConfig.
2025-07-22 19:33:08 +00:00
Powei Feng b129e5df4a renderdiff: fix upload issue second try (#8972)
- Move upload step to later so that comparison result is also
    included in the upload
 - Fix the wrong relative paths in the comparison_result.json
 - Fix viewer logic to pick only the latest run for a PR.
2025-07-22 18:47:18 +00:00
Mathias Agopian 2abacaa030 the ssr-history texture is not an array
the descriptor used for SSR is different depending on the pass. In
the color pass, it's used as the source of the SSRs buffers and is an
array (refraction & reflection). In the SSR pass it's the history
buffer and is just a 2D texture.
2025-07-22 10:08:22 -07:00
Powei Feng 9a88537e08 Fix dangling material reference after desctruction (#8977)
The invocable sent to Program::diagnostic contains a reference
to Material, which could be destroyed by the time the invocable
is called. We make sure that invocable does not have a reference.
2025-07-22 05:34:52 +00:00
Powei Feng 9640f2656f Make sure structure textures are unfilterable 2025-07-21 21:22:47 -07:00
Powei Feng 2811b064a9 vk: fix include for Definitions (#8954)
be more specific in the `utils` include.
2025-07-21 20:51:56 +00:00
Juan Caldas 94ea4da9dd webgpu: Create command encoder and pass arrayLayerCount (#8969)
BUGS = [432262069]
2025-07-18 22:11:35 +00:00
Filament Bot eee6fba9a8 [automated] Updating /docs due to commit e893637
Full commit hash is e89363751d

DOCS_ALLOW_DIRECT_EDITS
2025-07-18 21:02:40 +00:00
Powei Feng e89363751d docs: various updates and improvements (#8971)
- Add github link to page
 - Fix link in contributing.md
 - Small update to docs_src/README.md
 - Remove logo in the core docs
 - Move branching.md and release_guide.md to /docs_src
 - Add "under construction" warning for the web samples
 - Update matdbg README.md
2025-07-18 21:00:25 +00:00
Sungun Park 8636f11d73 Fix handle allocator (#8970)
Use the right type for the index to prevent the value from being
truncated.
2025-07-18 18:07:05 +00:00
Powei Feng f499103ac8 docs: remove deprecated site generation code (#8968)
- Remove build.sh option for turning markdeep docs into html.
   This is subsumed by workflow in docs_src
- Remove old hugo templating path. This is also subsumed by
   docs_src.
2025-07-18 17:46:03 +00:00