Commit Graph

3168 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
c624d5387c
Merge pull request #1660 from KhronosGroup/fix-1658
MSL: Use proper array for quad tess levels.
2021-04-23 15:21:00 +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
b38e3b4a47
Merge pull request #1661 from KhronosGroup/fix-1659
HLSL: Support Shuffle wave ops.
2021-04-23 13:47:02 +02:00
Hans-Kristian Arntzen
0e963c62b6 HLSL: Support Shuffle wave ops.
WaveReadLaneAt is no longer restricted to dynamically uniform index,
so can implement the other shuffle ops.
2021-04-23 13:03:35 +02:00
Hans-Kristian Arntzen
bbcef69a45
Merge pull request #1657 from KhronosGroup/fix-1607
Rewrite how non-uniform qualifiers are handled.
2021-04-22 16:39:20 +02:00
Hans-Kristian Arntzen
532f65583e Rewrite how non-uniform qualifiers are handled.
Remove all shenanigans with propagation, and only consume nonuniform
qualifiers exactly where needed (last minute).
2021-04-22 16:03:08 +02:00
Hans-Kristian Arntzen
d137abeef5
Merge pull request #1655 from KhronosGroup/fix-1640
GLSL: Support shading rate builtins.
2021-04-20 16:35:02 +02:00
Hans-Kristian Arntzen
8e24e0b224
Merge pull request #1654 from KhronosGroup/fix-1641
GLSL: Implement gl_FragFullyCoveredNV.
2021-04-20 16:34:53 +02:00
Hans-Kristian Arntzen
71eb1754e3
Merge pull request #1653 from KhronosGroup/fix-1638
GLSL: Support GL_EXT_shader_image_load_formatted.
2021-04-20 16:34:44 +02:00
Hans-Kristian Arntzen
2cbc7f0f37
Merge pull request #1652 from KhronosGroup/fix-1644
MSL: Handle variable access in OpSelect.
2021-04-20 16:34:11 +02:00
Hans-Kristian Arntzen
b084f639cb
Merge pull request #1651 from KhronosGroup/fix-1645
HLSL: Fix automatic location assignment in block IO.
2021-04-20 16:34:01 +02:00
Hans-Kristian Arntzen
c89b5a1a3f GLSL: Support shading rate builtins. 2021-04-20 13:58:07 +02:00
Hans-Kristian Arntzen
3fd148450a GLSL: Implement gl_FragFullyCoveredNV. 2021-04-20 13:44:52 +02:00
Hans-Kristian Arntzen
f93a8fb1fe GLSL: Support GL_EXT_shader_image_load_formatted. 2021-04-20 13:36:51 +02:00
Hans-Kristian Arntzen
90c70e6605 MSL: Handle variable access in OpSelect.
CFG analysis needs to know if we need to take address of variable.
2021-04-20 13:20:49 +02:00
Hans-Kristian Arntzen
96ba044f01 HLSL: Fix automatic location assignment in block IO. 2021-04-20 13:04:26 +02:00
Hans-Kristian Arntzen
3cb8e7c223
Merge pull request #1643 from KhronosGroup/fix-1639
Add some interfaces to aid with LTO-style optimization
2021-04-19 16:21:59 +02:00
Hans-Kristian Arntzen
ae9ca7d73c MSL: Fix copy of arrays to/from stage IO variables.
Need to take into account effective storage classes and whether or not
we target stage IO blocks since native arrays are conditionally enabled.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
986196030d MSL: Don't use native arrays for tess level inputs. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
4a379a00f3 MSL: Don't emit native array for masked clip/cull distance. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
406af8ff4d c: Add C API for builtin stage IO reflection. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
b4a380a04c Support reflecting builtins.
They were ignored in input/output variables.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
852f2da63c Check SPIR-V 1.4 rules when reflecting resources. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
682a227f4b MSL: Make builtin argument type declaration context sensitive.
Sometimes we'll need array template, sometimes not 🤷.
2021-04-19 12:10:49 +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
5826298697 MSL: Handle CullDistance better. 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
ee85bb345e Fix print_help comment. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
faf80b08fc MSL: Don't report fallback location allocations as being "used".
It may shadow unused *real* inputs and confuse applications.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
adc5fe3615 C: Add C api for stage output masking. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
5e9c2d060e MSL: Cleanup fallback IO block emission.
Need to emit in add_variable_to_iface(). Unifies the code paths a fair
bit.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
e32c474911 MSL: Handle masking of TESC IO block members. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
dc54f75eec MSL: Fixup gl_PerVertex names if we're emitting masked builtins. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
40f628f49c MSL: Add test for complex control point outputs. 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
425e968720 MSL: Handle flattening of patch block outputs as well.
Always propagate InterfaceMember decoration.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
8e2dbe0d38 MSL: Do not declare patch variables on stack. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
ff3f5bcba5 MSL: Handle masking of builtin control points. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
6ecdd64a91 MSL: Emit a masked builtin IO block if necessary. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
436b1250da MSL: Do not perform scalar fixups for control-point outputs. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
22c9b63e78 MSL: Fix argument_decl check for builtin. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
c635c35c12 MSL: Temporarily allow empty output struct. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
a59e25db18 MSL: Small refactors. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
74b2acab9b MSL: Always emit block variable for block types. 2021-04-19 12:10:49 +02:00