Commit Graph

3687 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
e3d1b9afbb Merge branch 'spirtype-refactor' of https://github.com/Hugobros3/SPIRV-Cross into pr-2238 2023-12-07 12:05:48 +01:00
Hans-Kristian Arntzen
e6b013a492
Merge pull request #2214 from KhronosGroup/fix-2206
MSL: Use powr instead of pow.
2023-12-07 11:39:26 +01:00
Hugo Devillers
5065781b15 fix more spirtype::op instances 2023-12-06 18:04:59 +01:00
Hugo Devillers
d019358ce0 fix unintialised struct in SPIRType 2023-12-06 17:54:34 +01:00
Hans-Kristian Arntzen
9da5f7ce45
Merge pull request #2242 from KhronosGroup/fix-2221
MSL: Improve PtrAccessChain handling.
2023-12-06 17:17:21 +01:00
Hans-Kristian Arntzen
ffab994ab0 MSL: Wrap dereferenced ptr-chain expressions. 2023-12-06 17:09:25 +01:00
Hans-Kristian Arntzen
4e3f66b5d5 MSL: Add test for vector-to-scalar variable pointer. 2023-12-06 17:09:25 +01:00
Hans-Kristian Arntzen
6dbec321d2 MSL: Defererence pointer expressions before traversing access chain.
Exception is struct which does -> for us.
2023-12-06 17:09:25 +01:00
Hans-Kristian Arntzen
0836c81e73 MSL: Only do address-of expression when needed. 2023-12-06 16:18:58 +01:00
Hans-Kristian Arntzen
ed7ba43062 MSL: Use LHS expression to determine whether or not to do array copy.
Makes a difference when using variable pointers.
2023-12-06 16:18:58 +01:00
Hans-Kristian Arntzen
e2886f0946 MSL: Consider PtrAccessChain on array types. 2023-12-06 16:18:58 +01:00
Hans-Kristian Arntzen
766a74dbaf
Merge pull request #2241 from Try/msl-ray-cullmask
MSL: add ray-cull mask
2023-12-06 14:26:25 +01:00
Try
22d6e2e6b6 + missing tests 2023-12-05 21:35:26 +01:00
Try
8f58b84761 MSL: add ray-cull mask 2023-12-05 20:56:48 +01:00
Hans-Kristian Arntzen
7c335edc66
Merge pull request #2237 from cdavis5e/raw-tese-input-patch-vertices
MSL: Fix patch vertex count with raw buffer tese input.
2023-12-05 14:03:29 +01:00
Chip Davis
c0760eb91f MSL: Fix patch vertex count with raw buffer tese input.
We can no longer rely on the `patch_control_point<>` array being
present, so the best we can do is use the value given us at compile
time.

This was an oversight on my part when I initially implemented the
raw-buffer tessellation evaluation input mode. The lack of tests for the
`PatchVertices` built-in almost certainly contributed, so I fixed that
in this patch.

Fixes the test
`dEQP-VK.tessellation.shader_input_output.patch_vertices_in_tes`. This
is the last failing test under `dEQP-VK.tessellation`.
2023-12-04 14:24:16 -08:00
Hugo Devillers
55e08aff31 use 'op' as the ground truth in is_array and is_pointer 2023-12-04 18:49:46 +01:00
Hugo Devillers
7c7b6e600f msl: look at the pointee type in emit_tessellation_access_chain 2023-12-04 18:49:22 +01:00
Hugo Devillers
8632f67109 msl: look at the actual variable element type in to_member_reference 2023-12-04 18:36:39 +01:00
Hugo Devillers
5b1881041e msl: make build_extended_vector_type deal with compound types better 2023-12-04 18:33:53 +01:00
Hugo Devillers
2c3734df75 msl: fix many instances of SPIRType.self being incorrectly set 2023-12-04 18:33:27 +01:00
Hugo Devillers
ee7aaaf662 msl: fix two more instances of the wrong op in SPIRType 2023-12-04 18:32:56 +01:00
Hugo Devillers
738bfd49e3 msl: fix test regressions with samplemask 2023-12-04 12:47:15 +01:00
Hugo Devillers
af92037acb fix a bunch of case where SPIRType::op is wrong/corrupted 2023-11-30 15:42:46 +01:00
Hugo Devillers
950cad5913 Added an Op field to SPIRType
This field allows telling what the 'head' of the type is, without having to look at parent types.
2023-11-30 12:28:50 +01:00
Hans-Kristian Arntzen
a3da0e87fa
Merge pull request #2235 from KhronosGroup/fix-2212
MSL: Implement MSL 3.1 image atomics natively
2023-11-29 14:48:20 +01:00
Hans-Kristian Arntzen
f3573b9f1e MSL: Throw on emulated image array atomics. 2023-11-29 14:17:57 +01:00
Hans-Kristian Arntzen
a326b3ea3b MSL: Support using the offline Metal Windows toolchain for validation. 2023-11-29 13:53:23 +01:00
Hans-Kristian Arntzen
e33670e794 MSL: Add some image atomic tests for 3.1. 2023-11-29 13:53:23 +01:00
Hans-Kristian Arntzen
2ff08b31c0 MSL: Update test scripts for MSL 3.1 testing. 2023-11-29 13:53:23 +01:00
Hans-Kristian Arntzen
9c054b1f34 MSL: Implement Metal 3.1 image atomics natively.
The check_discard code was too annoying to deal with,
and there is no requirement to return anything meaningful.
Vulkan specs state that values returned by atomic instructions are undefined.
2023-11-29 13:53:23 +01:00
Hans-Kristian Arntzen
50e90dd74e
Merge pull request #2233 from cdavis5e/agx-cube-grad-fixup
MSL: Work around broken cube texture gradients on Apple Silicon.
2023-11-28 12:05:55 +01:00
Chip Davis
18976c4307 Add missing new MSL options to the C API and the CLI. 2023-11-27 15:03:58 -08:00
Chip Davis
7ef52b04c3 MSL: Work around broken cube texture gradients on Apple Silicon.
To date, all released Apple Silicon GPUs incorrectly interpret the
gradient vectors when sampling a cube texture. Specifically, they ignore
one of the three partial derivatives in each gradient depending on the
selected major axis, and they expect the remaining derivatives to be
partially transformed.

h/t @lexaknyazev for the code used in the `spvGradientCube()` function.

Fixes 8 tests under `dEQP-VK.glsl.texture_functions.texturegrad.*`.
2023-11-27 15:03:26 -08:00
Hans-Kristian Arntzen
3717660e14
Merge pull request #2234 from KhronosGroup/fix-2226
MSL: Support std140 half matrices and arrays.
2023-11-27 17:17:13 +01:00
Hans-Kristian Arntzen
2e022dbff5 MSL: Move test files to packing/. 2023-11-27 16:54:27 +01:00
Hans-Kristian Arntzen
3872dcd68f MSL: Don't use swizzle if we have wrapper. 2023-11-27 16:52:32 +01:00
Hans-Kristian Arntzen
61bbcb2705
Merge pull request #2232 from KhronosGroup/fix-2228
MSL: Add divide to reserved function names.
2023-11-27 16:31:01 +01:00
Hans-Kristian Arntzen
81c047c3ed MSL: Use more appropriate padded types. 2023-11-27 16:30:24 +01:00
Hans-Kristian Arntzen
57dbfa0400 MSL: Support std140 half matrices and arrays.
Super awkward since there is no clean way to express this.
2023-11-27 15:28:20 +01:00
Hans-Kristian Arntzen
dddabb9c11 MSL: Add divide to reserved function names. 2023-11-27 12:14:30 +01:00
Hans-Kristian Arntzen
42299f92ef
Merge pull request #2230 from chirsz-ever/chirsz/custom-float-formater
Allow to customize float literals in output
2023-11-24 12:47:51 +01:00
Hans-Kristian Arntzen
3e8e761e49
Apply suggestions from code review 2023-11-24 12:46:50 +01:00
Hans-Kristian Arntzen
94f4c48faf
Apply suggestions from code review 2023-11-24 12:46:28 +01:00
chirsz-ever
20dd53b312
Allow to customize float literals in output 2023-11-22 22:17:24 +08:00
chirsz-ever
ec7a23c826
Add "build" to .gitignore 2023-11-22 20:05:42 +08:00
Hans-Kristian Arntzen
42aac916ab
Merge pull request #2227 from elizagamedev/exv/essl1-uint-bool-hack
Workaround for generating bool uniforms in ESSL1
2023-11-16 15:47:51 +01:00
Hans-Kristian Arntzen
bf059200be
Only use lowp path for legacy ES 2023-11-16 14:00:48 +01:00
Hans-Kristian Arntzen
0e9bc69128
Review nit, update brace placement 2023-11-16 14:00:00 +01:00
Eliza Velasquez
93150ed7fb Workaround for generating bool uniforms in ESSL1
Fixes #2223.
2023-11-13 15:23:36 -08:00