They're not hardcoded in a database inside MaterialBuilder and are
generated. This will be needed later for ES2 support.
We could actually imagine something more dynamic in the future too.
- Moved most of the layout transition logic into VulkanImageUtil
so that we'd have a single place to consider if failure arises
- Add an abstraction on top of vk's layouts so that reasoning
about our use cases (and corresponding layout is easier).
- Removed the redundant VulkanDepthLayout
- Refactor VulkanTexture::transitionLayout so that most of the
transition paths can be done through this entry point. It also
enables us to handle tracking the current layout.
- Add a special case to transition the depth attachment/texture
if it is both a sampler and an attachment.
- Add a few debug printing markers across the classe - guarded
under the existing FILAMENT_VULKAN_VERBOSE define.
- refactor the code so that all defines are generated in the same place
- generate common_type after all defines are generated
- protect (with defines) structures and UBOs that are not needed, based
on the variant
* Support the external image on macOS
Implement CocoaExternalImage.
* Fix to take an onwership of the external image
* Correct incorrect comments
* Rename a function explicitly
Make a function name to know copying RECTANGLE to TEXTURE2D.
* Do lazy initialization
Create CocoaExternalImage::SharedGl when it's needed.
* Fix a crash when engine is terminated
Destroy the external image shared gl before gl context is destroyed.
* Remove an useless variable
* Improve size optimizations when compiling material
This changes the behavior of the size optimizer in matc (-S), but
only for GLSL and MSL. With this change we gain a ~65% size reduction
on a lit material compiled for OpenGL. To get those gains we generate
extra SPIRV debug information to preserve variable names and better
utilize the line dictionary. Unfortunately this break the SPIRV
optimizer so we skip it and instead rely on a simple DCE pass provided
by glslang. We also enhance the whitespace removal pass of the GLSL
minifier to move lone { and } to the previous line, which avoids
generating an extra index in each shader variant. Each index being
at least as big as the character itself, this is quite wasteful.
When generating SPIRV for Vulkan, we rely on spirv-opt for size
optimizations as before.
Some shaders can be shared across all materials (e.g. the depth
shaders). We use the filament default material as the "source" of
the cache, but until now we relied on an a priori knowledge of which
variants were present in the default material.
With this change, we now query once the list of variants (of interest)
in the default material and reuse that list for caching these variants
later.
This is better because the cached variants are now entirely driven by
the default material (which they depend on anyways). This is also faster
because we don't need to query which variant we need each time we create
a material.
- Depth attachment layout has generated a lot of error due to
it being read-only. But the store-ops for the attachment during
the renderpass are all write ops. We set the depth attachment
layout as VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
- Enable extra blitting step for SSAO because of the above layout
conundrum.
- Index buffers did not have a pipeline barriers after loading
them.
- Remove `assert_invariant(utils::popcount(sampleCount) == 1);`
from `reduceSampleCount`. This assert fails when enabling the
duplicate pass for SSAO.
The VSM variant is never needed for unlit materials, it was filtered
out correctly for color shaders but not for the depth shaders.
This removes 4 variants from all unlit materials.
Also improve matinfo variants output.
* Suppress numerous libz warnings
zlib will fix this issue later (see https://github.com/madler/zlib/issues/633).
For now we will just turn off the warning.
* Fix Windows build
The feature-level option sets the maximum feature level allowed for
the material. matc will fail if the specified material has a higher
feature level than the value set with the feature-level option. The
default is 3 (max).
This can be used to ensure that materials don't use features above
a specified level.
... which is needed to avoid compilation error with recent LLVM libc++ (after https://reviews.llvm.org/D146097). Previously, symbols like std::terminate() were available through other headers (e.g. <functional>, <vector>, etc.).