Commit Graph

2323 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
1d5eba67f8 MSL: Remove hacky workaround for patch constant passing.
There was a hack to workaround a bug in DXC where control point -> patch
constant phase was passed in Function storage, but we have to use
Workgroup here. We will not support these kinds of hacks for invalid
SPIR-V, so hack the reference files to use the "proper" fix and remove
the hack for time being.
2019-10-28 12:52:28 +01:00
Hans-Kristian Arntzen
8f13a3f4b1 MSL: Remove workaround for passing constant arrays to functions.
Arrays are value-types now, so remove the old workaround.
2019-10-28 12:14:43 +01:00
Hans-Kristian Arntzen
32bd1329b6 Remove another dead reference file. 2019-10-28 11:51:31 +01:00
Hans-Kristian Arntzen
8670f7cbab Remove some more dead reference files. 2019-10-28 11:49:57 +01:00
Hans-Kristian Arntzen
b2c6362c4b Remove another dead reference file. 2019-10-28 11:33:09 +01:00
Hans-Kristian Arntzen
93ceead289 Remove dead reference file. 2019-10-28 11:31:04 +01:00
Hans-Kristian Arntzen
e1919744e9 Hack some constants in UE4 tests.
Need to make output 100% exact for MSVC and GCC libc testing, but they are 1 ULP
off when converting fp32 to string in some weird corner cases.
Roundtrip should be correct though, but that outside the scope of
SPIRV-Cross.
2019-10-28 11:20:41 +01:00
Hans-Kristian Arntzen
648dfa5070 MSL: Ensure stable output for access chain CFG workarounds.
We had output dependent on complex_continue being set, but setting that
flag was dependent on unordered_set declaration order. Make it invariant
to ordering and change the implementation so it knows about the new
temporary hoisting for access chains.
2019-10-28 10:57:51 +01:00
Hans-Kristian Arntzen
ac8d335480 MSL: Fix integer cast. 2019-10-26 20:30:24 +02:00
Hans-Kristian Arntzen
fa011f8547 MSL: Declare arrays with proper type wrapper.
Need to construct with value type spvUnsafeArray<T, N>({ elem0, elem1 })
to make array initialization work in complex scenarios.
2019-10-26 17:57:34 +02:00
Hans-Kristian Arntzen
2745959646 MSL: Deal with chained access chains for tessellation IO variables.
Need to specially deal with this since we might have to split up access
chain and deal with indexing into IB struct.
2019-10-26 17:26:56 +02:00
Hans-Kristian Arntzen
e1acbd3dcf MSL: Declare struct type explicitly.
Disambiguates initializer list.
2019-10-26 16:21:46 +02:00
Hans-Kristian Arntzen
1fc3347873 MSL: Fix array of array declaration.
Arrays-of-arrays were declared in wrong order.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
27d6d45671 MSL: Rewrite tessellation_access_chain.
To support loading array of array properly in tessellation, we need a
rewrite of how tessellation access chains are handled.

The major change is to remove the implicit unflatten step inside
access_chain which does not take into account the case where you load
directly from a control point array variable.

We defer unflatten step until OpLoad time instead.
This fixes cases where we load array of {array,matrix,struct}.

Removes the hacky path for MSL access chain index workaround.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
bac2c34590 MSL: Slight cleanup in emit_tessellation_access_chain.
Hoist out some conditionals and make it clear that we go into this path
if strip_array is used when declaring resources, i.e. there was no
explicit unflatten step.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
d0953f6e4c MSL: Do not declare variables which will not be unflattened.
Non-patch arrays of IO variables in tesc/tese have their array index
stripped, and access chains are specially handled, we shouldn't attempt
to create "normal" arrays of these.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
028ffc26dd MSL: Report tess input array failures more accurately.
We cannot dynamically index into an array of inputs at the moment. Do
not fail with opaque "bad cast" error.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
f2eb940536 MSL: Revert hack with kBufferSizeBufferBinding 2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
62c4eaa7bf MSL: Remove stale code for TextureSwizzle.
Was probably added mistakenly during an old rebase.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
3f569ed5ec GLSL: Minor nit, check flushed_phi_variables with count(). 2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
9d18c82364 Clean up call to builtin_translates_to_nonarray.
get_decoration is better than poking in ir.meta manually.
2019-10-26 16:10:12 +02:00
Hans-Kristian Arntzen
3b5c4c7316 Implement constant empty struct correctly on all backends.
MSL actually supports empty structs, so enable that path as well.
2019-10-26 16:10:11 +02:00
Hans-Kristian Arntzen
8066d13599 MSL: Rewrite propagated depth comparison state handling.
Far cleaner, and more correct to run the traversal twice.
Fixes a case where we propagate depth state through multiple functions.
2019-10-26 16:10:11 +02:00
Hans-Kristian Arntzen
830e24c4ba MSL: Do read-only lookups of access_chain_children. 2019-10-26 16:10:11 +02:00
Hans-Kristian Arntzen
efc978177e MSL: Remove stray allow_id_rewrite().
Unclear why it's there, and tests do not break when removed.
2019-10-26 16:10:11 +02:00
Hans-Kristian Arntzen
2767257adc MSL: Do not declare array of UBO/SSBO as spvUnsafeArray<T>.
There is no need for these to be copied, and cuts down on template
stamping bloat.
2019-10-26 16:10:08 +02:00
Hans-Kristian Arntzen
a82ecbeba9 MSL: Enable proper value types for return and value-passing of arrays.
Now that we have spvUnsafeArray<T> there is no need to deal with these
special purpose cases.
2019-10-24 13:03:38 +02:00
Hans-Kristian Arntzen
4ac12594c9 MSL: Be a little clearer how needs_base_vertex_idx is implemented.
There is an implicit tristate with {-1, 0, +1} values, but it was not
obvious how this was supposed to work before studying the implementation,
so refactor into a tristate enum class.
2019-10-24 12:41:37 +02:00
Hans-Kristian Arntzen
6ca3fe22c3 MSL: Remove some dead code w.r.t. vertex/instance_idx. 2019-10-24 12:36:01 +02:00
Hans-Kristian Arntzen
d1479f871a MSL: Do not generate UnsafeArray<> for any array inside buffer objects.
This avoids a lot of huge code changes.
Arrays generally cannot be copied in and out of buffers, at least no
compiler frontend seems to do it.

Also avoids a lot of issues surrounding packed vectors and matrices.
2019-10-24 12:22:30 +02:00
Hans-Kristian Arntzen
b433836b08 MSL: Simplify framebuffer fetch implementation. 2019-10-24 11:48:29 +02:00
Hans-Kristian Arntzen
2ca725a78d MSL: Fall back to GLSL path for non-invariant matrix multiply as well. 2019-10-24 11:37:22 +02:00
Hans-Kristian Arntzen
ba4b31e46f MSL: Fall back to GLSL path for non-invariant FP implementation. 2019-10-24 11:34:52 +02:00
Hans-Kristian Arntzen
6edbf0c9e9 MSL: Minor cleanups for texture atomic emulation.
Storing pointers to internal objects is generally not done, IDs are
preferred.
2019-10-24 11:30:20 +02:00
Hans-Kristian Arntzen
43842cefb3 MSL: Cleanup decoration forwarding for SampleMask.
Don't want to create Meta instances unless we have to.
2019-10-24 11:15:35 +02:00
Hans-Kristian Arntzen
db55d474f9 MSL: Do not declare complex composite array in main for non-inlined.
Need to consider that complex composite arrays may be used in leaf
functions, and avoid the MSL library link fix unless everything is
nicely inlined.
2019-10-24 11:12:01 +02:00
Hans-Kristian Arntzen
8ad9584c2e Fix formatting in main.cpp. 2019-10-24 10:56:36 +02:00
Hans-Kristian Arntzen
b1fd6c1990 Add new UE4 folders to CMake testing as well. 2019-10-24 10:54:32 +02:00
Lukas Hermanns
c236ca4572 Moved all UE4 test shaders into 'shaders-ue4/' folder. 2019-10-23 17:39:05 -04:00
Lukas Hermanns
b0d616aa6d Removed 'argument_buffer_offset' and fixed packed matrix Metal output. 2019-10-23 16:28:32 -04:00
Lukas Hermanns
6673a675ba Simplified overriding of 'access_chain_internal' function in CompilerMSL. 2019-10-22 11:06:16 -04:00
Lukas Hermanns
84351d3aed Merge remote-tracking branch 'upstream/master' 2019-10-21 18:55:36 -04:00
Lukas Hermanns
e1b161b54b Removed bounds checks in favor of SPIRV-Tools pass '--graphics-robust-access' 2019-10-21 16:39:53 -04:00
Hans-Kristian Arntzen
ff1897ae0e
Merge pull request #1181 from KhronosGroup/cfg-immediate-dominators
CFG: Compute actual immediate dominators.
2019-10-21 13:46:09 +02:00
Hans-Kristian Arntzen
7be1e51b5a CFG: Compute actual immediate dominators.
This wasn't really a visible bug, since the DominatorBuilder would resolve this
issue, but it is still a bug.
2019-10-21 10:58:25 +02:00
Hans-Kristian Arntzen
a92668bc11
Merge pull request #1179 from KhronosGroup/fix-1178
Fix OpVectorExtractDynamic with spec constant op index.
2019-10-17 13:03:35 +02:00
Hans-Kristian Arntzen
4550f18b37 Fix OpVectorExtractDynamic with spec constant op index.
We cannot lower this to a swizzle, keep it dynamically indexed.
2019-10-17 11:12:14 +02:00
Hans-Kristian Arntzen
87dffb7231
Merge pull request #1177 from KhronosGroup/travis-python-roll
Travis: Update PATH for Python3 on Windows.
2019-10-16 09:26:13 +02:00
Hans-Kristian Arntzen
b8952c4567 Travis: Update PATH for Python3 on Windows.
Version was updated to 3.8, so need to change the custom PATH.
2019-10-16 00:36:14 +02:00
Hans-Kristian Arntzen
4d6a223cbe
Merge pull request #1175 from KhronosGroup/fix-1164
Implement unordered compare on GLSL/HLSL.
2019-10-14 19:01:00 +02:00