Commit Graph

2726 Commits

Author SHA1 Message Date
Bill Hollings
b7b0e804e5 MSL: Support run-time sized image and sampler arrays
(GL_EXT_nonuniform_qualifier/SPV_EXT_descriptor_indexing).

MSLResourceBinding includes array size through API, and substitutes
in that size if the image or sampler array is not explicitly sized.
OpCopyObject supports SPIRCombinedImageSampler type in MSL.
2020-10-29 18:50:42 -04:00
Hans-Kristian Arntzen
78c6d2d628
Merge pull request #1509 from cdavis5e/mac-post-depth-coverage
MSL: Allow post-depth coverage on Mac in MSL 2.3.
2020-10-29 09:50:44 +01:00
Hans-Kristian Arntzen
08e49bfd67
Merge pull request #1508 from KhronosGroup/fix-1507
Handle case where block is loop header, continue AND break block.
2020-10-28 16:04:14 +01:00
Hans-Kristian Arntzen
346b0b6c21
Merge pull request #1493 from KhronosGroup/ubo-row-major-load-workaround
GLSL: Support a workaround for loading row-major matrices
2020-10-28 10:31:54 +01:00
Chip Davis
d48d2a95c7 MSL: Allow post-depth coverage on Mac in MSL 2.3.
It's still only supported on Apple GPUs, but Macs will have those soon.
2020-10-27 22:07:01 -05:00
Hans-Kristian Arntzen
542d460364 Handle case where block is loop header, continue AND break block. 2020-10-27 12:29:08 +01:00
Hans-Kristian Arntzen
e47561a28b GLSL: Support a workaround for loading row-major matrices.
On AMD Windows OpenGL, it has been reported that we need to load
matrices via a wrapper function.
2020-10-27 12:07:09 +01:00
Hans-Kristian Arntzen
5ae9153a78
Merge pull request #1505 from cdavis5e/msl-vertex-writes
MSL: For 2.1+, don't disable rasterization for vertex writes.
2020-10-27 12:00:42 +01:00
Chip Davis
1b6b9705e6 MSL: For 2.1+, don't disable rasterization for vertex writes.
Writing to buffers actually works starting in MSL 2.1 (macOS 10.14,
iOS 12). Writing to textures works starting in MSL 2.2 (macOS 10.15, iOS
13).

No tests unfortunately, because the MSL 2.2 compiler and above produce a
warning that cannot be disabled, because it has no associated option.
2020-10-26 11:43:13 -05:00
Hans-Kristian Arntzen
1a95017d11
Merge pull request #1503 from KhronosGroup/travis-python-update
Update TravisCI python reference.
2020-10-26 17:40:59 +01:00
Hans-Kristian Arntzen
b3a74f3a22
Merge pull request #1504 from KhronosGroup/fix-1502
MSL: Do not use component::x gather for depth2d textures.
2020-10-26 17:40:46 +01:00
Hans-Kristian Arntzen
f65f259ab7 MSL: Do not use component::x gather for depth2d textures. 2020-10-26 10:18:17 +01:00
Hans-Kristian Arntzen
1d68cbfb1b Update TravisCI python reference. 2020-10-26 09:55:10 +01:00
Hans-Kristian Arntzen
dd35821f2f
Merge pull request #1499 from cdavis5e/subgroup-fixes
Subgroup fixes
2020-10-26 09:47:39 +01:00
Chip Davis
1264e2705e MSL: Cast broadcast booleans to ushort.
Metal doesn't support broadcasting or shuffling boolean values, but we
can work around that by casting it to `ushort`, then casting it back to
`bool`. I used `ushort` instead of `uint` because 16-bit values give
better throughput on Apple GPUs.
2020-10-23 21:55:46 -05:00
Chip Davis
065b5bda3c MSL: Mask ballots passed to Ballot bit ops.
Only the least *n* bits are significant, where *n* is the subgroup size.
The Vulkan CTS actually checks this.

The `FindLSB` tests weren't actually failing, but I masked that anyway,
in case there's some corner case the CTS is missing.
2020-10-23 21:55:46 -05:00
Chip Davis
781367d083 MSL: Support vectors with OpGroupNonUniformAllEqual.
This was not tested here in SPIRV-Cross. Predictably, it broke when I
tried it in the CTS.
2020-10-23 21:55:46 -05:00
Chip Davis
6ccb902462 MSL: Correct definitions of subgroup ballot mask variables.
`SubgroupEqMask` had a fencepost error that gave wrong values for
invocation ID 32.

For `SubgroupGeMask` and `SubgroupGtMask`, I forgot to shift the values
from `extract_bits()` up so that the mask is in the correct position.
Using `insert_bits()` instead should fold these two operations into one.

`SubgroupLtMask` and `SubgroupLeMask` were already correct.
2020-10-23 21:54:55 -05:00
Hans-Kristian Arntzen
a57b4b1b2e
Merge pull request #1498 from cdavis5e/msl-swizzle-arrayed-nonconstant
MSL: Don't remove periods from swizzle buffer index exprs.
2020-10-22 13:24:49 +02:00
Chip Davis
064ed448b9 MSL: Don't remove periods from swizzle buffer index exprs. 2020-10-20 17:47:40 -05:00
Hans-Kristian Arntzen
7b80307a7d
Merge pull request #1495 from cdavis5e/1d-2d-offset-grad
MSL: Handle Offset and Grad operands for 1D-as-2D textures.
2020-10-20 10:29:17 +02:00
Chip Davis
5845e009ea MSL: Handle Offset and Grad operands for 1D-as-2D textures. 2020-10-15 12:51:00 -05:00
Hans-Kristian Arntzen
0db1569e97
Merge pull request #1492 from KhronosGroup/non-native-matrix-fix
GLSL: Use need_transpose when checking for non-native matrix.
2020-10-15 10:52:44 +02:00
Hans-Kristian Arntzen
9c220a8247
Merge pull request #1490 from KhronosGroup/fix-1488
MSL: Support querying and modifying generated combined sampler suffix.
2020-10-15 10:52:28 +02:00
Hans-Kristian Arntzen
23a0cfc842
Merge pull request #1494 from cdavis5e/msl-tesc-tess-level-cast
MSL: Don't use a bitcast for tessellation levels in tesc shaders.
2020-10-15 10:52:11 +02:00
Chip Davis
3e6010d8c5 MSL: Don't use a bitcast for tessellation levels in tesc shaders.
`half` cannot be bitcasted to `float`, because the two types are not the
same size. Use an expanding cast instead.

We were already doing this for stores to the tessellation levels; why I
didn't also do this for loads is beyond me.
2020-10-14 18:35:59 -05:00
Hans-Kristian Arntzen
120af42616 GLSL: Use need_transpose when checking for non-native matrix. 2020-10-14 16:07:10 +02:00
Hans-Kristian Arntzen
bd1ee4344e MSL: Support querying and modifying generated combined sampler suffix. 2020-10-14 14:52:18 +02:00
Hans-Kristian Arntzen
7332b44c3c
Merge pull request #1489 from cdavis5e/msl-fix-atomic-image-coord
MSL: Fix calculation of atomic image buffer address.
2020-10-14 10:44:59 +02:00
Chip Davis
21d38f74ce MSL: Fix calculation of atomic image buffer address.
Fix reversed coordinates: `y` should be used to calculate the row
address. Align row address to the row stride.

I've made the row alignment a function constant; this makes it possible
to override it at pipeline compile time.

Honestly, I don't know how this worked at all for Epic. It definitely
didn't work in the CTS prior to this.
2020-10-13 20:51:56 -05:00
Hans-Kristian Arntzen
e827a06984
Merge pull request #1487 from cdavis5e/msl-atomic-image-interlock
MSL: Add missing interlock handling to atomic image buffers.
2020-10-14 00:35:56 +02:00
Chip Davis
7a5d0d6b29 MSL: Add missing interlock handling to atomic image buffers. 2020-10-13 11:44:17 -05:00
Hans-Kristian Arntzen
fab6ad234e
Merge pull request #1486 from cdavis5e/atomic-image-argument-buffer
MSL: Support atomic access to images from argument buffers.
2020-10-13 12:55:43 +02:00
Hans-Kristian Arntzen
cc7aabce72
Merge pull request #1485 from cdavis5e/msl23-demote-to-helper
MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3.
2020-10-13 12:47:46 +02:00
Chip Davis
9cafea6cf8 MSL: Support atomic access to images from argument buffers.
This was not added when Epic contributed atomic image support.

Fixes #1484.
2020-10-13 02:37:18 -05:00
Chip Davis
2219c4a392 MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3.
MSL 2.3 has everything needed to support this extension on all
platforms. The existing `discard_fragment()` function was given demote
semantics, similar to Direct3D, and the `simd_is_helper_thread()`
function was finally added to iOS.

I've left the old test alone. Should I remove it in favor of these?
2020-10-13 00:25:32 -05:00
Hans-Kristian Arntzen
401af49326
Merge pull request #1482 from KhronosGroup/gl-subgroup-merge
Merge GL subgroup support.
2020-10-08 17:19:07 +02:00
Hans-Kristian Arntzen
5619329665 Style nits for GL subgroup implementation. 2020-10-08 13:25:29 +02:00
Hans-Kristian Arntzen
a6f6547cf1 Add missing VK variant of the test file. 2020-10-08 12:22:45 +02:00
Hans-Kristian Arntzen
28994a3186 Update GL subgroup test file. 2020-10-08 12:22:24 +02:00
Hans-Kristian Arntzen
819c599ecd Merge branch 'issues1350-2' of git://github.com/devshgraphicsprogramming/SPIRV-Cross into master 2020-10-08 12:20:07 +02:00
criss
db52e277b9 Resolved issues 1350, 1351, 1352 2020-10-08 12:14:52 +02:00
Hans-Kristian Arntzen
5cc2e4f634
Merge pull request #1475 from KhronosGroup/fix-1474
GLSL: Support geometry streams.
2020-09-30 16:16:48 +02:00
Hans-Kristian Arntzen
e0c9aad934 GLSL: Add support for transform_feedback3 geometry streams. 2020-09-30 13:01:35 +02:00
Hans-Kristian Arntzen
7a99d1cb72 GLSL: Use literal array size for cull/clip array sizes. 2020-09-30 13:01:18 +02:00
Hans-Kristian Arntzen
e6f5ce6b89
Merge pull request #1471 from KhronosGroup/fix-1467
Work around MSVC warning.
2020-09-28 18:47:29 +02:00
Hans-Kristian Arntzen
6254be910e
Merge pull request #1470 from KhronosGroup/fix-1469
Allow flip_vert_y in all relevant stages.
2020-09-28 18:46:55 +02:00
Hans-Kristian Arntzen
34a6a45fba Work around MSVC warning. 2020-09-28 14:12:54 +02:00
Hans-Kristian Arntzen
5ea576ece2 Allow flip_vert_y in all relevant stages. 2020-09-28 14:10:08 +02:00
Hans-Kristian Arntzen
ea3cd74426
Merge pull request #1468 from dj2/roll-09-22
Roll dependencies.
2020-09-24 20:00:59 +02:00