Age | Commit message (Collapse) | Author |
|
Makes codegen from typical D3D emulation SPIR-V more readable.
Also makes cross compilation with NotEqual more sensible.
It's very rare to actually need the strict NaN-checks in practice.
Also, glslang now emits UnordNotEqual by default it seems, so give up
trying to assume OrdNotEqual. Harmonize for UnordNotEqual as the sane
default.
|
|
|
|
In cases where we know the size of the vector and the index at compile
time, we can check if it's accessing in bounds and rely in undefined
behavior otherwise.
Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
|
|
Add 64 bit switch support for MSL version 2.2.
* Also fixes a wrong endianness conversion.
Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
|
|
Tests provided by @cdavis5e.
|
|
Fix bug in to_trivial_mix_op, where we made a pre-1.4 assumption that
component count of selector is equal to value component count.
|
|
|
|
|
|
|
|
|
|
Subsequent stages can legally attempt to read from these variables,
which causes compilation failure.
Always make sure we emit user outputs in vertex shaders if they are
active in the entry point.
|
|
Deal with patch blocks, arrays of patch blocks, arrays of blocks, etc.
|
|
We have been interchanging spv and SPIRV_Cross_ for a while, which
causes weirdness since we don't explicitly ban SPIRV_Cross identifiers,
as these identifiers are generally used for interface variable
workarounds.
|
|
On AMD Windows OpenGL, it has been reported that we need to load
matrices via a wrapper function.
|
|
|
|
To facilitate an improved linking-by-name use case for older GL,
we will be more aggressive about merging struct definitions, even for
rather unrelated cases where we don't strictly need to use type aliases.
|
|
When inside a loop, treat any read of outer expressions to happen
multiple times, forcing a temporary of said outer expressions.
This avoids the problem where we can end up relying on loop-invariant code motion to happen in the
compiler when converting optimized shaders.
|
|
When we see a switch block which only contains one default block, emit a
do {} while(false) statement instead, which is far more idiomatic and
readable anyways.
|
|
Opt-in to using the extension to support gl_InstanceIndex.
|
|
This CL updates the GLSLang, SPIRV-Tools and SPIRV-Headers dependencies.
|
|
|
|
This CL rolls the various dependencies of SPIRV-Cross and updates the
tests as needed.
|
|
This CL updates the three depdencies and updates the tests to handle the
new validation errors which are produced.
|
|
|
|
|
|
This CL rolls the GLSLang and SPIRV-Tools dependencies to tip-of-tree
and updates the tests as required.
|
|
|
|
Need to bitcast the unrolled expressions as well.
|
|
|
|
Traverse backwards instead, far more robust. Should elide basically all
redundant continue; statements now.
|
|
|
|
We would force temporaries in unexpected places, causing assertions to
throw if access chains were consumed in such loops.
|
|
Missed case where DoWhile continue block deals with Phi.
|
|
|
|
Some platforms support Vulkan GLSL, but not this extension apparently
...
|
|
This is not necessary, as we must emit an invalidating store before we
potentially consume an invalid expression. In fact, we're a bit
conservative here in this case for example:
int tmp = variable;
if (...)
{
variable = 10;
}
else
{
// Consuming tmp here is fine, but it was
// invalidated while emitting other branch.
// Technically, we need to study if there is an invalidating store
// in the CFG between the loading block and this block, and the other
// branch will not be a part of that analysis.
int tmp2 = tmp * tmp;
}
Fixing this case means complex CFG traversal *everywhere*, and it feels like overkill.
Fixing this exposed a bug with access chains, so fix a bug where expression dependencies were not
inherited properly in access chains. Access chains are now considered forwarded if there
is at least one dependency which is also forwarded.
|
|
|
|
|
|
Certain Phi variables need to maintain a temporary copy, but we forgot
to declare them when the master variable is a loop variable itself.
|
|
|
|
Facilitates easier mapping from source language to cross-compiled output
in tooling.
|
|
We had a bug where error conditions in DoWhileLoop emit path would not
detect that statements were being emitted due to the masking behavior
which happens when force_recompile is true. Fix this.
Also, refactor force_recompile into member functions so we can properly
break on any situation where this is set, without having to rely on
watchpoints in debuggers.
|
|
Need to emulate these calls for correctness.
|
|
We have an edge case where the array is declared with a concrete size,
but in GLSL we must emit an unsized array, which breaks array copies.
Deal explicitly with this.
|
|
Odd-ball case for certain geometry shaders coming from HLSL.
|
|
depth2d in MSL only returns float, not float4, even for normal sampling.
We need to conditionally remap-swizzle back to float4.
|
|
|
|
When we force recompile, the old var.self name we used as a fallback
name might have been disturbed, so we should recover certain names back
to their original form in case we are forced to take a recompile to make
the naming algorithm more deterministic.
|
|
Fairly common pattern in unoptimized SPIR-V. Support this case as well.
|
|
Fix various bugs along the way.
|