In the introduction of MaterialInstanceManager, the assumption is
that everytime PostprocessManager wants an instance, we can just
provide a "new" one since all of the instance's content - UBOS,
textures - will not be shared between passes. But this is not
the right assumption. For `colorGradingPrepareSubpass` and
`customResolvePrepareSubpass`, they are filling in an instance
for later passes to use.
To address this, we add a way to identify a fixed instance in
MaterialInstanceManager. This will allow us to refer to specific
instances of a material across passes (for the duration of a
frame).
This address the following crashes:
- Enabling custom resolve for MSAA for the metal backend
- Resizing the gltf_viewer window
Also move the dof instance into the loop to prevent UBO reuse.
Remove instance dependencies in Gaussian Blur Pass (separable).
Filament used to issue command queue flushes (E.g. glFlush()) after
large passes like the color pass in order to kick the gpu into action
sooner and reduce latency. This however comes at a high cost on the
gpu timeline as command queue flushes are expensive on vulkan and
metal. Moreover GL drivers are allowed to ignore glFlush().
So we just remove all these calls.
Previously, cancelling shader compilation tokens in THREAD_POOL mode
would block the engine thread until GL resource loading completed. This
led to unexpected application stalls when numerous shaders were
simultaneously cancelled.
This change moves the token cancellation logic to the compiler thread.
By marking tokens for asynchronous cancellation, we prevent unwanted
main thread stalls, ensuring a smoother user experience during bulk
shader cancellation.
BUGS=[430068776]
We add a class to manage a cache of material instances mapped by
materials. This allows us to re-use instances across frames. Note
hat also it's possible for the same frame to want to use the same
instance multiple times (for example for bilateral blurring or
upsampling), but we allocate separate instances for that case so
that UBOs are not shared across render passes. This allows for
bubble-reduction for vulkan (and possibly other backends).
Because the member variable mVariantFilter is not initialized, random values will appear on Windows 10 or others platform, which eventually causes some variants to be filtered out by this mVariantFilter. (#9000)
Previously we always waited on the semaphore at
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT. If we be a little bit more
specific for the "in-frame" wait (between two command buffers
within a frame), we can allow for better parallelism.
We use it in
- StructureMipMap
- Separable Blur Pass
- Depth Blit (Shader)
These two passes come before the color pass, but the color pass
needs to write the buffer that is referenced by the post-processing
descriptor set. So we set these passes to use the
StructureDescriptorSet (which has its own UBO). This removes a
synchronization dependency between these two passes and the color
pass.
- rename find(Value&) to findValue() to avoid issues if the key and
values have the same type.
- fix a leak if Bitmap is destroyed and not empty (thankfully this
didn't happen in practice in filament, because the Bimap was always
empty when destroyed)
- fix a use after free in erase. we were destroying the Key before
removing it from the maps, which theoretically could need to access
them.
- slightly improved the API and added some comments about preconditions.
some of the postfx passes (picking, ssao, structure) are user passes
because they call user materials; these now use their own ubo, which
should prevent us from having to update a UBO mid frame.
The per-view UBO is used in several different contexts, for instance:
- during the color pass
- during the shadow pass
- during the structure pass
- during app postfx passes
For shadows and other passes, its content is actually different because
the camera is very different. In that case, we use a different buffer.
However, the code that was used to set the values into the UBO was
duplicated and did slightly different things. In addition some
UBO values were (and are still) probably missing (e.g. the per-material
data).
To improve this situation we new use a utility class that does the
UBO set up of those "shared" values.
It turns out that the structure, ssr and ssao passes also need a
slightly different content (because they run at half res) and currently
are sharing the color pass UBO, which causes mid-frame updates.
We introduce a new StructureDescriptorSet which is managing a new UBO,
it too is now implemented in terms of the new utility class.
StructureDescriptorSet Is not used yet.
A test for how Gemini can clean-up code. Changes:
- Configuration Struct: Global variables have been grouped into an
AppConfig struct. This makes the program's configuration explicit and
avoids polluting the global namespace.
- Clearer Argument Parsing: The handleArguments function now returns an
AppConfig object, encapsulating all parsing logic and making the main
function cleaner.
- Helper Functions: Repetitive tasks like string replacement, file I/O,
and writing file entries have been extracted into small, well-defined
helper functions (replaceAll, openOutputFile, readFile, etc.).
- Simplified main Function: The main function is now a high-level
coordinator, delegating work to helper functions. This makes the overall
program flow much easier to follow.
- Modern C++ Idioms: The code now consistently uses C++ streams
(std::cout, std::ofstream) and std::string objects, which is more
idiomatic than a mix of C and C++ styles.
- added short comments
The previous introduction of VulkanBufferProxy uses the refcount of
the backing VulkanBuffer as an indication whether there's a write
in progress or not. But we also want to make sure there is no
read in progress (i.e. not referenced in a descriptor set). This
commit fixes the bookkeeping while trying to clean up the relevant
structs.
We add logic to track whether a UBO is actively been read (i.e.
bound to a descriptor set that is itself bound to a command buffer).
- Add a feature flag for bypassing staging buffer for buffer
updates. Note that this was assumed on for UMA devices, but
can cause issue with post-processing. So now we default the
path to off and clients can enable it via feature flag.
- Remove FVK_FORCE_STAGING_FOR_BUFFER_UPDATES since it's intended
use is subsumed by vulkan_enable_staging_buffer_bypass.
- Small refactor of FEngine for creating
backend::Platform::DriverConfig.
- Move upload step to later so that comparison result is also
included in the upload
- Fix the wrong relative paths in the comparison_result.json
- Fix viewer logic to pick only the latest run for a PR.
the descriptor used for SSR is different depending on the pass. In
the color pass, it's used as the source of the SSRs buffers and is an
array (refraction & reflection). In the SSR pass it's the history
buffer and is just a 2D texture.
The invocable sent to Program::diagnostic contains a reference
to Material, which could be destroyed by the time the invocable
is called. We make sure that invocable does not have a reference.
- Add github link to page
- Fix link in contributing.md
- Small update to docs_src/README.md
- Remove logo in the core docs
- Move branching.md and release_guide.md to /docs_src
- Add "under construction" warning for the web samples
- Update matdbg README.md
- Remove build.sh option for turning markdeep docs into html.
This is subsumed by workflow in docs_src
- Remove old hugo templating path. This is also subsumed by
docs_src.