Hans-Kristian Arntzen [Wed, 7 Apr 2021 10:55:47 +0000 (12:55 +0200)]
MSL: Temporarily allow empty output struct.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 10:55:26 +0000 (12:55 +0200)]
MSL: Small refactors.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 08:55:40 +0000 (10:55 +0200)]
MSL: Always emit block variable for block types.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 13:50:02 +0000 (15:50 +0200)]
MSL: Test that we can mask location writes in TESC.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 13:13:19 +0000 (15:13 +0200)]
MSL: Explicitly only consider masked variables to be thread-group-like.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:43:34 +0000 (14:43 +0200)]
MSL: Fix masking of vertex block outputs.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:12:24 +0000 (14:12 +0200)]
MSL: Refactor out variable/block member masking.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:39:04 +0000 (13:39 +0200)]
MSL: Add tests for masking with --for-tess.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:33:16 +0000 (13:33 +0200)]
MSL: Remove position mask tests. They will fail compilation.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:28:45 +0000 (13:28 +0200)]
MSL: Emit correct address space for masked arguments.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:27:56 +0000 (13:27 +0200)]
MSL: Don't emit weird reference type for spvUnsafeArray types.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 10:57:00 +0000 (12:57 +0200)]
MSL: Handle masked outputs in extract_global_variables.
Need to conditionally add gl_in or gl_out.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 10:25:22 +0000 (12:25 +0200)]
MSL: Force builtin arrays for builtin array types.
Handles argument_decl() correctly.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 09:49:07 +0000 (11:49 +0200)]
MSL: Add tests for vertex output masking.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 09:35:04 +0000 (11:35 +0200)]
MSL: Do not consider effective storage for any composite.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 16:28:42 +0000 (17:28 +0100)]
MSL: Handle effective storage for masked CP outputs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 16:23:44 +0000 (17:23 +0100)]
MSL: Emit threadgroup storage class for masked control point outputs.
Shader can still rely on writes to threadgroup memory to be visible.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 15:16:03 +0000 (16:16 +0100)]
MSL: Do not redirect tess access chains on masked outputs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 14:58:41 +0000 (15:58 +0100)]
Add --mask-stage-output-* CLI options.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 14:58:23 +0000 (15:58 +0100)]
MSL: Correctly emit array type for masked outputs.
Hans-Kristian Arntzen [Thu, 25 Mar 2021 17:08:49 +0000 (18:08 +0100)]
MSL: Sketch out API to aid LTO-style optimization.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 10:00:35 +0000 (11:00 +0100)]
Clean up member sorting.
Hans-Kristian Arntzen [Thu, 25 Mar 2021 15:48:01 +0000 (16:48 +0100)]
MSL: Sort builtin IO block members by builtin type.
Ensures consistent block matching.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:59:53 +0000 (14:59 +0200)]
MSVC: Add /bigobj for debug builds.
Hans-Kristian Arntzen [Mon, 19 Apr 2021 08:36:02 +0000 (10:36 +0200)]
Merge pull request #1648 from billhollings/msl-pad-arg-buff-structs
MSL: Support padding Metal argument buffer entries based on argument index.
Bill Hollings [Sun, 18 Apr 2021 21:34:55 +0000 (17:34 -0400)]
MSL: Fixes to support padding Metal argument buffer entries based on argument index.
For buffers, support all MSLResourceBinding::basetype pointers, not just void*.
Rename MSLResourceBinding::base_type to basetype for consistent use in other structs.
Bill Hollings [Sat, 17 Apr 2021 19:20:53 +0000 (15:20 -0400)]
MSL: Fixes to support padding Metal argument buffer entries based on argument index.
For completeness, add [[id(N)]] qualifier to padding struct members.
Run clang-format.
Bill Hollings [Fri, 16 Apr 2021 19:00:59 +0000 (15:00 -0400)]
MSL: Fixes to support padding Metal argument buffer entries based on argument index.
Use separate lookups for texture and sampler members when padding for SamplerImages.
Remove unreachable code following SPIRV_CROSS_THROW.
Bill Hollings [Fri, 16 Apr 2021 13:05:15 +0000 (09:05 -0400)]
MSL: Fixes to support padding Metal argument buffer entries based on argument index.
Add lookup from argument buffer argument index to resource binding for efficiency.
Fix error in advancing padding counts with combined image samplers.
Run clang-format.
Bill Hollings [Thu, 15 Apr 2021 14:04:45 +0000 (10:04 -0400)]
Merge branch 'master' of https://github.com/billhollings/SPIRV-Cross into msl-pad-arg-buff-structs
Hans-Kristian Arntzen [Wed, 14 Apr 2021 14:20:16 +0000 (16:20 +0200)]
Merge pull request #1650 from Dredhog/active-builtins-c-api
c: Add missing API to update and query active builtins.
lukas.taparauskas [Wed, 14 Apr 2021 13:19:50 +0000 (16:19 +0300)]
c: Remove SPVC_PUBLIC_API prefix from API implementation
lukas.taparauskas [Wed, 14 Apr 2021 12:44:00 +0000 (15:44 +0300)]
c: Add missing API to query active builtins.
Bill Hollings [Tue, 13 Apr 2021 23:01:20 +0000 (19:01 -0400)]
MSL: Support padding Metal argument buffer entries based on argument index.
If CompilerMSL::Options::pad_argument_buffer_resources enabled, Metal argument buffer
struct members are positionally aligned to their argument indexes by adding synthetic
padding members when needed. The types and sizes of these synthetic members are
identified in the resource_bindings vector provided through the API.
Add CompilerMSL::Options::pad_argument_buffer_resources to enable padding
Metal argument buffer structs to positionally match members to argument indexes.
Add MSLResourceBinding::base_type to identify resource type through API.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 17:40:43 +0000 (18:40 +0100)]
Fix Github CI in PRs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 17:02:25 +0000 (18:02 +0100)]
Merge pull request #1642 from mehmetoguzderin/msl-long-ulong-member
MSL: Support long ulong types in buffers in 2.3+.
Mehmet Oguz Derin [Fri, 26 Mar 2021 13:29:44 +0000 (16:29 +0300)]
Move condition to default block
Mehmet Oguz Derin [Thu, 25 Mar 2021 23:41:26 +0000 (02:41 +0300)]
MSL: Support long ulong types in buffers in 2.3+.
[Metal Shading Language Specification](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) states that:
> Note: As of Metal 2.3, Metal supports buffers that contain long or ulong data types.
This PR aims to support long and ulong data types in buffers for Metal 2.3+.
Hans-Kristian Arntzen [Fri, 12 Mar 2021 14:36:03 +0000 (15:36 +0100)]
Use Github actions CI tag.
Hans-Kristian Arntzen [Fri, 12 Mar 2021 11:51:53 +0000 (12:51 +0100)]
Add GitHub Actions script.
Hans-Kristian Arntzen [Tue, 9 Mar 2021 14:17:21 +0000 (15:17 +0100)]
Merge pull request #1633 from KhronosGroup/fix-1626
GLSL: Handle complex load/store scenarios to gl_SampleMask.
Hans-Kristian Arntzen [Mon, 8 Mar 2021 10:51:51 +0000 (11:51 +0100)]
GLSL: Handle complex load/store scenarios to gl_SampleMask.
Need special workarounds to handle array load/store since array size is
unsized in GLSL, and array copy is not possible.
Also, consider bitcast for scalar loads and stores.
Hans-Kristian Arntzen [Tue, 9 Mar 2021 09:21:35 +0000 (10:21 +0100)]
Merge pull request #1635 from KhronosGroup/fix-1627
Handle edge cases in OpCopyMemory.
Hans-Kristian Arntzen [Tue, 9 Mar 2021 09:21:24 +0000 (10:21 +0100)]
Merge pull request #1634 from KhronosGroup/fix-1625
Handle logical subgroup arithmetic ops
Hans-Kristian Arntzen [Tue, 9 Mar 2021 09:21:10 +0000 (10:21 +0100)]
Merge pull request #1632 from KhronosGroup/fix-1629
Throw if SPIR-V module has no entry points.
Hans-Kristian Arntzen [Mon, 8 Mar 2021 13:09:32 +0000 (14:09 +0100)]
Handle edge cases in OpCopyMemory.
Implement this by synthesizing an OpLoad/OpStore pair instead.
Hans-Kristian Arntzen [Mon, 8 Mar 2021 11:57:37 +0000 (12:57 +0100)]
MSL: Add test for logical subgroup arith ops.
Hans-Kristian Arntzen [Mon, 8 Mar 2021 11:52:03 +0000 (12:52 +0100)]
HLSL: Support logical subgroup ops.
Hans-Kristian Arntzen [Mon, 8 Mar 2021 11:06:46 +0000 (12:06 +0100)]
GLSL: Add support for Logical subgroup ops.
Completely missed these ...
Hans-Kristian Arntzen [Mon, 8 Mar 2021 09:39:59 +0000 (10:39 +0100)]
Throw if SPIR-V module has no entry points.
Hans-Kristian Arntzen [Fri, 26 Feb 2021 14:51:52 +0000 (15:51 +0100)]
Merge pull request #1630 from KhronosGroup/fix-1628
MSL: Deal with pointer-to-pointer qualifier ordering.
Hans-Kristian Arntzen [Fri, 26 Feb 2021 11:50:24 +0000 (12:50 +0100)]
MSL: Deal with pointer-to-pointer qualifier ordering.
Hans-Kristian Arntzen [Wed, 17 Feb 2021 19:46:06 +0000 (20:46 +0100)]
Merge pull request #1622 from KhronosGroup/fix-1619
MSL: Handle load and store to TessLevel array in TESC.
Hans-Kristian Arntzen [Wed, 17 Feb 2021 19:45:57 +0000 (20:45 +0100)]
Merge pull request #1623 from phuang/patch-2
Add two missing source files
Peng Huang [Wed, 17 Feb 2021 16:14:04 +0000 (11:14 -0500)]
Add two missing source files
Hans-Kristian Arntzen [Wed, 17 Feb 2021 15:59:30 +0000 (16:59 +0100)]
Merge pull request #1621 from KhronosGroup/fix-1618
MSL: Fix automatic assign of builtin attributes in tessellation
Hans-Kristian Arntzen [Wed, 17 Feb 2021 12:18:47 +0000 (13:18 +0100)]
MSL: Handle load and store to TessLevel array in TESC.
More edge cases ... :(
Hans-Kristian Arntzen [Wed, 17 Feb 2021 11:21:21 +0000 (12:21 +0100)]
MSL: Gracefully assign automatic input locations to builtin attributes.
Hans-Kristian Arntzen [Wed, 17 Feb 2021 10:29:33 +0000 (11:29 +0100)]
MSL: Refactor out location consumption count computation.
Hans-Kristian Arntzen [Wed, 17 Feb 2021 09:42:58 +0000 (10:42 +0100)]
Add comment where aux image atomic buffers are reflected from.
They also use secondary bindings, not just samplers.
Hans-Kristian Arntzen [Wed, 17 Feb 2021 09:30:10 +0000 (10:30 +0100)]
Merge pull request #1620 from phuang/patch-1
Fix build errors on Windows
Peng Huang [Wed, 17 Feb 2021 01:42:00 +0000 (20:42 -0500)]
Fix build errors on Windows
error:
clang-cl: error: unknown argument ignored in clang-cl: '-fno-exceptions'
Hans-Kristian Arntzen [Tue, 16 Feb 2021 10:10:07 +0000 (11:10 +0100)]
Merge pull request #1617 from KhronosGroup/fix-1608
MSL: Fixup type when using tessellation levels in TESC functions.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 17:19:55 +0000 (18:19 +0100)]
Merge pull request #1616 from KhronosGroup/fix-1609
MSL: Always return [[position]] when required.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 12:28:11 +0000 (13:28 +0100)]
MSL: Fixup type when using tessellation levels in TESC functions.
Need to rewrite array size depending on execution mode.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 11:49:37 +0000 (12:49 +0100)]
MSL: Always return [[position]] when required.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 10:45:20 +0000 (11:45 +0100)]
Merge pull request #1615 from KhronosGroup/fix-1612
c: Add missing IOS_SUPPORT_BASE_VERTEX_INSTANCE option.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 10:43:46 +0000 (11:43 +0100)]
c: Add missing IOS_SUPPORT_BASE_VERTEX_INSTANCE option.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 10:40:25 +0000 (11:40 +0100)]
Merge pull request #1614 from KhronosGroup/fix-1610
HLSL: Add vector to illegal names list.
Hans-Kristian Arntzen [Mon, 15 Feb 2021 10:38:14 +0000 (11:38 +0100)]
HLSL: Add vector to illegal names list.
Bill Hollings [Fri, 29 Jan 2021 18:36:15 +0000 (13:36 -0500)]
Merge pull request #1606 from billhollings/position-invariance
Expose position invariance.
Bill Hollings [Thu, 28 Jan 2021 21:13:20 +0000 (16:13 -0500)]
Expose position invariance.
Used with MSL to determine whether to compile with invariance preserved.
Hans-Kristian Arntzen [Fri, 22 Jan 2021 15:30:57 +0000 (16:30 +0100)]
Merge pull request #1603 from KhronosGroup/small-improvements
Various small improvements and fixes
Hans-Kristian Arntzen [Fri, 22 Jan 2021 12:48:16 +0000 (13:48 +0100)]
Check entry point variables in is_hidden_variables.
Need to be careful not to emit globals we're not supposed to.
Hans-Kristian Arntzen [Fri, 22 Jan 2021 12:13:56 +0000 (13:13 +0100)]
Handle nonuniformEXT qualifier for acceleration structures.
Hans-Kristian Arntzen [Fri, 22 Jan 2021 11:17:05 +0000 (12:17 +0100)]
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.
Hans-Kristian Arntzen [Fri, 22 Jan 2021 10:22:10 +0000 (11:22 +0100)]
GLSL: Handle tracing against incoming payload/callable.
Hans-Kristian Arntzen [Fri, 15 Jan 2021 09:46:23 +0000 (10:46 +0100)]
Merge pull request #1594 from KhronosGroup/fix-1591
Fix pathological complexity explosion for certain shaders.
Hans-Kristian Arntzen [Thu, 14 Jan 2021 15:10:07 +0000 (16:10 +0100)]
Merge pull request #1595 from KhronosGroup/copyright-update
meta: Update copyright headers to 2021.
Hans-Kristian Arntzen [Thu, 14 Jan 2021 15:07:49 +0000 (16:07 +0100)]
meta: Update copyright headers to 2021.
Hans-Kristian Arntzen [Thu, 14 Jan 2021 14:58:19 +0000 (15:58 +0100)]
Fix pathological complexity explosion for certain shaders.
Certain shaders where functions have a *ton* of merging control flow
will end up with exponential time complexity to figure out parameter
preservation semantics.
The trivial fix to make it O(1) again is to terminate recursive traversal early if we've seen
the path before. Simple oversight :(
Hans-Kristian Arntzen [Sat, 9 Jan 2021 21:28:19 +0000 (22:28 +0100)]
Merge pull request #1590 from KhronosGroup/fix-1584
Update ray-tracing support to include SPV_KHR_ray_tracing
Hans-Kristian Arntzen [Fri, 8 Jan 2021 10:37:29 +0000 (11:37 +0100)]
GLSL: Support both SPV_KHR_ray_tracing and NV_ray_tracing.
Fairly minor differences, so can keep them side by side without too much
effort. NV support is effectively deprecated now however.
- Add OpConvertUToAccelerationStructureKHR
- Ignore/Terminate ray is now a terminator in KHR, but a call in NV.
- Fix some bugs with reportIntersection.
Hans-Kristian Arntzen [Fri, 8 Jan 2021 13:58:44 +0000 (14:58 +0100)]
Merge pull request #1589 from KhronosGroup/roll-deps
Roll dependencies.
Hans-Kristian Arntzen [Fri, 8 Jan 2021 09:47:46 +0000 (10:47 +0100)]
CLI: Fix silly regression with handling of -V.
Hans-Kristian Arntzen [Fri, 8 Jan 2021 09:37:46 +0000 (10:37 +0100)]
Roll dependencies.
Hans-Kristian Arntzen [Fri, 8 Jan 2021 09:37:19 +0000 (10:37 +0100)]
Merge pull request #1588 from KhronosGroup/fix-1582
MSL: Fix some edge cases in input attachment handling.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 14:00:45 +0000 (15:00 +0100)]
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.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 13:30:35 +0000 (14:30 +0100)]
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.
Hans-Kristian Arntzen [Fri, 8 Jan 2021 09:16:22 +0000 (10:16 +0100)]
Merge pull request #1587 from KhronosGroup/refactor-active-variable-consideration
Refactor active variable consideration
Hans-Kristian Arntzen [Thu, 7 Jan 2021 11:18:07 +0000 (12:18 +0100)]
Add test for pure initializer gl_FragDepth.
Tests that the builtin is considered active.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 11:14:49 +0000 (12:14 +0100)]
GLSL: Force block declaration if clip/cull is used in tesc.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 11:00:21 +0000 (12:00 +0100)]
MSL: Make sure initialized output builtins are considered active.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 10:20:10 +0000 (11:20 +0100)]
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.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 09:28:06 +0000 (10:28 +0100)]
MSL: Only consider builtin variables if they are part of IO interface.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 09:27:14 +0000 (10:27 +0100)]
MSL: Very slight refactor.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 08:51:37 +0000 (09:51 +0100)]
Merge pull request #1585 from KhronosGroup/fix-1569
GLSL: Update SPIR-V headers for modified ray tracing opcodes.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 08:51:22 +0000 (09:51 +0100)]
Merge pull request #1583 from KhronosGroup/fix-1567
CLI: Add stdin support.
Hans-Kristian Arntzen [Thu, 7 Jan 2021 08:51:09 +0000 (09:51 +0100)]
Merge pull request #1581 from KhronosGroup/fix-1554
GLSL/MSL: Handle more complicated tessellation Output initializers
Hans-Kristian Arntzen [Wed, 6 Jan 2021 11:59:57 +0000 (12:59 +0100)]
GLSL: Fix -Wshadow error.