* Capture the last win32 error immediately after failing win32 API functions are called in order to log it correctly. Prior to this change, intervening win32 API calls could clear the error code and it would not be logged.
* Oops fix bad whitespace in previous commit
In some cases, users set materials first without providing render primitives, which has incurred the attribute mismatching warning. This isn't helpful because users don't know what action they should take to remove the warning.
Emit the warning only when the primitive handle is initialized so the AttributeBitset is properly populated.
BUGS=[372755205]
RenderPass is now tracking the scissor state locally so it can avoid
re-setting the scissor when it doesn't change.
We also consolidate the scissor override and the scissor-viewport in
RenderPass::Execute.
RenderPass is now tracking the scissor state locally so it can avoid
re-setting the scissor when it doesn't change.
We also consolidate the scissor override and the scissor-viewport in
RenderPass::Execute.
- the main goal of this change was to move some state changes outside
of loops, usually with mip generation.
- for instance bindPostProcessDesciptorSet() must now be issued
manually (and can be done outside the loop)
- we also don't set the scissor for each pass
- we also move prepareMaterial() outside of getPipelineState(), it's
now done in PostProcessMaterial::getMaterial().
- We use PostProcessVariant instead of uint8_t everywhere
In the end we have three drawing helpers:
- commitAndRenderFullScreenQuad() which updates a material instance,
binds the corresponding material and draws a full screen quad.
- renderFullScreenQuad() which just renders a full screen quad.
- renderFullScreenQuadWithScissor() which does the same but scisorred
Additionally, we have the following helpers for getting materials and
instances:
- PostProcessMaterial::getMaterial(): which returns the FMaterial
- PostProcessMaterial::getMaterialInstance(): which is now a helper
returning a material instance from a PostProcessMaterial or FMaterial
Most of the change is pluming through these API changes.
It always references static data. Additionally, we don't need
to use a vector to store the specialization constants, because
it's also all static data.
And finally, we don't need a boolean to know the state of the
PostProcessMaterial, the mSize field can encode the same
information.
"history" is a map from a DescriptorSet pointer to a set of
bookkeeping values (we delay "binding" until "commit" so need to
keep values until then). Instead of using a map, we can store
these values in the DescriptorSet itself so that we save on a
map look-up.
ANGLE features should be set by apps, the system or developers but it's
not a good idea to set them in a library as it might conflict with other
libs etc.
we did it because it improved performance, but that should be fixed at
the angle level instead.
We are seeing a cluster of crashes that could be due to using an
EGLSurface whose ANativeWindow has become invalid. This could happen if
we continued to use (i.e. draw with) an EGLSurface after
SurfaceHolder::onSurfaceDestroyed() has returned.
This new flag enables an assertion that the native window is valid at
the time of makeCurrent(), which happens early in the frame.
BUG=[330392256]
Previously, default layout is based on usage, but this actually
has two paths (Filament's TextureUsage and the computed
VkTextureUsage) that do not always agree. We simplify so that
default layout is stored in the texture itself.
Also remove some unnecessary code that is no longer necessary.
In particular, we shouldn't be doing a flush and wait for the
transition to complete before updating a sampler descriptor.
We just need to make sure the layout before it is accessed is
correctly given in the update struct.
In certain compilers, the assignment operators defined as default
doesn't automatically make a call to the parent's method if it's
user-defined.
Make this behavior explicit to avoid this edge case.
BUGS=[371980551]
To ensure the source of readPixels() is properly copy-able, we
want the backing textures to be created with the right BLIT_SRC usage.
However, this was not documented in the API. We workaround the issue
to tag all color attachment textures as BLIT_SRC.
This workaround will be removed in the future. For now, violations of
this condition will elicit a warning being printed out.
the problem stems from a mismatch between the shader code
and the cpu code. if the shader is configured to read the shadow
map, then the cpu must generate it, otherwise we can get stale data.
Wether the shader reads the shadow map depends on the shadow type.
For directional shadows, the shader needs the SRE variant + a
"shadow enabled" bit per cascade in the main UBO.
For punctual shadows, the shader only needs the SRE variant.
Because of all that, if the conditions are met on the CPU side for
the shader to access the shadow map, we must make sure to generate it,
but in the case the shadow map would be empty (e.g. no shadow receivers),
we need to initialize it (and we can skip some work in the case of VSM).
BUGS=[369908659]
this caused the HAS_SHADOWS flag to not be disabled, this didn't
actually cause a problem because shadowing and SSR share the same
SRE variant bit. But both should never be active together.
Mesa always clears the generic binding if the buffer deleted
is bound to an indexed binding, even if it's not bound to the
generic binding.
BUGS=[371324321]
- We change GLDescriptorSet::Buffer default constructor to
workaround a client's compiler set up issue.
- We removed the assert_invariant that checks that ubo/samplers
are not changed after committed in DescriptorSet. This caused
an existing client's build to crash.
We use Mesa's gallium swrast to render as the driver with
Filament's backend set to GL. We provide a few scripts to parse
the tests (as jsons) and run gltf_viewer to produce the rendering.
For GL+Linux, PlatformGLX will try to open an X11 window
regardless of whether we are doing headless/offscreen rendering
or not.
Here we add an OSMesa platform, which will allow us to avoid
opening any window on Linux. This is particularly useful for
situation where a display is not available, like for CI.
One important detail is that even though we are displaying through
a window, we keep the SDL2 dependency in tact for gltf_viewer.
This is due to the fact that gltf_viewer is built upon
FilamentApp, which is heavily integrated with SDL2. This is mostly
ok since we won't be hitting any path for opening a window due to
gltf_viewer's existing support for headless mode.