Commit Graph

2028 Commits

Author SHA1 Message Date
Powei Feng
42ce76e285 Update MaterialVersion to 58 2025-03-26 10:56:33 -07:00
Mathias Agopian
8f58743405 support up to five custom varyings
Five custom variables (varyings) are now available on the condition that
the `color` attribute is not requested.

FIXES=[404930099]
2025-03-24 09:38:31 -07:00
Doris Wu
d2d5d62a20 Some cleanups (#8558)
* Clean up includes

* Fix the logic
2025-03-22 00:17:22 +08:00
Doris Wu
5e9be5dd2d Remove trailing whitespace (#8556) 2025-03-21 02:10:05 +00:00
Powei Feng
df897b3fb2 osmesa: Enable Mesa/OSMesa rendering for mac (#8530)
This commit enables local running of the renderdiff tests and also
for github workflows.
2025-03-20 22:37:23 +00:00
Mathias Agopian
6b91f30389 Materials can now specify a shadow attenuation factor (#8540)
* Materials can now specify a shadow strength factor

Materials have a new property: shadowStrength that can be used to
attenuate all shadows received by this material. e.g.:

```
void material(inout MaterialInputs material) {
  prepareMaterial(material);
  material. shadowStrength = 0.1;
}
```

FIXES=[391663042]

Co-authored-by: Powei Feng <powei@google.com>

---------

Co-authored-by: Powei Feng <powei@google.com>
2025-03-20 14:03:52 -07:00
Doris Wu
4db3cc521b Move includes outside fgviewer namespace (#8543) 2025-03-19 13:42:34 +08:00
Randy Reyes
e6b18b4560 webgpu: enable unpacking WGSL code in filamat 2025-03-18 10:25:10 -07:00
bridgewaterrobbie
84cce8cfdf Run dead code elimination for WGSL even if all other optimizations are disabled 2025-03-17 15:16:19 -04:00
bridgewaterrobbie
606a1259f6 Avoid generating subpass code if using WebGPU
Subpasses should not be used anyways due to the result of WebGPUDriver::isFrameBufferFetchSupported. However, we need to make sure the GLSL is not generated for WebGPU, or Tint is unable to convert.
2025-03-14 13:17:23 -04:00
Powei Feng
e3b7861aa2 webgpu: combine tint static libs into single lib (#8520) 2025-03-13 17:57:25 +00:00
Powei Feng
5f730ac173 osmesa: allow static linking of osmesa (#8486)
- Add path for static linking
- Fix get_mesa script.
2025-03-12 21:00:22 +00:00
Doris Wu
78487f4836 [fgviewer] Collapse subresources by default in web view (#8517)
* Collapse subresources by default

* Fix typo
2025-03-12 14:58:54 +00:00
bridgewaterrobbie
dacd03ce42 Adjust running the test to fail on 0 tests. This is to ensure we don't pass the test due to the webgpu build failing or similar 2025-03-11 17:40:21 -04:00
bridgewaterrobbie
c9cfc63df0 Add tests to convert sample shaders with Tint to WGSL 2025-03-11 17:40:21 -04:00
Juan David Caldas
9c69cb8484 Enable WebGPU option for matc and add WGSL options for shader generation 2025-03-11 17:40:21 -04:00
Powei Feng
e825f43935 matdbg: indicate shader model (#8504)
Shader model (desktop or mobile) wasn't really accounted for
in the UI. This means that we will get shaders that look like
duplicates (same variant). In this work, we pass the current
shader model from engine into the frontend and filter out
variants of a different shader model.

Moreover, for matinfo, we use a specific dbg shader model (matinfo)
to indicate it is in that mode. We add UI in matinfo to show the
shadermodel.

So UI updates as well.
2025-03-07 23:54:22 +00:00
Powei Feng
5091b3112d matdbg: fix variant issue for surface materials (#8503)
- The set of active variants were not set correctly for surface
   materials since the frag/vert pairs could have different
   variant.
 - Fix the default selection logic in the UI
 - Random clean-ups

FIXES=328699979
2025-03-07 17:46:04 +00:00
bridgewaterrobbie
d0a00803c1 Restore workaround for CONFIG_MAX_INSTANCES and CONFIG_FROXEL_BUFFER_HEIGHT not being a spec constant, because WGSL does not support that being an array length (#8479) 2025-03-07 00:28:36 +00:00
bridgewaterrobbie
74b09c708a Enable TINT_BUILD_SPV_READER on host platform webgpu builds 2025-03-06 17:12:03 -05:00
bridgewaterrobbie
80e0dbaa8a When preprocess fails, return false from process 2025-03-06 17:12:03 -05:00
bridgewaterrobbie
31e966f63f Add initial Tint support for shader transpile
Early version that will allow errors to be ignored currently, outputting what we can into filamat results.
2025-03-06 17:12:03 -05:00
Ajmal Kunnummal
02223dcaab Add a way to specify an additional uniform name along with a sampler param for the associated transform matrix (#8490)
BUGS=[399959254]
2025-03-06 18:42:24 +00:00
HanYunChenLuo
30bb4ad6eb fix SourceFormatter.h missing header file (#8498)
missing <string>
2025-03-06 09:22:29 -08:00
Doris Wu
d9e30460dc Enable fgviewer for android remote debugging (#8483)
* Enable fgviewer for the users

* Fix incorrect position

* Update

* Support remote debug server

* Enable fgviewer on android

* Link and include fgviewer_resources

* Adjust js to show untitled view
2025-03-06 05:36:41 +00:00
Doris Wu
075743ef59 Aggregate the subresource usage when collapsed (#8492) 2025-03-06 02:08:55 +00:00
Syed Idris Shah
86e71f37ae Add WebGPU stub backend code.
Introduce Enums to support WebGPU.
Start to use header files from dawn.
2025-03-04 22:09:19 -05:00
Doris Wu
44883fe5fc Add README.md (#8485) 2025-03-05 00:55:06 +00:00
Doris Wu
d0910b3fb6 Add resource details display to fgviewer web view (#8469)
* Add resource detail

* Add to_string for texture format

* Fix the type of currentResourceId

* Update

* Refactoring

* More refactoring

* Rename some properties

* Rename a function

* Address the comment

* Update the comment and remove if statement

* Fix indent
2025-03-01 02:54:54 +00:00
Amin Ya
ad2fdb4663 fix: const cast pair.first access for mg_websocket_write (#8264)
Co-authored-by: Powei Feng <powei@google.com>
2025-02-27 22:28:04 +00:00
bridgewaterrobbie
17091df8dc Update abseil version to match Dawn requirements 2025-02-27 14:22:41 -05:00
Powei Feng
db30a9a50c viewer: add option to export TIFF in automation (#8472)
PPM does not store alpha channel, but TIFF does.  We add a method
to export RGBA to a TIFF file without compression.

We add the corresponding options to gltf_viewer and
AutomationEngine.

The default export format for both gltf_viewer and AutomationEngine
is now TIFF.
2025-02-27 18:54:37 +00:00
Powei Feng
db29b87647 gltfio: allow for multiple color attributes (#8462)
We are not correctly handling gltf models with multiple color
attributes. Filament doesn't allow for more than one color
attribute.  So we just set the additional attributes as
VertexAttribute::CUSOM(N).

Fixes #8396
2025-02-27 06:50:21 +00:00
Powei Feng
dc7eee0896 filamat: fix ubsan failure (#8461)
Enabling UBSan shows the following error:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior filamat/src/eiff/Flattener.h:102:17 in
filamat/src/eiff/Flattener.h:102:17: runtime error: applying non-zero offset 8 to null pointer

We reference a placeholder byte on the heap when in DryRunner mode
to workaround this issue.
2025-02-27 03:55:30 +00:00
Powei Feng
defba23030 build: remove ios build dependency on filamat (#8465)
We are in the process of updating glslang, which requires

set(IOS_MIN_TARGET "13.0")

This is a problem since we are targeting iOS 11 in general.
glslang is a filamat depedency, and we're building filamat for
iOS for the iOS version of the backend test.

So one solution is to set set(IOS_MIN_TARGET "13.0") for the
backend test. And we might revisit this solution later.

But for now, we simply disable backend tests (and filamat tests)
for iOS.
2025-02-26 21:42:51 +00:00
Powei Feng
3fae07f23c gltfio: undo clearing when resource is loaded (#8458)
Fixes #8367
2025-02-20 01:03:03 +00:00
Doris Wu
1b59e24e99 fgviewer improvement (#8450)
* Introduce FrameGraphInfo class

* Move the assignment into pimpl

* Make ctors explicit

* Add ctors to fg info structs

* Revert the macro change to align with existing

* Address the comments

* Remove pimpl and move func def to .cc

* Fix

* Convert the FrameGraph to FrameGraphInfo

* Initialize and update debug server on engine side

* Fix compile error

* Address the comments

* Update

* Use camelCase

* Use camelCase

* Update

* Add JsonWriter to convert fginfo to json

* Add getStatus api and implement it

* Add increment

* Implement GET apis

* Fix compile error

* Update

* Use c_str_safe

* Add operator== for FrameGraphInfo

* Call updateFrameGraph in appropriate locations

* Address the comments

* Add webview for fgviewer

* Remove head and tail bracket

* Fix the table element

* Force web to re-render when fg info gets updated

* Skip culled resources

* Mark subresources as gray

* Add parent info for subresources

* Collapse subresources into their parent resource

* Make the leftmost column fixed

* Remove unused stuff in html

* Fix the comment

* Refactor the code

* Cull unused resources

* Update

* Fix the naming

* Format the file

* Merge multiple resource node in to single resource

* Improve the logic and naming

* Refine the code
2025-02-18 14:46:30 +08:00
Doris Wu
d92372c98f [Depends on #8379] Add webview for fgviewer (#8428)
* Introduce FrameGraphInfo class

* Move the assignment into pimpl

* Make ctors explicit

* Add ctors to fg info structs

* Revert the macro change to align with existing

* Address the comments

* Remove pimpl and move func def to .cc

* Fix

* Convert the FrameGraph to FrameGraphInfo

* Initialize and update debug server on engine side

* Fix compile error

* Address the comments

* Update

* Use camelCase

* Use camelCase

* Update

* Add JsonWriter to convert fginfo to json

* Add getStatus api and implement it

* Add increment

* Implement GET apis

* Fix compile error

* Update

* Use c_str_safe

* Add operator== for FrameGraphInfo

* Call updateFrameGraph in appropriate locations

* Address the comments

* Add webview for fgviewer

* Remove head and tail bracket

* Fix the table element

* Force web to re-render when fg info gets updated

* Skip culled resources

* Mark subresources as gray

* Add parent info for subresources

* Collapse subresources into their parent resource

* Make the leftmost column fixed

* Remove unused stuff in html

* Fix the comment

* Refactor the code

* Cull unused resources

* Update

* Fix the naming

* Format the file

* Fix naming

* Address the comments

* Address the comment
2025-02-15 06:41:43 +00:00
Doris Wu
9ca0594d7c [Depends on #8344] Implement ApiHandler functions and add JsonWriter (#8379)
* Introduce FrameGraphInfo class

* Move the assignment into pimpl

* Make ctors explicit

* Add ctors to fg info structs

* Revert the macro change to align with existing

* Address the comments

* Remove pimpl and move func def to .cc

* Fix

* Convert the FrameGraph to FrameGraphInfo

* Initialize and update debug server on engine side

* Fix compile error

* Address the comments

* Update

* Use camelCase

* Use camelCase

* Update

* Add JsonWriter to convert fginfo to json

* Add getStatus api and implement it

* Add increment

* Implement GET apis

* Fix compile error

* Update

* Use c_str_safe

* Add operator== for FrameGraphInfo

* Call updateFrameGraph in appropriate locations

* Address the comments
2025-02-15 02:27:42 +00:00
Powei Feng
b68e9fef03 froxel: make froxel buffer size consistent (#8437)
The definition of the froxel buffer sizes were spread across
multiple places and for different use cases (including
allocating the buffer, setting to a descriptor set, and adjusting
the relevant spec constant). In this commit, we try to unify
the size definitions into Froxelizer::getFroxelBufferByteCount().

We also remove the vulkan-only special case for froxel buffer
UBO. This case was introduced because spec constant couldn't be
used to size arrays for some drivers in the past, but we introduced a
workaround that replaced spec constants with constants.
2025-02-13 15:32:05 -08:00
Powei Feng
1a5f1cc6ab matdbg: fix three bugs (#8430)
1. changes weren't refreshed for windows/linux-mesa vulkan. This
   is due to a reordering of the shaders when the shader source
   is replaced. We fix this by ensuring the ordering before
   writing out the edit.
   Fixes #7286

2. A condition was flipped in the SourceFormatter causing the
   format feature to not work on linux

3. The material update status wasn't really propagated to the
   front-end due to not updating the status counter.
2025-02-11 07:50:45 +00:00
Benjamin Doherty
cb8b1bfefa Bump MATERIAL_VERSION to 57 2025-02-10 15:23:37 -08:00
GavinKG
c16cab239d Use CAMetalLayer to create MVK surfaces to avoid potential deadlocks. 2025-02-07 12:39:24 -08:00
Sungun Park
4fe852e88a Ensure correct resource cleanup sequence to avoid crashes upon app closing (#8408)
The commit 1747ae8f5a enfoces a correct
order for releasing resource. Fix the order to avoid crashes.

Make some samples to use the DEPTH32F format for better compatibility.
Some manufacturers don't fully support DEPTH24 on Vulkan. E.g., AMD
Radeon PRO W6400
2025-02-03 21:23:53 +00:00
Rafael Dominguez
62cd8f1d35 Update multiview shader code generator for Vulkan
When targeting Vulkan with multiview, the shader
code generator was using the OpenGL extension
and built-in variables, which are not supported on
Vulkan.

Changed it to use GL_EXT_multiview instead of
GL_OVR_multiview2 when the target API is Vulkan.
2025-01-31 16:50:02 -08:00
Doris Wu
793f2b4eb7 [Depends on #8332] Integrate fgviewer to the engine side (#8344)
* Introduce FrameGraphInfo class

* Move the assignment into pimpl

* Make ctors explicit

* Add ctors to fg info structs

* Revert the macro change to align with existing

* Address the comments

* Remove pimpl and move func def to .cc

* Fix

* Convert the FrameGraph to FrameGraphInfo

* Initialize and update debug server on engine side

* Fix compile error

* Address the comments

* Update

* Use camelCase

* Use camelCase

* Update
2025-01-31 23:39:47 +00:00
Eliza Velasquez
40851f4b51 matdbg: add support for essl1 shader debugging
Fixes #8261
2025-01-31 11:44:51 -08:00
Sungun Park
87bdf96449 Refactor: Rename shader snippets w/ new naming convention (see README.md) (#8402)
This commit renames all shader snippet files to conform to the newly
introduced naming convention outlined in README.md.

The new naming convention uses a `prefix_name.suffix` format to clearly
indicate the purpose and target shader stage of each snippet. This
improves the overall organization and readability of the shader code,
making it easier to understand how each snippet contributes to the
shader generation process.

No functional changes were made to the shader code itself or source
code. This is purely a refactoring for clarity and maintainability.
2025-01-31 00:02:53 +00:00
Evan Mezeske
4465e6c7f6 Remove noexcept from UserPanicHandler::call() so that panic handlers can throw. Without this change, throwing inside the user panic handler calls terminate(). Note that the docs for setPanicHandler() explicitly say that it's okay for the handler to throw, which is not true prior to this change. 2025-01-29 14:44:09 -08:00
John Bampton
5fd84db447 docs: update ImageDecoder.h; fix spelling 2025-01-27 21:18:55 -08:00