Hans-Kristian Arntzen
fe8848a6f2
Roll dependencies.
2022-01-05 14:56:01 +01:00
Hans-Kristian Arntzen
21a15b90e5
Merge pull request #1804 from KhronosGroup/fix-1759
...
MSL: Handle non-thread storage class in Modf/Frexp pointer versions.
2021-11-07 13:36:32 +01:00
Hans-Kristian Arntzen
e40d19bdbf
MSL: Handle non-thread storage class in Modf/Frexp pointer versions.
2021-11-07 12:51:15 +01:00
Hans-Kristian Arntzen
4561ecddbd
Handle Modf/Frexp in more cases.
...
Consider it a write to a variable, similar to OpStore.
2021-11-07 11:36:44 +01:00
Hans-Kristian Arntzen
6382f15470
Test behavior around OpSelect with matrices.
2021-10-13 16:08:29 +02:00
Hans-Kristian Arntzen
6071df5840
Fix wrong detection of trivial_mix_op.
...
Effectively, only the last component of the select was considered, need
to correctly early out if any case is hit.
2021-10-13 15:34:00 +02:00
Hans-Kristian Arntzen
f72bb3c6f5
Improve handling of INT_MIN/INT64_MIN literals.
...
We cannot naively convert these to decimal literals. C/C++ (and thus
MSL) has extremely awkward literal promotion rules.
2021-09-30 16:29:30 +02:00
Bill Hollings
ec054dad7f
MSL: Support synthetic functions in function constants.
...
Emit synthetic functions before function constants.
Support use of spvQuantizeToF16() in function constants for numerical
behavior consistency with the op code.
Ensure subnormal results from OpQuantizeToF16 are flushed to zero per SPIR-V spec.
Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
Any MSL reference shader that inclues a synthetic function is affected,
since the location it is emitted has changed.
2021-09-28 19:10:16 -04:00
Bill Hollings
40141ffddf
MSL: Selectively enable fast-math in MSL code to match Vulkan CTS results.
...
Based on CTS testing, math optimizations between MSL and Vulkan are inconsistent.
In some cases, enabling MSL's fast-math compilation option matches Vulkan's math
results. In other cases, disabling it does. Broadly enabling or disabling fast-math
across all shaders results in some CTS test failures either way.
To fix this, selectively enable/disable fast-math optimizations in the MSL code,
using metal::fast and metal::precise function namespaces, where supported, and
the [[clang::optnone]] function attribute otherwise.
Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-22 18:58:31 -04:00
Hans-Kristian Arntzen
2eea6a579b
MSL: Consider that function/private variables can be block-like.
...
Handles a special case with array copies.
The implementation of this fix is not perfect, but should be good
enough for time being.
2021-08-23 13:26:45 +02:00
Chip Davis
03ad13bae6
MSL: Simplify spvSubgroupBallot().
...
A bitcast to `uint2` will do just fine. I honestly don't know why I
didn't do it this way earlier.
2021-07-21 00:25:09 -05:00
Hans-Kristian Arntzen
71b83a18f4
MSL: Add test for scalar access chain pull interpolant.
2021-07-13 12:25:18 +02:00
Hans-Kristian Arntzen
8216e87f02
Handle SPIR-V 1.4 selection constructs.
...
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.
2021-06-28 12:23:44 +02:00
Hans-Kristian Arntzen
165dbff228
Handle odd type for textureGather component.
2021-06-03 11:37:45 +02:00
Hans-Kristian Arntzen
bf3793dd35
MSL: Improve handling of split tessellation access chains.
2021-05-21 16:32:03 +02:00
Hans-Kristian Arntzen
99ae0d32e9
MSL: Handle array with component when we cannot rely on user() attrib.
...
In these cases, we emit one variable per location, and so we must
flatten stuff.
2021-05-21 13:46:33 +02:00
Lukas Taparauskas
72a2ec4c1b
MSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more threads than control points ( #1662 )
...
* Fix '--msl-multi-patch-workgroup' cases where thread count exceeds data bounds
*Fix gl_PrimitiveID off by one error when computing last valid index
*Point gl_out to the last patch's data when threads exceed input data bounds
*Point patchOut to the last patch's data when threads exceed input data bounds
* Update MSL test expectations.
* Undo change to MSL multi-patch hull output bound checks
* Update MSL multi-patch test expectations.
2021-04-29 20:01:26 +02:00
Hans-Kristian Arntzen
82a77e534e
MSL: Use proper array for quad tess levels.
...
We need to handle loads from array as well, so the float4 hack doesn't
work.
2021-04-23 14:12:00 +02:00
Hans-Kristian Arntzen
c1edd35d57
MSL: Use spvUnsafeArray for builtin arrays after all.
...
It will get too messy to deal with constant initializers any other way,
so just deal with complexity in argument_decl instead ...
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
7b9a591aa7
MSL: Hoist out to_tesc_invocation_id() in more places.
...
When emitting fixup code, we might not have gl_InvocationID yet.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
75ed73818c
MSL: Handle loading Clip/CullDistance in TESE.
...
Need to allow the flattened space to go through in some edge cases where
we cannot reasonably unflatten.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
a159334895
MSL: Correctly analyze if builtin block is active.
...
Need to consider all members, bi_type is invalid for Blocks, need to
look at member decorations.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
cea934c03f
MSL: Test that we can capture cull distance to buffer.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
23da445bd4
MSL: Emit multiple threadgroup slices for multi-patch.
...
Multiple patches can run in the same workgroup when using multi-patch
mode, so we need to allocate enough storage to avoid false sharing.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
b442500204
MSL: Unroll initializations of CullDistance/ClipDistance control points.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
c9946296dd
MSL: Fix initialization of masked threadgroup variables.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
46c48ee6b5
MSL: Rewrite how IO blocks are emitted in multi-patch mode.
...
Firstly, never flatten inputs or outputs in multi-patch mode.
The main scenario where we do need to care is Block IO.
In this case, we should only flatten the top-level member, and after
that we use access chains as normal.
Using structs in Input storage class is now possible as well. We don't
need to consider per-location fixups at all here. In Vulkan, IO structs
must match exactly. Only plain vectors can have smaller vector sizes as
a special case.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
65b5ff7ece
MSL: Don't emit weird reference type for spvUnsafeArray types.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
0997e81118
MSL: Sort builtin IO block members by builtin type.
...
Ensures consistent block matching.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
fb1f295aaf
Merge pull request #1635 from KhronosGroup/fix-1627
...
Handle edge cases in OpCopyMemory.
2021-03-09 10:21:35 +01:00
Hans-Kristian Arntzen
4ca06c7278
Handle edge cases in OpCopyMemory.
...
Implement this by synthesizing an OpLoad/OpStore pair instead.
2021-03-08 14:15:27 +01:00
Hans-Kristian Arntzen
aea6d29aa8
MSL: Add test for logical subgroup arith ops.
2021-03-08 12:57:37 +01:00
Hans-Kristian Arntzen
97796e0609
MSL: Deal with pointer-to-pointer qualifier ordering.
2021-02-26 13:37:14 +01:00
Hans-Kristian Arntzen
621884d709
Merge pull request #1622 from KhronosGroup/fix-1619
...
MSL: Handle load and store to TessLevel array in TESC.
2021-02-17 20:46:06 +01:00
Hans-Kristian Arntzen
85704f70bc
MSL: Handle load and store to TessLevel array in TESC.
...
More edge cases ... :(
2021-02-17 13:26:08 +01:00
Hans-Kristian Arntzen
ce552f4f91
MSL: Gracefully assign automatic input locations to builtin attributes.
2021-02-17 12:29:19 +01:00
Hans-Kristian Arntzen
daddbd4078
MSL: Fixup type when using tessellation levels in TESC functions.
...
Need to rewrite array size depending on execution mode.
2021-02-15 13:28:11 +01:00
Hans-Kristian Arntzen
ea02a0c03a
Check entry point variables in is_hidden_variables.
...
Need to be careful not to emit globals we're not supposed to.
2021-01-22 13:53:22 +01:00
Hans-Kristian Arntzen
7ab3f3f74e
Deal better with CompositeExtract from constant composite.
...
There is no good reason for applications to emit this kind of code, but
some do. Special case this scenario.
2021-01-22 12:30:16 +01:00
Hans-Kristian Arntzen
893a011299
MSL: Fix various bugs with framebuffer fetch on macOS and argument buffers.
...
Introduce a helper to make it clearer if a resource can be
considered for argument buffers or not.
2021-01-08 10:19:18 +01:00
Hans-Kristian Arntzen
3136e34215
MSL: Always use input_attachment_index for framebuffer fetch binding.
...
--msl-decoration-binding would end up overriding the input attachment
index to binding which is very unexpected and broken.
2021-01-08 10:17:42 +01:00
Hans-Kristian Arntzen
03ee71e86c
Add test for pure initializer gl_FragDepth.
...
Tests that the builtin is considered active.
2021-01-07 15:32:15 +01:00
Hans-Kristian Arntzen
014b3bc5ea
MSL: Make sure initialized output builtins are considered active.
2021-01-07 15:32:13 +01:00
Hans-Kristian Arntzen
a4a9b53b5b
MSL: Always enable Outputs in vertex stages.
...
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.
2021-01-07 11:24:47 +01:00
Hans-Kristian Arntzen
fa76d01203
MSL: Only consider builtin variables if they are part of IO interface.
2021-01-07 10:50:29 +01:00
Hans-Kristian Arntzen
efed4c9738
MSL: Fix initializer for tess level outputs.
...
It's an array, not vector.
2021-01-06 10:39:39 +01:00
Hans-Kristian Arntzen
ab9200ffdf
MSL: Don't flatten builtin arrays unless they're part of IO interface.
2021-01-06 10:33:17 +01:00
Hans-Kristian Arntzen
df4f8ef8fe
MSL: Emit correct initializer for tessellation control points.
2021-01-05 15:16:49 +01:00
Hans-Kristian Arntzen
ad3e1584f9
MSL: Handle initializers for tess levels.
2021-01-05 13:25:50 +01:00
Hans-Kristian Arntzen
a1c784f002
More robust handling of initialized output builtin variables.
2021-01-04 19:12:43 +01:00