Commit Graph
7405 Commits
Author SHA1 Message Date
Powei Feng c8ab2f335e Fix places where generateMipmaps is called without proper usage (#9054) 2025-08-07 22:24:40 +00:00
Mathias Agopian db14efc151 compress the DFG LUT with zstd
- use resgen to package the DFG LUT into filament, instead of using
  a large include of a C array.

- add a zstd compression step, which reduces the size from ~100KB to
  ~75KB.

The overhead of zstd is about 90KB uncompressed, however it will pay
for itself tenfold when we use it to compress material packages.
2025-08-07 14:58:18 -07:00
Mathias Agopian d1ca059dad resgen: add compression options
- with `-z` each resource is compressed individually
- with `-Z` the whole package is compressed
2025-08-07 14:58:18 -07:00
Mathias Agopian c71a22914f small improvements to cmgen
- when generating the DFG LUT as a text file, make sure to faithfully
  reproduce the command used in the comments

- add a "bin" format that will output a headerless raw binary of the
  LUT data.
2025-08-07 14:58:18 -07:00
Mathias Agopian 71d0723026 add zstd to the build 2025-08-07 14:58:18 -07:00
Powei Feng 5c371089f2 Add GEN_MIPMAPPABLE TextureUsage (#9042)
This will allow for more backend-specific usage mapping then before - where BLIT_SRC and BLIT_DST are assumed for textures whose mipmaps will be generated.

These mappings have been introduced in metal, vulkan, webgpu.
2025-08-07 18:14:49 +00:00
Konrad Piascik 2c7064e93d webgpu: skip PushConstants backend test for webgpu
We can revert this once dawn supports push constants
2025-08-07 11:07:02 -04:00
Filament Bot 3961989aca [automated] Updating /docs due to commit b92af35
Full commit hash is b92af357f7

DOCS_ALLOW_DIRECT_EDITS
2025-08-07 08:36:16 +00:00
Mathias Agopian b92af357f7 add a material option to use linear fog calculations (#9030)
The new `linearFog` material property, when set to `true` enables a
simplified fog calculation. The fog equation becomes linear which is
unrealistic, but more efficient to compute. In some situations with
a shallow fog range, it doesn't make a huge difference visually.

In this mode, height falloff and in-scattering are ignored.

The linear equation slope is calculated from the regular parameters to
match the slope of the real equation at a camera height. If 
`heightFalloff` is disabled, set to 0, the `density` parameter 
exactly corresponds to the slope of the equation in [1/m] units.
2025-08-07 01:33:36 -07:00
Mathias Agopian f2a1051df9 add CanonicalizePass optimization
this makes all spirv IDs much more stable which greatly improve the
utilization of the line dictionary.
2025-08-07 01:32:31 -07:00
Mathias Agopian 594ab3e9e3 spirv-tools update to vulkan-sdk-1.4.321.0 2025-08-07 01:32:31 -07:00
Mathias Agopian 7f18c7fd43 fix -d (matdbg) build option
There was two problems:
- tint was needed regardless of webgpu support
- libfilamat wasn't built on the android side
  (I don't know how it ever worked)
2025-08-06 17:29:51 -07:00
Powei Feng 9c1a252ba5 Fix two compilation errors (#9041)
- Include <limits> in bitset.h
- The type could not be inferred for Scene.cpp's `SharedState`
  line.  The failure came from clang version 1:14.0-55~exp2
2025-08-06 22:22:40 +00:00
Juan Caldas bf8e798b60 webgpu: Set Layercount to 1 instead of 0 (#9038)
part of BUGS = [424157731]
2025-08-06 22:00:25 +00:00
Eliza Velasquez b94e90416a Fix build breakage 2025-08-06 14:33:53 -07:00
Andy Hovingh e9fde8346e wgpu: fix test seg fault due to null descriptor set layout label 2025-08-06 16:31:44 -05:00
Andy Hovingh 3ae747b544 wgpu: remove assumption default render target is present in makeCurrent(...) 2025-08-06 16:31:44 -05:00
Eliza 5924633085 gl: amortize shader compilation over N frames (#8964)
* gl: amortize shader compilation over N frames

On platforms which don't support parallel shader compilation (e.g. Firefox), we
can sort of emulate it by queueing up any requests to `Material::compile()` and
compiling each shader over multiple frames.

Compiling over consecutive frames slows things quite noticeably. Instead, space
each compilation over a number of ticks (16 chosen arbitrarily).

If we need a program NOW, we can bump a program queued for much later to the
front. We also avoid compiling any queued programs on this same frame to limit
stuttering.

* gl: add flag to disable amortized shader compile

If this flag is on, the new amortized compile code should theoretically never be
executed.

* gl: add CompilerPriorityQueue docs, Java API

* gl: amortize shaders, z3moon feedback

* gl: update CompilerThreadPool
2025-08-06 21:09:27 +00:00
Juan Caldas a07c19e5b7 Add missing WebGPU checks (#9037)
part of BUGS = [424157731]
2025-08-06 16:18:18 -04:00
Filament Bot 59f4d1ba20 [automated] Updating /docs due to commit ac076e8
Full commit hash is ac076e872e

DOCS_ALLOW_DIRECT_EDITS
2025-08-06 06:03:06 +00:00
Powei Feng ac076e872e Release Filament 1.63.0 2025-08-05 22:59:34 -07:00
Matthew Hoffman 9e55331801 Backend tests using webgpu (#8823)
BUGS = [424157731]
2025-08-06 00:19:13 +00:00
Powei Feng f70a11ced4 Feature flag guard compat check of material instance and desc-set (#9035)
This will allow clients more time to correct their code.
2025-08-05 16:34:53 -07:00
Andy Hovingh 455545f024 wgpu: fix ssao bent normals 2025-08-05 16:35:25 -05:00
Andy Hovingh f35ec42125 bilateral blur & shadow map materials require unfilterable samplers
This fixes the Display Shader Texture with the WebGPU implementation.
2025-08-05 16:05:07 -05:00
Powei Feng 4242bc43fd utils: add precond/postcond macro guarded by feature flags
We link the behavior of certain precondition/postcondition checks to feature flag states.

- If provided *flag* is true, then this macro will assert when the *condition* is false.
- If provided *flag* is fase, then this macro will output a warning when the condition is false.
- If the condition is true, then neither of the above will happen

These two macros will enable us to provide less restrictive behavior for certain correctness assertions, allowing clients to modify their before enabling these assertions by default.
2025-08-05 20:48:13 +00:00
Mathias Agopian bbe6d35bf2 fix typo in gtao material 2025-08-05 12:59:24 -07:00
Andy Hovingh c8894521c8 webgpu: add visibility for debugging bind groups via logging (compile-time flag option) 2025-08-05 12:42:40 -05:00
Ben Doherty a2475b5dcb Use default descriptor set for shared material variants (#9025) 2025-08-04 10:27:05 -07:00
Andy Hovingh b7b89168a7 webgpu: support depth in blit + copy when we can. 2025-08-04 10:02:09 -05:00
Powei Feng 79551eacb2 Update MATERIAL_VERSION to 63 2025-08-03 22:56:09 -07:00
Powei Feng e181c74b6c Fix matp test typo 2025-08-01 16:27:35 -07:00
Powei Feng 418704dbb1 Test matp instead matc 2025-08-01 16:25:41 -07:00
Yein Jo eeb4fe219b Restore test files and moved to matp 2025-08-01 15:57:23 -07:00
Yein Jo 7d227630fc fix max line 2025-08-01 15:57:23 -07:00
Yein Jo d84e42861c Fix includes 2025-08-01 15:57:23 -07:00
Yein Jo 3a75dc6d2d Move some classes to private 2025-08-01 15:57:23 -07:00
Yein Jo 66b67849af Extract material parse logic to filament-matp 2025-08-01 15:57:23 -07:00
Powei Feng ba5900efcf webgpu: descriptor set unbind on null handle 2025-08-01 14:42:58 -07:00
Powei Feng 2d518b5fd1 ppm: ensure a renderable descriptor set is bound
- We set a dummy set at the renderable bind point for
   post-processing passes, since it is not used.
2025-08-01 14:42:58 -07:00
Mathias Agopian ee8d0e6ebf remove fake dependencies on the PER_VIEW UBO
The PER_VIEW UBO was updated by different render passes at different
times, which created synchronizations on the GPU, between unrelated
passes and prevented the vertex shader to run on parallel with another
pass for instance.

In the PR, we fix this by moving ALL the UBO set-up outside of 
render passes. It's now done early, just before creating the framegraph.

The PER_VIEW UBO is shared between several passes, themselves using
different descriptor sets; so we need to make sure all the data
necessary for these passes is computed and set in the UBO (e.g. SSR
passes).

The passes themselves (like the color pass) still set the textures and
UBOs in their descriptor sets, but then no longer updated the content
of the UBO itself.

In this PR we also remove some "fake" dependencies between passes due
to descriptor sets straddling between passes. This is done by unbinding
all descriptor sets at the end of each pass. The PER_MATERIAL descriptor
set is a bit special because it should be unbound between full screen
quads draws.

Additionally, there some places in the code attempting to update
UBOs only when the content was dirty were missing a "clean" call, to
reset the dirty bit to the unset state.

The main change here is to move the code that set the UBO content out
of the ColorPassDescriptorSet (and a few other) into View and instead of
updating the content in the color pass (and a few other), do that at
the beginning of Renderer::render().
2025-08-01 14:01:17 -07:00
Mathias Agopian b4c9b9f489 renderStandaloneView() needs a driver and engine flush 2025-07-31 12:10:23 -07:00
Mathias Agopian e59972b41f unbind descriptor-sets after renderpasses
this prevents a false dependency with the next pass and keeps us
honest about what resources we're using.
2025-07-31 12:10:06 -07:00
Powei Feng 5fb9fad3ce vk: fix broken iblprefilter path (#9019)
The issue is that we need to reset the bound info in
VulkanDescriptorSetCache when the current command buffer completes
recording.
2025-07-31 10:45:34 -07:00
Filament Bot 44bbab158b [automated] Updating /docs due to commit bbced6d
Full commit hash is bbced6d59d

DOCS_ALLOW_DIRECT_EDITS
2025-07-31 17:31:35 +00:00
Benjamin Doherty bbced6d59d Release Filament 1.62.2 2025-07-31 10:27:23 -07:00
Doris Wu 433fded025 Workaround the skybox issue on webgl build (#8974) (BUGS=419664914)
* duplicate the material instance in webgl

* Use default instance

* Update comments

* Update

* Address the comments

* Update the naming
2025-07-31 01:56:07 +00:00
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