Commit Graph

7421 Commits

Author SHA1 Message Date
Powei Feng
bc83ffdcd1 vk: make default render target independent of call order (#9065) 2025-08-11 20:27:53 +00:00
Powei Feng
c21f211a13 Update java for Texture::Usage (#9055)
Also update samples and utils to use proper usage when
generating mipmaps.
2025-08-11 19:47:26 +00:00
Patrik Huber
58d4671c24 Fixes to frame_generator sample (#9050)
* [Fix] frame_generator sample: open ifstream with ios::binary
* [Fix] frame_generator sample: allocate storage for g_materialBuffer
   reserve() merely reserves memory, but does not actually change the size of the vector.
* [Fix] frame_generator sample: destroy materials/renderables during cleanup

Otherwise the sample crashes with a Filament error saying that the material is still associated with a renderable.
2025-08-11 19:21:05 +00:00
Mathias Agopian
93caca7245 fig materialparser assert when shader is not present 2025-08-11 11:11:42 -07:00
Mathias Agopian
bf77c023b9 correctly set STENCIL Usage on color pass texture
the framegraph didn't set the Usage::Stencil on textures it created
for the color pass if stencil was requested. On the GL backend it
didn't matter because that bit is unused.
2025-08-11 11:11:22 -07:00
yein
95128d5f55 Follow up of material parser PR (#9029)
- Fix CMakeLists to correctly include src files in matp test
- Replace std::string to std::string_view
- Also update the test_includer.cpp
2025-08-11 18:05:10 +00:00
Powei Feng
6d17d858de vk: Fix bad layouts/formats when doing generateMipmaps (#9058)
- After genMipmap, transition to shader read layout
- Ensure that the staging image format is TRANSFER_SRC.
2025-08-11 17:49:15 +00:00
Sungun Park
05003ea358 mat: Add CRC32 validation for material packages (#9053)
This commit introduces a CRC32 checksum to material packages to ensure
data integrity.

When a material is loaded, this checksum is verified. If the check
fails, an error is logged, and the material fails to load. For older
material packages without a CRC32 checksum, a warning is logged and
proceed.

BUGS=[373396840]
2025-08-09 00:03:56 +00:00
Matthew Hoffman
98847d6509 Simplify backend tests' EXPECT_IMAGE invocation. (#9052) 2025-08-08 21:55:37 +00:00
Mathias Agopian
d3828cdd1c fix the 3-parameters fresnel calculation
it would automatically degrade to the 2-parameters version in 
LOW_QUALITY mode, but some other code relied on the proper calculation,
in particular when specularFactor was used.


FIXES=[436866605]
2025-08-08 14:18:15 -07:00
Andy Hovingh
4beda6feee wgpu: fix Android build error 2025-08-08 15:32:18 -05:00
Juan Caldas
7cacef9509 Update GLSL for mip test (#9064) 2025-08-08 15:09:27 -04:00
Juan Caldas
5cd7de7318 Change fogReserved 2025-08-08 10:44:54 -07:00
Sungun Park
9c87e72a81 Correct warning message (#9059)
The subsequent call

`glGetShaderiv(shader, GL_COMPILE_STATUS, &status);`

will ensure the compilation is complete.
2025-08-07 22:35:26 -07:00
Filament Bot
652d973ad8 [automated] Updating /docs due to commit 8466177
Full commit hash is 84661777e7

DOCS_ALLOW_DIRECT_EDITS
2025-08-07 22:52:23 +00:00
Ben Doherty
84661777e7 Materials: add useDefaultDepthVariant flag (#9020) 2025-08-07 22:49:05 +00:00
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