platform/upstream/SPIRV-Cross.git
2 years agoMerge pull request #1679 from okuoku/fix-c-sample-code upstream/2021.4.22
Hans-Kristian Arntzen [Fri, 21 May 2021 16:43:08 +0000 (18:43 +0200)]
Merge pull request #1679 from okuoku/fix-c-sample-code

Fix C sample code in README.md

2 years agoFix C sample code in README.md
okuoku [Fri, 21 May 2021 16:18:26 +0000 (01:18 +0900)]
Fix C sample code in README.md

2 years agoMerge pull request #1678 from KhronosGroup/fix-1674
Hans-Kristian Arntzen [Fri, 21 May 2021 15:37:02 +0000 (17:37 +0200)]
Merge pull request #1678 from KhronosGroup/fix-1674

MSL: Add CLI option for sampler suffix.

2 years agoMerge pull request #1677 from KhronosGroup/fix-1673
Hans-Kristian Arntzen [Fri, 21 May 2021 15:22:48 +0000 (17:22 +0200)]
Merge pull request #1677 from KhronosGroup/fix-1673

MSL: Improve handling of split tessellation access chains.

2 years agoMSL: Add CLI option for sampler suffix.
Hans-Kristian Arntzen [Fri, 21 May 2021 14:47:41 +0000 (16:47 +0200)]
MSL: Add CLI option for sampler suffix.

2 years agoMSL: Improve handling of split tessellation access chains.
Hans-Kristian Arntzen [Fri, 21 May 2021 14:32:03 +0000 (16:32 +0200)]
MSL: Improve handling of split tessellation access chains.

2 years agoMerge pull request #1676 from KhronosGroup/fix-1671
Hans-Kristian Arntzen [Fri, 21 May 2021 13:43:58 +0000 (15:43 +0200)]
Merge pull request #1676 from KhronosGroup/fix-1671

GLSL: Implement noncoherent framebuffer fetch.

2 years agoMerge pull request #1675 from KhronosGroup/fix-1670
Hans-Kristian Arntzen [Fri, 21 May 2021 12:27:07 +0000 (14:27 +0200)]
Merge pull request #1675 from KhronosGroup/fix-1670

MSL: Support array-of-component IO variables in vertex/fragment

2 years agoGLSL: Implement noncoherent framebuffer fetch.
Hans-Kristian Arntzen [Fri, 21 May 2021 12:21:13 +0000 (14:21 +0200)]
GLSL: Implement noncoherent framebuffer fetch.

2 years agoMSL: Handle array with component when we cannot rely on user() attrib.
Hans-Kristian Arntzen [Fri, 21 May 2021 11:03:05 +0000 (13:03 +0200)]
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.

2 years agoMSL: Handle array of IO variable with Component decoration.
Hans-Kristian Arntzen [Fri, 21 May 2021 10:31:33 +0000 (12:31 +0200)]
MSL: Handle array of IO variable with Component decoration.

3 years agoMerge pull request #1668 from KhronosGroup/fix-1665
Hans-Kristian Arntzen [Fri, 7 May 2021 11:51:24 +0000 (13:51 +0200)]
Merge pull request #1668 from KhronosGroup/fix-1665

Implement NoContraction decoration

3 years agoHLSL: Implement invariant as precise.
Hans-Kristian Arntzen [Fri, 7 May 2021 11:15:55 +0000 (13:15 +0200)]
HLSL: Implement invariant as precise.

Only option we have.

3 years agoHonor NoContraction qualifier.
Hans-Kristian Arntzen [Fri, 7 May 2021 10:28:08 +0000 (12:28 +0200)]
Honor NoContraction qualifier.

We'll need to force a temporary and mark it as precise.
MSL is a little weird here, but we can piggyback on top of the invariant
float math option here to force fma() operations everywhere.

3 years agoMerge branch '16-bit-int-types-glsl'
Hans-Kristian Arntzen [Fri, 7 May 2021 09:13:30 +0000 (11:13 +0200)]
Merge branch '16-bit-int-types-glsl'

3 years agoUpdate reference output.
Hans-Kristian Arntzen [Fri, 7 May 2021 09:12:22 +0000 (11:12 +0200)]
Update reference output.

3 years agoFixed 16 bit int types
Przemog1 [Wed, 5 May 2021 19:41:53 +0000 (21:41 +0200)]
Fixed 16 bit int types

3 years agoMSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more...
Lukas Taparauskas [Thu, 29 Apr 2021 18:01:26 +0000 (21:01 +0300)]
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.

3 years agoMerge pull request #1663 from billhollings/metal-arg-buff-padding-patch
Hans-Kristian Arntzen [Mon, 26 Apr 2021 18:43:33 +0000 (20:43 +0200)]
Merge pull request #1663 from billhollings/metal-arg-buff-padding-patch

MSL: Minor last minute patch for MoltenVK Vulkan SDK release tomorrow (Tuesday) - RUSH

3 years agoMSL: Padding for Metal argument buffers should not double-count SampledImages.
Bill Hollings [Mon, 26 Apr 2021 17:19:23 +0000 (13:19 -0400)]
MSL: Padding for Metal argument buffers should not double-count SampledImages.

3 years agoMerge pull request #1660 from KhronosGroup/fix-1658
Hans-Kristian Arntzen [Fri, 23 Apr 2021 13:21:00 +0000 (15:21 +0200)]
Merge pull request #1660 from KhronosGroup/fix-1658

MSL: Use proper array for quad tess levels.

3 years agoMSL: Use proper array for quad tess levels.
Hans-Kristian Arntzen [Fri, 23 Apr 2021 10:40:24 +0000 (12:40 +0200)]
MSL: Use proper array for quad tess levels.

We need to handle loads from array as well, so the float4 hack doesn't
work.

3 years agoMerge pull request #1661 from KhronosGroup/fix-1659
Hans-Kristian Arntzen [Fri, 23 Apr 2021 11:47:02 +0000 (13:47 +0200)]
Merge pull request #1661 from KhronosGroup/fix-1659

HLSL: Support Shuffle wave ops.

3 years agoHLSL: Support Shuffle wave ops.
Hans-Kristian Arntzen [Fri, 23 Apr 2021 11:03:35 +0000 (13:03 +0200)]
HLSL: Support Shuffle wave ops.

WaveReadLaneAt is no longer restricted to dynamically uniform index,
so can implement the other shuffle ops.

3 years agoMerge pull request #1657 from KhronosGroup/fix-1607
Hans-Kristian Arntzen [Thu, 22 Apr 2021 14:39:20 +0000 (16:39 +0200)]
Merge pull request #1657 from KhronosGroup/fix-1607

Rewrite how non-uniform qualifiers are handled.

3 years agoRewrite how non-uniform qualifiers are handled.
Hans-Kristian Arntzen [Thu, 22 Apr 2021 11:54:43 +0000 (13:54 +0200)]
Rewrite how non-uniform qualifiers are handled.

Remove all shenanigans with propagation, and only consume nonuniform
qualifiers exactly where needed (last minute).

3 years agoMerge pull request #1655 from KhronosGroup/fix-1640
Hans-Kristian Arntzen [Tue, 20 Apr 2021 14:35:02 +0000 (16:35 +0200)]
Merge pull request #1655 from KhronosGroup/fix-1640

GLSL: Support shading rate builtins.

3 years agoMerge pull request #1654 from KhronosGroup/fix-1641
Hans-Kristian Arntzen [Tue, 20 Apr 2021 14:34:53 +0000 (16:34 +0200)]
Merge pull request #1654 from KhronosGroup/fix-1641

GLSL: Implement gl_FragFullyCoveredNV.

3 years agoMerge pull request #1653 from KhronosGroup/fix-1638
Hans-Kristian Arntzen [Tue, 20 Apr 2021 14:34:44 +0000 (16:34 +0200)]
Merge pull request #1653 from KhronosGroup/fix-1638

GLSL: Support GL_EXT_shader_image_load_formatted.

3 years agoMerge pull request #1652 from KhronosGroup/fix-1644
Hans-Kristian Arntzen [Tue, 20 Apr 2021 14:34:11 +0000 (16:34 +0200)]
Merge pull request #1652 from KhronosGroup/fix-1644

MSL: Handle variable access in OpSelect.

3 years agoMerge pull request #1651 from KhronosGroup/fix-1645
Hans-Kristian Arntzen [Tue, 20 Apr 2021 14:34:01 +0000 (16:34 +0200)]
Merge pull request #1651 from KhronosGroup/fix-1645

HLSL: Fix automatic location assignment in block IO.

3 years agoGLSL: Support shading rate builtins.
Hans-Kristian Arntzen [Tue, 20 Apr 2021 11:58:07 +0000 (13:58 +0200)]
GLSL: Support shading rate builtins.

3 years agoGLSL: Implement gl_FragFullyCoveredNV.
Hans-Kristian Arntzen [Tue, 20 Apr 2021 11:44:52 +0000 (13:44 +0200)]
GLSL: Implement gl_FragFullyCoveredNV.

3 years agoGLSL: Support GL_EXT_shader_image_load_formatted.
Hans-Kristian Arntzen [Tue, 20 Apr 2021 11:32:41 +0000 (13:32 +0200)]
GLSL: Support GL_EXT_shader_image_load_formatted.

3 years agoMSL: Handle variable access in OpSelect.
Hans-Kristian Arntzen [Tue, 20 Apr 2021 11:19:04 +0000 (13:19 +0200)]
MSL: Handle variable access in OpSelect.

CFG analysis needs to know if we need to take address of variable.

3 years agoHLSL: Fix automatic location assignment in block IO.
Hans-Kristian Arntzen [Tue, 20 Apr 2021 11:03:58 +0000 (13:03 +0200)]
HLSL: Fix automatic location assignment in block IO.

3 years agoMerge pull request #1643 from KhronosGroup/fix-1639
Hans-Kristian Arntzen [Mon, 19 Apr 2021 14:21:59 +0000 (16:21 +0200)]
Merge pull request #1643 from KhronosGroup/fix-1639

Add some interfaces to aid with LTO-style optimization

3 years agoMSL: Fix copy of arrays to/from stage IO variables.
Hans-Kristian Arntzen [Mon, 19 Apr 2021 09:46:30 +0000 (11:46 +0200)]
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.

3 years agoMSL: Don't use native arrays for tess level inputs.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 13:02:26 +0000 (15:02 +0200)]
MSL: Don't use native arrays for tess level inputs.

3 years agoMSL: Don't emit native array for masked clip/cull distance.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 12:19:07 +0000 (14:19 +0200)]
MSL: Don't emit native array for masked clip/cull distance.

3 years agoc: Add C API for builtin stage IO reflection.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 12:12:07 +0000 (14:12 +0200)]
c: Add C API for builtin stage IO reflection.

3 years agoSupport reflecting builtins.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 11:32:37 +0000 (13:32 +0200)]
Support reflecting builtins.

They were ignored in input/output variables.

3 years agoCheck SPIR-V 1.4 rules when reflecting resources.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 10:50:18 +0000 (12:50 +0200)]
Check SPIR-V 1.4 rules when reflecting resources.

3 years agoMSL: Make builtin argument type declaration context sensitive.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 10:18:31 +0000 (12:18 +0200)]
MSL: Make builtin argument type declaration context sensitive.

Sometimes we'll need array template, sometimes not :shrug:.

3 years agoMSL: Use spvUnsafeArray for builtin arrays after all.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 09:45:50 +0000 (11:45 +0200)]
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 ...

3 years agoMSL: Hoist out to_tesc_invocation_id() in more places.
Hans-Kristian Arntzen [Fri, 16 Apr 2021 09:26:47 +0000 (11:26 +0200)]
MSL: Hoist out to_tesc_invocation_id() in more places.

When emitting fixup code, we might not have gl_InvocationID yet.

3 years agoMSL: Handle loading Clip/CullDistance in TESE.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 13:10:02 +0000 (15:10 +0200)]
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.

3 years agoMSL: Correctly analyze if builtin block is active.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 12:28:27 +0000 (14:28 +0200)]
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.

3 years agoMSL: Test that we can capture cull distance to buffer.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 12:02:43 +0000 (14:02 +0200)]
MSL: Test that we can capture cull distance to buffer.

3 years agoMSL: Handle CullDistance better.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 11:51:55 +0000 (13:51 +0200)]
MSL: Handle CullDistance better.

3 years agoMSL: Emit multiple threadgroup slices for multi-patch.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 11:13:13 +0000 (13:13 +0200)]
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.

3 years agoMSL: Unroll initializations of CullDistance/ClipDistance control points.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 10:08:43 +0000 (12:08 +0200)]
MSL: Unroll initializations of CullDistance/ClipDistance control points.

3 years agoMSL: Fix initialization of masked threadgroup variables.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 09:27:05 +0000 (11:27 +0200)]
MSL: Fix initialization of masked threadgroup variables.

3 years agoFix print_help comment.
Hans-Kristian Arntzen [Wed, 14 Apr 2021 08:51:51 +0000 (10:51 +0200)]
Fix print_help comment.

3 years agoMSL: Don't report fallback location allocations as being "used".
Hans-Kristian Arntzen [Fri, 9 Apr 2021 16:55:10 +0000 (18:55 +0200)]
MSL: Don't report fallback location allocations as being "used".

It may shadow unused *real* inputs and confuse applications.

3 years agoC: Add C api for stage output masking.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 13:11:30 +0000 (15:11 +0200)]
C: Add C api for stage output masking.

3 years agoMSL: Cleanup fallback IO block emission.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 12:59:45 +0000 (14:59 +0200)]
MSL: Cleanup fallback IO block emission.

Need to emit in add_variable_to_iface(). Unifies the code paths a fair
bit.

3 years agoMSL: Handle masking of TESC IO block members.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 11:23:09 +0000 (13:23 +0200)]
MSL: Handle masking of TESC IO block members.

3 years agoMSL: Fixup gl_PerVertex names if we're emitting masked builtins.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 10:58:21 +0000 (12:58 +0200)]
MSL: Fixup gl_PerVertex names if we're emitting masked builtins.

3 years agoMSL: Add test for complex control point outputs.
Hans-Kristian Arntzen [Fri, 9 Apr 2021 08:45:05 +0000 (10:45 +0200)]
MSL: Add test for complex control point outputs.

3 years agoMSL: Rewrite how IO blocks are emitted in multi-patch mode.
Hans-Kristian Arntzen [Thu, 8 Apr 2021 09:47:35 +0000 (11:47 +0200)]
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.

3 years agoMSL: Handle flattening of patch block outputs as well.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 15:02:30 +0000 (17:02 +0200)]
MSL: Handle flattening of patch block outputs as well.

Always propagate InterfaceMember decoration.

3 years agoMSL: Do not declare patch variables on stack.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 13:16:08 +0000 (15:16 +0200)]
MSL: Do not declare patch variables on stack.

3 years agoMSL: Handle masking of builtin control points.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 12:35:00 +0000 (14:35 +0200)]
MSL: Handle masking of builtin control points.

3 years agoMSL: Emit a masked builtin IO block if necessary.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 11:36:22 +0000 (13:36 +0200)]
MSL: Emit a masked builtin IO block if necessary.

3 years agoMSL: Do not perform scalar fixups for control-point outputs.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 11:33:26 +0000 (13:33 +0200)]
MSL: Do not perform scalar fixups for control-point outputs.

3 years agoMSL: Fix argument_decl check for builtin.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 10:56:09 +0000 (12:56 +0200)]
MSL: Fix argument_decl check for builtin.

3 years agoMSL: Temporarily allow empty output struct.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 10:55:47 +0000 (12:55 +0200)]
MSL: Temporarily allow empty output struct.

3 years agoMSL: Small refactors.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 10:55:26 +0000 (12:55 +0200)]
MSL: Small refactors.

3 years agoMSL: Always emit block variable for block types.
Hans-Kristian Arntzen [Wed, 7 Apr 2021 08:55:40 +0000 (10:55 +0200)]
MSL: Always emit block variable for block types.

3 years agoMSL: Test that we can mask location writes in TESC.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 13:50:02 +0000 (15:50 +0200)]
MSL: Test that we can mask location writes in TESC.

3 years agoMSL: Explicitly only consider masked variables to be thread-group-like.
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.

3 years agoMSL: Fix masking of vertex block outputs.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:43:34 +0000 (14:43 +0200)]
MSL: Fix masking of vertex block outputs.

3 years agoMSL: Refactor out variable/block member masking.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:12:24 +0000 (14:12 +0200)]
MSL: Refactor out variable/block member masking.

3 years agoMSL: Add tests for masking with --for-tess.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:39:04 +0000 (13:39 +0200)]
MSL: Add tests for masking with --for-tess.

3 years agoMSL: Remove position mask tests. They will fail compilation.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:33:16 +0000 (13:33 +0200)]
MSL: Remove position mask tests. They will fail compilation.

3 years agoMSL: Emit correct address space for masked arguments.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:28:45 +0000 (13:28 +0200)]
MSL: Emit correct address space for masked arguments.

3 years agoMSL: Don't emit weird reference type for spvUnsafeArray types.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 11:27:56 +0000 (13:27 +0200)]
MSL: Don't emit weird reference type for spvUnsafeArray types.

3 years agoMSL: Handle masked outputs in extract_global_variables.
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.

3 years agoMSL: Force builtin arrays for builtin array types.
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.

3 years agoMSL: Add tests for vertex output masking.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 09:49:07 +0000 (11:49 +0200)]
MSL: Add tests for vertex output masking.

3 years agoMSL: Do not consider effective storage for any composite.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 09:35:04 +0000 (11:35 +0200)]
MSL: Do not consider effective storage for any composite.

3 years agoMSL: Handle effective storage for masked CP outputs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 16:28:42 +0000 (17:28 +0100)]
MSL: Handle effective storage for masked CP outputs.

3 years agoMSL: Emit threadgroup storage class for masked control point 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.

3 years agoMSL: Do not redirect tess access chains on masked outputs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 15:16:03 +0000 (16:16 +0100)]
MSL: Do not redirect tess access chains on masked outputs.

3 years agoAdd --mask-stage-output-* CLI options.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 14:58:41 +0000 (15:58 +0100)]
Add --mask-stage-output-* CLI options.

3 years agoMSL: Correctly emit array type for masked outputs.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 14:58:23 +0000 (15:58 +0100)]
MSL: Correctly emit array type for masked outputs.

3 years agoMSL: Sketch out API to aid LTO-style optimization.
Hans-Kristian Arntzen [Thu, 25 Mar 2021 17:08:49 +0000 (18:08 +0100)]
MSL: Sketch out API to aid LTO-style optimization.

3 years agoClean up member sorting.
Hans-Kristian Arntzen [Fri, 26 Mar 2021 10:00:35 +0000 (11:00 +0100)]
Clean up member sorting.

3 years agoMSL: Sort builtin IO block members by builtin type.
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.

3 years agoMSVC: Add /bigobj for debug builds.
Hans-Kristian Arntzen [Tue, 6 Apr 2021 12:59:53 +0000 (14:59 +0200)]
MSVC: Add /bigobj for debug builds.

3 years agoMerge pull request #1648 from billhollings/msl-pad-arg-buff-structs
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.

3 years agoMSL: Fixes to 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.

3 years agoMSL: Fixes to support padding Metal argument buffer entries based on argument index.
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.

3 years agoMSL: Fixes to support padding Metal argument buffer entries based on argument index.
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.

3 years agoMSL: Fixes to support padding Metal argument buffer entries based on argument index.
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.

3 years agoMerge branch 'master' of https://github.com/billhollings/SPIRV-Cross into msl-pad...
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

3 years agoMerge pull request #1650 from Dredhog/active-builtins-c-api
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.

3 years agoc: Remove SPVC_PUBLIC_API prefix from API implementation
lukas.taparauskas [Wed, 14 Apr 2021 13:19:50 +0000 (16:19 +0300)]
c: Remove SPVC_PUBLIC_API prefix from API implementation

3 years agoc: Add missing API to query active builtins.
lukas.taparauskas [Wed, 14 Apr 2021 12:44:00 +0000 (15:44 +0300)]
c: Add missing API to query active builtins.