Commit Graph
6909 Commits
Author SHA1 Message Date
Grant Commodore 9042f628d4 vk: Adds the layercount to the VulkanTexture and SwapChainBundle (#8392) 2025-02-10 17:50:45 -08:00
Sungun Park 83d71d0f57 Release Filament 1.57.0 2025-02-10 23:33:15 +00:00
Benjamin Doherty cb8b1bfefa Bump MATERIAL_VERSION to 57 2025-02-10 15:23:37 -08:00
Sungun Park 8824f59051 Move OpenGLDriverBase.h under src/opengl/ (#8433) 2025-02-10 15:21:02 -08:00
Benjamin Doherty d8af04f08f Add missing setDithering to jsbindings 2025-02-10 09:37:13 -08:00
Mathias Agopian 559bc4eb96 fix some missing includes and trivial warnings (#8414) 2025-02-07 14:48:37 -08:00
GavinKG c16cab239d Use CAMetalLayer to create MVK surfaces to avoid potential deadlocks. 2025-02-07 12:39:24 -08:00
wangjinhan 68719f913a Rename clearEntities to removeAllEntities and add noexcept. 2025-02-07 11:37:14 -08:00
wangjinhan 038ed69a92 Add clearEntities API in Scene.
The API works for Scene to clear all entities.
2025-02-07 11:37:14 -08:00
Mathias Agopian 69822a91cf the shadow passes get their own face culling mode
the new MaterialInstance::setCullingMode(color, shadow) API allows to
set a separate face culling mode for the color pass and the shadow 
passes.

FIXES[391679058]
2025-02-07 11:36:48 -08:00
Powei Feng 24ff10b5db vk: fix rendering to 2D view of 3D image (#8421)
FIXES=389760706
2025-02-07 16:32:25 +00:00
Sungun Park ec2f5b8078 Promote getEyeIndex() as a common helper (#8418)
Now the helper function `getEyeIndex` becomes available for all shader
stages including post-processing. It used to be only accessible from
surface vertex shaders.
2025-02-06 22:41:30 +00:00
Powei Feng 538aa39127 Release Filament 1.56.8 2025-02-06 11:13:56 -08:00
Powei Feng 8de56a2bbc Add ostream operator for ExternalImageHandle (#8416)
Without it, DEBUG_COMMAND_STREAM does not compile.
2025-02-05 23:52:05 +00:00
Mathias Agopian ea5d7d4f47 Add a way to retrieve the GL_RENDERER and GL_VENDOR strings
The API works this way:

```
auto vendor = OpenGLPlatform::getVendorString(engine->getDriver());
```

Obviously the Backend must be `Backend::OPENGL` and the `Driver` must 
have been created with an `OpenGLPlatform` subclass.


FIXES=[385367277]
2025-02-05 15:31:39 -08:00
Ben Doherty 05cdeccc27 Stop precaching stereo depth variants on non-supported platforms (#8413) 2025-02-05 11:05:03 -08:00
Mathias Agopian ad4f349f00 Improve external texture image API
The current API used a void* in Texture::setExternalImage to pass
the platform specific image. This was a problem because on some
platform like Android, there could be several types (EGLImageKHR and
AHardwareBuffer), and with the void* there was no way to distinguish
them on the backend / platform side.

We now have a new Texture API which takes a
Platform::ExternalImageHandle, which is a reference-counted handle
to a Platform::ExternalImage. Platform::ExternalImage is an opaque
type only known by the platform.

This type must be created using a concrete Platform specific API, such
as:

PlatformEGL::createExternalImage
PlatformEGLAndroid::createExternalImage
PlatformCocoaGL::createExternalImage
PlatformCocoaTouchGL::createExternalImage

New types can easily be added in the future.

There is no "destroy" call because the Platform::ExternalImageHandle is
reference-counted and the client can let go of it as soon as it
doesn't need it any longer (typically after calling
Texture::setExternalImage). Platform::ExternalImage is a small
structure that just anonymously wraps the concrete types.

New internal driver APIs have been added to handle this functionality.
2025-02-04 13:16:56 -08:00
Mathias Agopian 06a2def85f make sure FXAA resets alpha channel when it's the last postfx (#8412)
If FXAA is the last post process effect (i.e. no upscaling), and
color grading produced a luma channel, then FXAA needs to reset the
alpha channel to 1.
2025-02-04 19:52:37 +00:00
Powei Feng a04019937e Add feature flag for material/instance destroy assert (#8411)
This will allow a more lenient rollout of the assertion, which
otherwise will increase crashes for current clients.

We also disable features.engine.debug.assert_material_instance_in_use
by default (it was enabled for debug builds).
2025-02-04 19:30:40 +00:00
Ben Doherty fff7bd2b28 Combine and install Abseil (#8387) 2025-02-04 09:32:49 -08:00
Powei Feng 3c4591df17 java: must use return var in Engine (#8409) 2025-02-03 22:53:44 -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
Mathias Agopian 864529254e fix color grading as subpass
This broke in 48a2c64. Fixes #8401.
2025-02-03 12:37:53 -08:00
Powei Feng 93fa55bd29 vk: refactor utils into its own namespace (#8280)
We move the code that was contained within two "utils" files
into separate utils sources in the vulkan/utils directory.
2025-02-03 19:10:19 +00:00
Sungun Park fb9518e915 Fix warnings regarding #pragma clang (#8405)
'#pragma clang' is unavailable in MSVC. Wrap them with the proper
preprocessor to avoid warnings in MSVC.

BUGS=[390207431]
2025-02-03 17:43:44 +00:00
Mathias Agopian b780cb36d0 attempt to fix crashers when initializing the JVM
- clarify precondition for VirtualMachineEnv, in particular, 
  JNI_OnLoad() must be called from a thread attached to the VM, and
  should be called once. This is now enforced internally, subsequent
  calls are ignored.

- sVirtualMachine was written and read from potentially different 
  threads without synchronization. It is now mutex protected.

- added fatal asserts in all locations that we cannot recover from;
  previously we would stay in an undefined state.

BUGS=[390724273]
2025-02-01 22:35:53 -08: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
Ben Doherty 9a2ca8ddbb Metal: add config to abandon frame if drawable cannot be acquired (#8397) 2025-01-31 13:31:07 -08:00
Eliza Velasquez 67710723d7 c-filament-style.el: fix init list indent 2025-01-31 12:06:09 -08: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
Benjamin Doherty f1c1aa155b Release Filament 1.56.7 2025-01-29 16:41:11 -08:00
Mathias Agopian 41f7dc384b add a version of Engine::flushAndWait that takes a timeout
The old version that doesn't take a timeout now always waits forever;
before it waited for a few seconds on Android debug builds.

The new version has an explicit timeout that works on all platforms and
returns success status.

FIXES=[384043020]
2025-01-29 14:47:21 -08: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
Mathias Agopian 48a2c6483b Add support for SGSR 1.0
SGSR stands for Snapdragon Game Super Resolution. It is an efficient
upscaler for mobile.

Split the upscaling passes into multiple methods in PostProcessManager.
Also, add a way to preserve the alpha channel in the FXAA pass.
2025-01-29 14:43:20 -08:00
Mathias Agopian 5b3343fcc2 Fix ShadowMapManager ShadowMap alignment (#8398) 2025-01-29 11:55:23 -08:00
Mathias Agopian 68b3d9ba54 mistakenly enabled the Shadow Atlas feature 2025-01-27 22:20:27 -08:00
John Bampton 5fd84db447 docs: update ImageDecoder.h; fix spelling 2025-01-27 21:18:55 -08:00
Powei Feng 1dae41c607 matdbg: fix two bugs with formatting (#8388)
- return original source when on an unsupported platform
- check clang-format is available and return original source.
2025-01-27 11:51:48 -08:00
Ben Doherty 6f673753bd Sync abseil into the repository (#8385) 2025-01-24 14:39:28 -08:00
Powei Feng 6dc79a319e filamat: fix spirv remap intialization (#8384)
FIXES=390398814
2025-01-24 09:52:03 -08:00
Powei Feng 3b7cbd6bdb viewer: fix broken test 2025-01-21 16:53:36 -08:00
Mathias Agopian ea21b740b2 use the move modern syntax for std::enable_if and friends
e.g. std::enable_if<cond>::type is replaced by std::enable_if_t<cond>

remove some unneeded typename keywords
2025-01-21 16:16:09 -08:00
Mathias Agopian 2d867a9dd6 Handle tags now work with heap allocated handles (#8370)
- uninlined getHandleTag so that the code is not duplicated when
  multiple backends are supported (e.g. GLES and Vulkan)
- added a lock for mDebugTags because, even if rare, it technically
  can be accessed from multiple threads. This would happen only
  on a failure. There should never be any contention on this lock.
2025-01-21 16:15:45 -08:00
Mathias Agopian 3f1e32c404 fix some trivial TODOs (#8371) 2025-01-21 09:49:02 -08:00
Powei Feng ada5791daf vk: do not delay old swapchain destruction when creating new swapchain (#8368)
Because of a recent ref-counting refactor, the swapchains are not
being immediately destroyed when destorySwapChain is called. This
might cause issue with following calls to createSwapChain.

We make sure the ref-counted resources are cleaned-up before new
swapchains are created.

Fixes #8288
2025-01-21 08:32:22 +00:00
Powei Feng db6ded4eec docs: disable validate script for now 2025-01-21 00:15:31 -08:00
Powei Feng bfaf3fb87b docs: fix validate-docs on push 2025-01-21 00:09:09 -08:00
Powei Feng bba254ba6d docs: add github presubmit workflow to prevent /docs edits (#8357)
The content of /docs should be generated and not manually
generated. We add a script to check for edits and also allow for
tags to override the check.
2025-01-21 07:08:11 +00:00