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.
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.
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
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.
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.
- 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
- 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
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.
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.
- 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>
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.
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