We now follow the same rules than for basic types, when performing
mixed-precision operations, e.g.:
float3 + double3 -> double3
double3 + float3 -> double3
dot(float3, double3) -> double
In particular, e.g. swapping the arguments to arithmetic operations
now always yields to the same result type (before, float3 + double3
would not return the same type than double3 + float3).
To prevent an excess of variants, sometimes our vertex shaders declare
inputs that they never read from. For example, our skin-and-morph
variant might never read from the skinning attribute, but still declares
the input.
This PR is a sister to #1663, which is a fix for #1525.
See also #1279.
We now use GENERAL layout for depth-sampled images in order to support
the SSAO use case of simultaneous binding + sampling.
We may be able to optimize this in the future by enhancing DriverAPI
so that it feeds more information into the render pass.
Fixes#1627, #1649.
We now inverse the face winding order based on the determinant of
each render primitive world's transform. This prevents front/back faces
to be reversed when using a left-handed basis, after transform.
Fix#1520
Inspired by our recent scissor change (#1639) but motivated by gltfio,
which was forced to create a ton of ubershaders (see #1562).
Tested with:
gltf_viewer -u ../glTF-Sample-Models/2.0/TextureSettingsTest/glTF/TextureSettingsTest.gltf
This is nicer because this way the methods that don't match don't
even exist. Also make it better when editing code with a C++ aware
ide.
Also use the less verbose std::enable_if_t<>
We now have OpenGLContext which only tracks the OpenGL state.
It exposes an API very similar to OpenGL and does all the state
tracking. Currently, it doesn't expose non state-changing APIs
(e.g. draw methods) and only implements the state-changing API we
need (to track the state of).
If you tried removing `culling: none` from any post-process materials,
everything would be fine in GL but Vulkan would be black because
our full-screen triangle was back-facing.
Continue reading only if you thrive in absurd situations.
- Metal and OpenGL define clip space as Y-up whereas Vulkan is Y-down.
- Metal and Vulkan define tex coords as Y-down whereas OpenGL is Y-up.
* Add Android presubmit
* Build Android on Linux, macOS targets have NDK 18 only
* Consolidate workflows and jobs
* Try to build Android on macOS
* Fix typo
* Cleanup scripts
* Try NDK side by side if NDK bundle has the wrong version
* Simplify logic
* Fix NDK logic
* Only update the NDK when necessary
* Fix typo
* Update required NDK version
* Favor NDK side-by-side
* Remove support for obsolete NDK bundle, require NDK side-by-side
* Install the NDK side by side when missing
This prevents values like NONE or COLOR which are very generic
names to collide with other classic enums. It also forces us to be
specific about what we're doing when converting to bitfields.
Also added a utility to easily enable any enum or enum class to
support binary operation (i.e. Bitmask contract), e.g.:
template<> struct utils::EnableBitMaskOperators<Foo> : public std::true_type{};
gives all binary operators to 'Foo'. Foo must be an enum.
Also added any() and none() convenience to convert an enum to a boolean.
This simplifies its usage at call sites at lot.
The C++ ctor was needed before to create uninitialized objects, which
was needed in SamplerGroup. Instead we use a custom 'static_vector'
(instead of std::array), this actually makes SamplerGroup's
implementation clearer.
static_vector<> is just a fixed-capacity, fixed-storage dynamic
vector. we currently don't expose it and implement only what we
need.
The suzanne Vulkan demo was asserting because `setViewportScissor` can
only be called within a render pass, which means that
`MaterialInstance::use` can only be called within a render pass.
We probably need a better way to enforce these rules...
Every time ninja invoked CMake, we were unconditionally regenerating
all of our "licenses.inc" files which caused a ton of re-compiles.
Before the change, building after touching `ubershader.mat.in` took over
a minute, now it takes 20 seconds.
The CMake "file" commands are bad. The CMake documentation says:
If the file is a build input, use the configure_file() command
to update the file only when its content changes.