Commit Graph

2962 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
e7b37392bf MSL: Emit correct address space for masked arguments. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
65b5ff7ece MSL: Don't emit weird reference type for spvUnsafeArray types. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
e7824c8b6e MSL: Handle masked outputs in extract_global_variables.
Need to conditionally add gl_in or gl_out.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
50a6bc058a MSL: Force builtin arrays for builtin array types.
Handles argument_decl() correctly.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
88b54f5dab MSL: Add tests for vertex output masking. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
394c038bfd MSL: Do not consider effective storage for any composite. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
04988b89b9 MSL: Handle effective storage for masked CP outputs. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
f2b5fb3f45 MSL: Emit threadgroup storage class for masked control point outputs.
Shader can still rely on writes to threadgroup memory to be visible.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
ea91579a7f MSL: Do not redirect tess access chains on masked outputs. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
9c1cadd440 Add --mask-stage-output-* CLI options. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
f682e89188 MSL: Correctly emit array type for masked outputs. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
2a2d57df13 MSL: Sketch out API to aid LTO-style optimization. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
9a144bb2b9 Clean up member sorting. 2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
0997e81118 MSL: Sort builtin IO block members by builtin type.
Ensures consistent block matching.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
b4aa6dacfa MSVC: Add /bigobj for debug builds. 2021-04-19 12:10:23 +02:00
Hans-Kristian Arntzen
45818c14e4
Merge pull request #1648 from billhollings/msl-pad-arg-buff-structs
MSL: Support padding Metal argument buffer entries based on argument index.
2021-04-19 10:36:02 +02:00
Bill Hollings
b3bfe22eaa 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.
2021-04-18 17:34:55 -04:00
Bill Hollings
daba0dfba6 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.
2021-04-17 15:20:53 -04:00
Bill Hollings
9060e5a13c 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.
2021-04-16 15:00:59 -04:00
Bill Hollings
9866cf4496 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.
2021-04-16 09:05:15 -04:00
Bill Hollings
6c0e11f907 Merge branch 'master' of https://github.com/billhollings/SPIRV-Cross into msl-pad-arg-buff-structs 2021-04-15 10:04:45 -04:00
Hans-Kristian Arntzen
582749ac68
Merge pull request #1650 from Dredhog/active-builtins-c-api
c: Add missing API to update and query active builtins.
2021-04-14 16:20:16 +02:00
lukas.taparauskas
edde535574 c: Remove SPVC_PUBLIC_API prefix from API implementation 2021-04-14 16:23:54 +03:00
lukas.taparauskas
215f31b33f c: Add missing API to query active builtins. 2021-04-14 15:44:00 +03:00
Bill Hollings
17dab614dc 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.
2021-04-13 19:01:20 -04:00
Hans-Kristian Arntzen
d2e1e7ba98 Fix Github CI in PRs. 2021-03-26 18:40:43 +01:00
Hans-Kristian Arntzen
28ae7b8f35
Merge pull request #1642 from mehmetoguzderin/msl-long-ulong-member
MSL: Support long ulong types in buffers in 2.3+.
2021-03-26 18:02:25 +01:00
Mehmet Oguz Derin
e2f7a753d2 Move condition to default block 2021-03-26 16:29:44 +03:00
Mehmet Oguz Derin
0a0c9db9be
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+.
2021-03-26 02:41:26 +03:00
Hans-Kristian Arntzen
84d1f8aa2a
Use Github actions CI tag. 2021-03-12 15:36:03 +01:00
Hans-Kristian Arntzen
2e000a0be4 Add GitHub Actions script. 2021-03-12 15:03:39 +01:00
Hans-Kristian Arntzen
60aa24566e
Merge pull request #1633 from KhronosGroup/fix-1626
GLSL: Handle complex load/store scenarios to gl_SampleMask.
2021-03-09 15:17:21 +01:00
Hans-Kristian Arntzen
ee31e84e30 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.
2021-03-09 10:25:03 +01:00
Hans-Kristian Arntzen
fb1f295aaf
Merge pull request #1635 from KhronosGroup/fix-1627
Handle edge cases in OpCopyMemory.
2021-03-09 10:21:35 +01:00
Hans-Kristian Arntzen
5d846acee5
Merge pull request #1634 from KhronosGroup/fix-1625
Handle logical subgroup arithmetic ops
2021-03-09 10:21:24 +01:00
Hans-Kristian Arntzen
0ac70fa7ca
Merge pull request #1632 from KhronosGroup/fix-1629
Throw if SPIR-V module has no entry points.
2021-03-09 10:21:10 +01:00
Hans-Kristian Arntzen
4ca06c7278 Handle edge cases in OpCopyMemory.
Implement this by synthesizing an OpLoad/OpStore pair instead.
2021-03-08 14:15:27 +01:00
Hans-Kristian Arntzen
aea6d29aa8 MSL: Add test for logical subgroup arith ops. 2021-03-08 12:57:37 +01:00
Hans-Kristian Arntzen
d6c2c1b39a HLSL: Support logical subgroup ops. 2021-03-08 12:52:03 +01:00
Hans-Kristian Arntzen
5570043af3 GLSL: Add support for Logical subgroup ops.
Completely missed these ...
2021-03-08 12:06:46 +01:00
Hans-Kristian Arntzen
bc4cb1b3c5 Throw if SPIR-V module has no entry points. 2021-03-08 10:40:19 +01:00
Hans-Kristian Arntzen
d57ab68a21
Merge pull request #1630 from KhronosGroup/fix-1628
MSL: Deal with pointer-to-pointer qualifier ordering.
2021-02-26 15:51:52 +01:00
Hans-Kristian Arntzen
97796e0609 MSL: Deal with pointer-to-pointer qualifier ordering. 2021-02-26 13:37:14 +01:00
Hans-Kristian Arntzen
621884d709
Merge pull request #1622 from KhronosGroup/fix-1619
MSL: Handle load and store to TessLevel array in TESC.
2021-02-17 20:46:06 +01:00
Hans-Kristian Arntzen
da238e5f12
Merge pull request #1623 from phuang/patch-2
Add two missing source files
2021-02-17 20:45:57 +01:00
Peng Huang
c66a571057
Add two missing source files 2021-02-17 11:14:04 -05:00
Hans-Kristian Arntzen
b1e36a1f78
Merge pull request #1621 from KhronosGroup/fix-1618
MSL: Fix automatic assign of builtin attributes in tessellation
2021-02-17 16:59:30 +01:00
Hans-Kristian Arntzen
85704f70bc MSL: Handle load and store to TessLevel array in TESC.
More edge cases ... :(
2021-02-17 13:26:08 +01:00
Hans-Kristian Arntzen
ce552f4f91 MSL: Gracefully assign automatic input locations to builtin attributes. 2021-02-17 12:29:19 +01:00
Hans-Kristian Arntzen
aa271c1460 MSL: Refactor out location consumption count computation. 2021-02-17 11:29:33 +01:00