Commit Graph

7 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
a3fe9756d2 MSL: Support ClipDistance as an input stage variable.
MSL does not support this, so we have to emulate it by passing it around
as a varying between stages. We use a special "user(clipN)" attribute
for this rather than locN which is used for user varyings.
2019-12-02 13:19:42 +01: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
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
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
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
Lukas Hermanns
c236ca4572 Moved all UE4 test shaders into 'shaders-ue4/' folder. 2019-10-23 17:39:05 -04:00