Commit Graph

2034 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
2ece908e18
Merge pull request #991 from KhronosGroup/fix-987
MSL: Fix complex type alias declaration order
2019-05-23 18:28:10 +02:00
Hans-Kristian Arntzen
55ff233526 MSL: Add test case for complex type alias. 2019-05-23 15:05:30 +02:00
Hans-Kristian Arntzen
96492648d4 MSL: Fix struct declaration order with complex type aliases.
MSL generally emits the aliases, which means we cannot always place the
master type first, unlike GLSL and HLSL. The logic fix is just to
reorder after we have tagged types with packing information, rather than
doing it in the parser fixup.
2019-05-23 14:54:04 +02:00
Hans-Kristian Arntzen
09c01c2d45 Fix formatting, update C ABI version.
There are some issues with clang-format which require auto-formatting to
be disabled for this file.
2019-05-18 10:47:02 +02:00
Hans-Kristian Arntzen
e04bbd0948 Merge git://github.com/stuartcarnie/SPIRV-Cross 2019-05-18 10:37:38 +02:00
Hans-Kristian Arntzen
3953bf9c20
Merge pull request #973 from KhronosGroup/fix-972
MSL: Support image swizzle workaround with argument buffers
2019-05-18 10:37:04 +02:00
Hans-Kristian Arntzen
eaf7afed97 MSL: Support argument buffers and image swizzling.
Change aux buffer to swizzle buffer.
There is no good reason to expand the aux buffer, so name it
appropriately.

Make the code cleaner by emitting a straight pointer to uint rather than
a dummy struct which only contains a single unsized array member anyways.

This will also end up being very similar to how we implement swizzle
buffers for argument buffers.

Do not use implied binding if it overflows int32_t.
2019-05-18 10:30:06 +02:00
Hans-Kristian Arntzen
a57226e84a
Merge pull request #982 from cdavis5e/msl-subgroup-ops
MSL: Add support for subgroup operations.
2019-05-18 10:28:33 +02:00
Stuart Carnie
72a8c9f35a
Add get_member_name and active_buffer_ranges to C APIs 2019-05-17 17:45:12 -07:00
Hans-Kristian Arntzen
255c6981be
Merge pull request #983 from amerkoleci/fix_spvc_type_get_vector_size
Fix spvc_type_get_vector_size C function.
2019-05-17 17:33:19 +02:00
Amer Koleci
915a3d70b0 Fix spvc_type_get_vector_size C function. 2019-05-17 14:23:26 +02:00
Chip Davis
8983920edf Remove fallback for OpGroupNonUniformElect.
It's not safe to enable subgroup support without this actually working
correctly.
2019-05-16 13:42:09 -05:00
Chip Davis
9d9415754b MSL: Add support for subgroup operations.
Some support for subgroups is present starting in Metal 2.0 on both iOS
and macOS. macOS gains more complete support in 10.14 (Metal 2.1).

Some restrictions are present. On iOS and on macOS 10.13, the
implementation of `OpGroupNonUniformElect` is incorrect: if thread 0 has
already terminated or is not executing a conditional branch, the first
thread that *is* will falsely believe itself not to be. Unfortunately,
this operation is part of the "basic" feature set; without it, subgroups
cannot be supported at all.

The `SubgroupSize` and `SubgroupLocalInvocationId` builtins are only
available in compute shaders (and, by extension, tessellation control
shaders), despite SPIR-V making them available in all stages. This
limits the usefulness of some of the subgroup operations in fragment
shaders.

Although Metal on macOS supports some clustered, inclusive, and
exclusive operations, it does not support them all. In particular,
inclusive and exclusive min, max, and, or, and xor; as well as cluster
sizes other than 4 are not supported. If this becomes a problem, they
could be emulated, but at a significant performance cost due to the need
for non-uniform operations.
2019-05-15 17:40:04 -05:00
Hans-Kristian Arntzen
d11665424d Only deploy on new tags. 2019-05-14 13:56:14 +02:00
Hans-Kristian Arntzen
f647e655d4
Merge pull request #979 from KhronosGroup/github-releases
Add setup for Github releases via Travis.
2019-05-14 11:29:58 +02:00
Hans-Kristian Arntzen
07f0f904ce Add setup for Github releases via Travis. 2019-05-14 10:52:13 +02:00
Hans-Kristian Arntzen
542d6683b8 Validate that C ABI in CMakeLists.txt matches code. 2019-05-14 10:06:33 +02:00
Hans-Kristian Arntzen
45a36ad034 Run format_all.sh. 2019-05-14 09:54:35 +02:00
Hans-Kristian Arntzen
c52d6bcd0c
Merge pull request #975 from alpqr/master
GLSL: Add option to disable buffer blocks regardless of version
2019-05-14 09:51:39 +02:00
Laszlo Agocs
7bc31491be GLSL: Add option to disable buffer blocks regardless of version 2019-05-13 21:29:06 +02:00
Hans-Kristian Arntzen
bf69c1f3ca
Merge pull request #978 from KhronosGroup/fix-974
HLSL/MSL: Deal correctly with nonuniformEXT qualifier.
2019-05-13 17:02:47 +02:00
Hans-Kristian Arntzen
03da32a124 Fix nonuniform test for MSL.
Binding index overlaps.
2019-05-13 15:14:18 +02:00
Hans-Kristian Arntzen
647ddaee42 HLSL/MSL: Deal correctly with nonuniformEXT qualifier.
MSL does not seem to have a qualifier for this, but HLSL SM 5.1 does.
glslangValidator for HLSL does not support this, so skip any validation,
but it passes in FXC.
2019-05-13 14:58:27 +02:00
Hans-Kristian Arntzen
fce83b7e8b
Merge pull request #971 from KhronosGroup/msl-array-texture-swizzle
MSL: Deal with texture swizzle on arrays of images.
2019-05-09 14:26:41 +02:00
Hans-Kristian Arntzen
ac5eea3326 MSL: Add test for passing single swizzled texture arg from array. 2019-05-09 14:19:40 +02:00
Hans-Kristian Arntzen
ad95173a48 Fix GCC 4.x warning. 2019-05-09 12:28:34 +02:00
Hans-Kristian Arntzen
97d39dc9d5 MSL: Deal with texture swizzle on arrays of images. 2019-05-09 11:25:45 +02:00
Hans-Kristian Arntzen
01451583c9
Merge pull request #970 from KhronosGroup/fix-967
GLSL: Support OpBitcast for buffer references.
2019-05-09 11:00:59 +02:00
Hans-Kristian Arntzen
6fcf8c83d9 GLSL: Support OpBitcast for buffer references.
Update glslang/SPIRV-Tools/SPIRV-Headers references.
2019-05-09 10:29:31 +02:00
Hans-Kristian Arntzen
107047a18a
Merge pull request #969 from zoddicus/issue968
Set env to vulkan1.1 for spirv-as in test_shaders.py
2019-05-09 09:59:23 +02:00
Ryan Harrison
d3c59e76db Set env to vulkan1.1 for spirv-as in test_shaders.py
Fixes #968
2019-05-08 14:03:35 -04:00
Hans-Kristian Arntzen
c125bbd248
Merge pull request #966 from KhronosGroup/array-length-hlsl
HLSL: Support OpArrayLength.
2019-05-07 19:03:58 +02:00
Hans-Kristian Arntzen
b6f8a20624 GLSL: Return correct sign for OpArrayLength.
.length() returns int, not uint ...
2019-05-07 19:02:32 +02:00
Hans-Kristian Arntzen
e9da5ed631 HLSL: Support OpArrayLength. 2019-05-07 15:53:41 +02:00
Hans-Kristian Arntzen
ab1fa9011f Accept SPIR-V 1.4 version. 2019-05-07 09:53:40 +02:00
Hans-Kristian Arntzen
dcf6fe32e6
Merge pull request #964 from KhronosGroup/fix-958
GLSL: Support GL_EXT_nonuniform_qualifier.
2019-05-02 13:28:18 +02:00
Hans-Kristian Arntzen
3186701739 GLSL: Support GL_EXT_nonuniform_qualifier. 2019-05-02 11:15:51 +02:00
Hans-Kristian Arntzen
1f3af988db
Merge pull request #961 from cdavis5e/fix-copy-pasto
Fix a copy-pasto.
2019-04-27 01:05:54 +02:00
Chip Davis
01c491648b Fix a copy-pasto. 2019-04-26 17:16:21 -05:00
Hans-Kristian Arntzen
6f091e7c8f GLSL: Support GL_EXT_scalar_block_layout. 2019-04-26 15:43:37 +02:00
Hans-Kristian Arntzen
138d0e326d
Merge pull request #956 from KhronosGroup/buffer-reference
GLSL: Implement GL_EXT_buffer_reference.
2019-04-26 15:43:14 +02:00
Hans-Kristian Arntzen
758427e127 Fix GCC 4.x warning. 2019-04-26 13:09:54 +02:00
Hans-Kristian Arntzen
2cc374a0c8 GLSL: Implement GL_EXT_buffer_reference.
Buffer objects can contain arbitrary pointers to blocks.
We can also implement ConvertPtrToU and ConvertUToPtr.
The latter can cast a uint64_t to any type as it pleases,
so we will need to generate fake buffer reference blocks to be able to
cast the type.
2019-04-26 11:43:51 +02:00
Hans-Kristian Arntzen
f940b6c0c5
Merge pull request #955 from KhronosGroup/fix-953
Fix infinite loop when OpAtomic* temporaries are used in other blocks.
2019-04-24 10:20:10 +02:00
Hans-Kristian Arntzen
8b236f24f1 Fix infinite loop when OpAtomic* temporaries are used in other blocks.
We made the mistake of registering a dependency on the atomic variable
even if the atomic result was forced to a temporary. There is no need to
register reads from atomic variables like this as we always force atomic
results to a temporary and argument read/writes do not need to be
tracked.
2019-04-24 09:33:39 +02:00
Hans-Kristian Arntzen
bbfc31339a
Merge pull request #954 from KhronosGroup/fix-951
Work around false positive warning on GCC 8.3.
2019-04-24 08:51:54 +02:00
Hans-Kristian Arntzen
9420b75314 Work around false positive warning on GCC 8.3. 2019-04-24 08:49:53 +02:00
Hans-Kristian Arntzen
43bbeacae2
Merge pull request #952 from KhronosGroup/fix-950
MSL: Add native texture buffer support.
2019-04-23 15:43:29 +02:00
Hans-Kristian Arntzen
c2715c3908 MSL: Cast texture_buffer index to uint. 2019-04-23 12:46:48 +02:00
Hans-Kristian Arntzen
ae3783c725 Add texture_buffer_native option to C API. 2019-04-23 12:25:42 +02:00