Commit Graph

1402 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
3da5bc7a57 GLSL: Forward declare non-block BDA types as well.
With non-block structs, we can have pointers in those types too.
2024-01-18 12:56:31 +01:00
Hans-Kristian Arntzen
871ac0e5b7 GLSL: Handle BDA to plain non-block struct.
The implementation assumed that BDA to struct would always result in a
Block-like type, but that is not necessarily the case. Treat non-Block
structs as POD types as well.
2024-01-18 12:40:47 +01:00
Hans-Kristian Arntzen
e9851cc6aa MSL: Fix misc sign issues with dot product impl and add more coverage. 2024-01-16 16:17:43 +01:00
Hans-Kristian Arntzen
b9abac5024 Fix nits from review. 2024-01-16 14:46:16 +01:00
sean
6c24be197f MSL: Add support for SPV_EXT_integer_dot_product 2024-01-16 14:42:56 +01:00
Wooyoung Kim
8028f75685
Merge branch 'KhronosGroup:main' into SPV_QCOM_image_processing 2024-01-08 09:36:01 -08:00
Hans-Kristian Arntzen
57e28e3f58 MSL: Implement spvDescriptorArray path for SSBO/UBO. 2024-01-08 14:15:23 +01:00
Hans-Kristian Arntzen
a8b1e07fde MSL: Add test for texture/sampler variable count. 2024-01-08 13:04:43 +01:00
Wooyoung Kim
a7b6f3a34a Add supprot for the SPV_QCOM_image_processing extension 2024-01-05 22:38:08 -08:00
Hans-Kristian Arntzen
cffc08a542 Add missing reference file. 2024-01-05 14:54:21 +01:00
Hans-Kristian Arntzen
bedc49b859 HLSL: Fix issue with vec4 straddle rules in substructs. 2024-01-05 14:07:05 +01:00
Hans-Kristian Arntzen
ec42cb1c41 Roll deps. 2024-01-05 13:36:34 +01:00
Hans-Kristian Arntzen
2603fbe520 MSL: Remove special case for threadgroup array wrapper.
I cannot find any evidence that this does not actually work.
The original case here was from Epic's PR series in 2019, but I cannot see why it doesn't work.
It might have been a bug in a very old compiler at some point.
2023-12-07 14:41:42 +01:00
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
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
4e3f66b5d5 MSL: Add test for vector-to-scalar variable pointer. 2023-12-06 17:09:25 +01:00
Hans-Kristian Arntzen
e2886f0946 MSL: Consider PtrAccessChain on array types. 2023-12-06 16:18:58 +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
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
af92037acb fix a bunch of case where SPIRType::op is wrong/corrupted 2023-11-30 15:42:46 +01:00
Hans-Kristian Arntzen
f3573b9f1e MSL: Throw on emulated image array atomics. 2023-11-29 14:17:57 +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
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
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
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
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
Bill Hollings
4a42191240 MSL: Fix regression error in argument buffer runtime arrays.
Argument buffers can contain multiple runtime arrays if they have fixed
lengths as specified by the binding API. Regression error had assumed each
runtime array is in separate argument buffer with undefined array length.

- Add CompilerMSL::is_var_runtime_size_array() to include test for
  setting of array length via CompilerMSL::add_msl_resource_binding().

- Fixed unrelated test case MSL compile syntax failure when acceleration
  structure is the first entry point function argument (unrelated).
2023-11-02 23:53:59 -04:00
Hans-Kristian Arntzen
2fba284b4e MSL: Improve handling of sample masks. 2023-10-23 14:40:28 +02:00
Hans-Kristian Arntzen
56bdcfaf0e Add test for sample mask bulk load/store. 2023-10-23 12:45:08 +02:00
Hans-Kristian Arntzen
0bedb69b02 HLSL: Declare sample mask array with proper module type.
GLSL uses int[] and HLSL emits uint[], and to deal properly
with array copies where we lose ability to rewrite arithmetic types,
we need to declare with proper type.
2023-10-23 12:29:25 +02:00
Hans-Kristian Arntzen
f12ee5e0a4 Merge remote-tracking branch 'epic/fixes_hlsl' 2023-10-23 11:54:49 +02:00
Laura Hermanns
5d7ee6ad11 Fix declaration of gl_SampleMaskIn[1] in HLSL backend. 2023-10-17 09:11:09 -04:00
Bill Hollings
16fbf8872a MSL: Workaround Metal 3.1 regression bug on recursive input structs.
Metal 3.1 introduced a Metal regression bug which causes an infinite recursion
crash during Metal's analysis of an entry point input structure that itself
contains internal recursion. This patch works around this by replacing the
recursive input declaration with a alternate variable of type void*, and
then casting to the correct type at the top of the entry point function.

- Add CompilerMSL::Options::replace_recursive_inputs to enable
  replacing recursive input.
- Add Compiler::type_contains_recursion() to determine if a struct
  contains internal recursion, and add custom Decorations to mark
  such structs, to short-cut future similar checks.
- Replace recursive input struct declarations with void*,
  and emit a recast to correct type at top of entry function.
- Add unit test.
- Compiler::type_is_top_level_block() remove hardcode reference to spirv_cross
  namespace, as it interferes with configurable namespaces (unrelated).
2023-10-14 14:46:47 -04:00
Hans-Kristian Arntzen
724433d729
Merge pull request #2216 from KhronosGroup/buffer-reference-2
GLSL: Use buffer_reference2 instead of 1.
2023-10-11 14:20:36 +02:00
Hans-Kristian Arntzen
255ff2b19c GLSL: Use buffer_reference2 instead of 1.
Supports more syntax.
2023-10-11 14:18:36 +02:00
Hans-Kristian Arntzen
be944258be GLSL: Ignore bogus constant/undefs which use block types.
This is banned in more recent SPIR-V.
We cannot implement this in any reasonable way since block types don't
participate as normal types in GLSL.
2023-10-11 13:48:25 +02:00
Hans-Kristian Arntzen
75620181bc GLSL: Handle empty block declarations.
Similar fix as for structs.
2023-10-11 13:09:55 +02:00
Hans-Kristian Arntzen
73726f37c5 HLSL: Add missing reference output file. 2023-10-11 13:03:08 +02:00
Hans-Kristian Arntzen
09ba765844 MSL: Use powr instead of pow.
powr's additional UB rules match SPIR-V.
2023-10-11 12:55:12 +02:00
Try
967ad0bb4d Fix unroll, when storing to pointer to array
#fixed #2196
2023-09-28 23:58:51 +02:00
Hans-Kristian Arntzen
6e1fb9b09e
Merge pull request #2203 from Try/msl-atomics-fix
MSL: fix extraction of global variables, in case of atomics
2023-09-25 10:39:13 +02:00
Try
43a59b7cff fix extraction of global variables, in case of atomics 2023-09-19 21:44:57 +02:00
Try
da9c861ed0 MSL: fix mutability for rayQueryEXT parameters 2023-09-16 19:33:27 +02:00
Hans-Kristian Arntzen
b76394e66a GLSL: Fix Clip/Cull in mesh shaders. 2023-08-25 11:59:21 +02:00
Hans-Kristian Arntzen
633dc30135
Merge pull request #2187 from KhronosGroup/mesh-invariant-position
GLSL: Emit inline invariant position for mesh shaders.
2023-08-17 13:51:54 +02:00
Hans-Kristian Arntzen
a3f026815a
Merge pull request #2186 from KhronosGroup/64bit-images
GLSL: Implement 64-bit image support.
2023-08-17 13:50:29 +02:00