Commit Graph

5796 Commits

Author SHA1 Message Date
Mathias Agopian
b2278986dd Update bug_report.md 2023-07-31 11:47:32 -07:00
Mathias Agopian
98a2b8f159 Improve FrameSkipper performance on GLES/Android
We get rid of the backend's HwSync object because on all platforms
but GL it was implemented just like a HwFence. We now use HwFence 
instead.

On GL platforms though, HwFence doesn't exist natively it is instead
provided by the Platform. In that case, we emulate it as with GLSync
objects -- the emulation incurs some latency that can cause frames
to be skipped.

On Android and platforms that provide the Fence functionality, there is
no such issue.

This change improves significantly frame pacing on Android.
2023-07-31 11:29:40 -07:00
Mathias Agopian
0ba891fb14 Fix off-by-one in FrameSkipper
The frame latency specified was off-by-one, i.e. a value of 1 meant a
latency of 2. The default was 2, which meant 3. Also it wasn't possible
to specify the max latency of 4, which would OOB.
2023-07-31 11:29:40 -07:00
Mathias Agopian
042cd670aa Improve fence-based timer query emulation
It now uses the fence for the start time and end time, leading to much
more accurate timings. We also use a single atomic variable instead of
two.
2023-07-31 11:29:40 -07:00
mackong
95c7e4d02b sample: fix typo 2023-07-27 10:03:11 -07:00
Mathias Agopian
d302525674 Add a way to query the validity of filament objects
Engine::isValid() can be used to check the validity of most filament
objects.
2023-07-27 10:02:31 -07:00
Mathias Agopian
3dbb7298f8 fix a cleanup of material parallel compilation
When the engine is shut down, it's possible for some parallel
compilation jobs (and callbacks) to be queued. We need to make sure
to clear the queues and call the callbacks before destroying the
parallel compilation service.


Fixes b/290388359
2023-07-27 10:02:31 -07:00
Mathias Agopian
0ed71ab53b fix an issue causing callbacks to be called too late
We were waiting for programs from both queues to be compiled before 
calling the callback associated with one queue. In practice this caused
the callback associated with high priority programs to be called only 
after low priority programs were ready.

Also cleanup-up "token" so that it doesn't store the priority.

Update the documentation and sample to better reflect what the 
implementation does.
2023-07-27 10:02:31 -07:00
Mathias Agopian
b1491ae5b1 Disable timer queries on all Mali GPUs
fixes b/233754398
2023-07-27 09:57:41 -07:00
Mathias Agopian
03b8dc8027 The "back" key will now terminate the gltf_viewer activity
This is useful for testing our shutdown code.
2023-07-27 09:57:14 -07:00
Mirsfang
e3568cd89f fix macos openggl compile process_ARB_shading_language_packing type conversion error (#6994) 2023-07-27 09:34:41 -07:00
Powei Feng
b35e24daa7 gltfio: exclude unsupported platforms from test (#7000) 2023-07-26 19:11:50 -07:00
Powei Feng
f506b27a31 gltfio: simple test for asset loading (#6990) 2023-07-26 16:50:06 -07:00
Benjamin Doherty
9452d5be1d Release Filament 1.40.3 2023-07-26 12:51:50 -07:00
Romain Guy
ea3f449a08 Update dependencies (#6992) 2023-07-26 11:05:09 -07:00
Ben Doherty
dc9510fe25 Support EXT_clip_cull_distance for future use (#6965)
This PR sets up the ability for shaders to use `gl_ClipDistance`, which will be needed in the future. Desktop GL supports this natively. OpenGL ES requires the EXT_clip_cull_distance extension.

Unfortunately glslang does not support this extension, so we have to employ a workaround for mobile when going through glslang. We instead write to `filament_gl_ClipDistance`, and then modify the SPIR-V to decorate this as `gl_ClipDistance`. See the comment in SpirvFixup.h.

Note this PR does not actually use `gl_ClipDistance` yet, so there should be no change to shaders.
2023-07-26 10:01:28 -07:00
Powei Feng
731dd761d9 vulkan: Implement async readPixels (#6695)
- Carry out readPixels without blocking and wait for the read to
   complete own a separate thread.
 - Add mContext.commands->wait() in finish()
 - Wait for readPixels to complete in finish()
 - Remove unused commandBuffer in Context
2023-07-25 14:07:56 -07:00
Powei Feng
6726ccb2fb vulkan: fix subpass validation (#6980)
- Before, we supposed that the maximum number of input attachment
   should match the maximum number of color attachments. But in
   reality, we've only used one input attachment for the second
   subpass.
 - The problem with the above supposition is that the descriptor
   set layout for the input attachment descriptor set must have the
   exact number of input attachment specified in the shader. If the
   *layout* has more input attachment slots than specified in the
   shader, then we'd run into a validation error.
 - In this patch, we fix the number of max input attachment in
   the descriptor set layout to 1, since we ever only make use of
   one.

Fixes #6513
2023-07-25 11:24:14 -07:00
Powei Feng
5fce0f9ecf filamentapp: fix vulkan dependency (#6987)
Fixes #6983
2023-07-24 16:50:51 -07:00
Mathias Agopian
ad03fc4118 fix typo that prevented the shader blob cache to work (#6979)
fixes b/290670707
2023-07-24 09:59:19 -07:00
Y-way
3f77ff8815 Build error on msvc 2022 2023-07-21 10:00:51 -07:00
Mathias Agopian
26b5fa1e38 fix a crash when using Material::compile with a callback
The work queue is sorted by priority but when we insert a notification
job we didn't have a priority to use for insertion, in addition the
priority was taken from the token, but for the notification job we don't
have a token.

The fix consists in passing the priority around so we have it when needed.
2023-07-21 10:00:21 -07:00
mackong
24286e6016 gltfio: fix crash when compute morph target without material 2023-07-21 09:08:22 -07:00
Ben Doherty
626577fe3d Fix ineffective FOG variant filter (#6968) 2023-07-20 11:54:18 -07:00
Romain Guy
176915b59c Add missing setParameter variants to MaterialInstance (#6973)
Adds support for mat3/mat4 parameter types
2023-07-20 11:19:35 -07:00
mackong
0b60933c2a web: remove const qualifier for getMaterialInstances (#6952) 2023-07-20 10:43:33 -07:00
Pawan Vimukthi
0e31d6936a Update android/Windows.md (#6964)
Updated the flag `filament-skip-samples` in the code snippet to align with the documentation.
2023-07-19 13:23:08 -07:00
Benjamin Doherty
78d9c43ef1 Release Filament 1.40.2 2023-07-17 15:49:14 -06:00
Powei Feng
ce253a9563 vulkan: swapchain resize condition update (#6951) 2023-07-13 10:54:51 -07:00
Benjamin Doherty
18c3c36727 Release Filament 1.40.1 2023-07-12 13:43:11 -07:00
Ben Doherty
4e6f6a4579 Disable shader precompilation on WebGL (#6925) 2023-07-12 07:32:58 -07:00
Powei Feng
84487f4d8d vulkan: add lock to VulkanTimerQuery fence (#6949)
Call to Driver::getTimerQueryValue is synchronous so we need to
make sure the fence shared_ptr is protected by a lock.
2023-07-11 09:14:06 -07:00
Powei Feng
45f5a07989 Update MATERIAL_VERSION to 40 (#6948) 2023-07-10 15:22:15 -07:00
Romain Guy
0061883dbf Fix dynamic resolution with quality > low and translucency (#6940)
The scene graph was using the wrong boolean to decide whether to fallback
to low quality upscaling when the render target is translucent. It was
instead only looking at the view's blending mode. We need to check both,
as color grading does in the same function.
2023-07-10 12:48:54 -07:00
조다니엘(Daniel Cho)
47e3be11f0 Fix typo in BUILDING.md (#6942) 2023-07-07 08:13:37 -07:00
junsang.lee
420f4000c2 fix: 64-Bits Windows, Path::exists() fails for files over 2GB. (#6938) 2023-07-07 00:14:54 -07:00
Romain Guy
4582ce8769 Fix texture upload callbacks in Java/Kotlin (#6939)
* Fix texture upload callbacks in Java/Kotlin

* Update release notes
2023-07-06 15:53:24 -07:00
조다니엘(Daniel Cho)
3beb39f30b Fix typo in build.sh (#6935) 2023-07-06 09:07:14 -07:00
Romain Guy
b72d6c058a Move file to the correct location 2023-06-26 12:48:22 -07:00
Benjamin Doherty
0c8f367b29 Release Filament 1.40.0 2023-06-26 13:16:53 +08:00
JEONG TAEHUN
50045edb4f [ModelViewer.kt, Remove Lint warning] (#6917)
- Use of getter method instead of property access syntax (for getInstance)
 - 'rangeTo' or the '..' call should be replaced with 'until' (in for)

Co-authored-by: jeongth9446 <taehuniy@gmail.com>
2023-06-26 12:05:43 +08:00
Benjamin Doherty
f538d1aa43 Add missing atomic header 2023-06-26 11:47:44 +08:00
SahilMadan
4bd8d2a3b7 Make initializeGlExtensions protected (#6914) 2023-06-22 14:17:12 +08:00
Ben Doherty
9fa952d968 For web assembly, implement logging as emscripten_err and emscripten_out (#6913) 2023-06-22 11:18:23 +08:00
Ben Doherty
1edad92d73 Update RELEASE_GUIDE.md 2023-06-21 07:45:37 +08:00
Powei Feng
52282baeff Update MaterialEnums.h to v39 2023-06-20 11:48:07 -07:00
Benjamin Doherty
85ab9d211d Release Filament 1.39.0 2023-06-20 23:44:33 +08:00
Ben Doherty
6e99a4dcfc Turn off iOS exceptions in debug builds (#6912) 2023-06-20 14:59:10 +08:00
Mathias Agopian
35c91827af fix error reporting with ShaderCompilerService
when using the thread pool we were destroying the shaders immediately,
we need to defer this until we query the program link status, so that 
in case of failure we can query each shader compile status.

we make the shader handles part of the promise/future so they can be 
transferred to the main thread, just like the program id is.
2023-06-16 11:04:59 -07:00
Powei Feng
5c11b237f3 vulkan: address debugUtils bug (#6904)
vkCmdEndDebugUtilsLabelEXT expects that a label was "pushed" onto
the command queue (as described in the spec). It is possible to push
labels across command buffers, but the pushed label must still be in
the queue (unexecuted) when End is called. This implies that we need
to make sure the labels are in a good state (all popped) when
vkQueueSubmit is called.

- We add a stack to carry the labels across vkQueueSubmit.
- Also add CPU time durations between push and pop to provide rough
  CPU execution times (in debug).
- Add systrace markers for Android systrace
2023-06-15 11:27:48 -07:00