Commit Graph

1370 Commits

Author SHA1 Message Date
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
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
Hans-Kristian Arntzen
e7e2e8cef0
Merge pull request #2185 from KhronosGroup/perprimitive-fix
GLSL: Require mesh shader when using perprimitiveEXT in frag shader.
2023-08-17 13:50:22 +02:00
Hans-Kristian Arntzen
79d63934a6 GLSL: Emit inline invariant position for mesh shaders.
Work around missing feature from GLSL. Normally we can emit a global
invariant gl_Position; and call it a day, but it does not work for mesh
shaders it seems. Declaring invariance inside an explicit IO block works
fine on the other hand ...
2023-08-17 12:45:54 +02:00
Hans-Kristian Arntzen
5e3ea64843 GLSL: Implement 64-bit image support. 2023-08-17 12:17:55 +02:00
Hans-Kristian Arntzen
5ffc813dc4 GLSL: Require mesh shader when using perprimitiveEXT in frag shader. 2023-08-17 12:07:11 +02:00
Try
844cb59cd6 MSL: runtime array over argument buffers 2023-08-17 11:37:29 +02:00
Evan Tang
4405dd6b28 MSL: Prevent RAW hazards on read_write textures 2023-08-15 11:32:33 -05:00
Try
6b2ae11830 update rq unit tests 2023-07-03 21:45:34 +02:00
Try
35b23ef48f update rq unit tests 2023-07-03 20:04:23 +02:00
Hans-Kristian Arntzen
87e1ca4290 Add test for plain variable mesh position. 2023-07-03 14:25:22 +02:00
Hans-Kristian Arntzen
8ec95fbe16 Consider dynamically indexed gl_Position in mesh. 2023-07-03 14:20:27 +02:00
Hans-Kristian Arntzen
a3d711cbf1 HLSL: Move new mesh shader around to more suitable location. 2023-07-03 14:03:04 +02:00
Hans-Kristian Arntzen
a065c3b48a Merge branch 'dx12-mesh-flip-y' of https://github.com/Try/SPIRV-Cross into pr-2168 2023-07-03 13:55:02 +02:00
Hans-Kristian Arntzen
9f463569c4
Merge pull request #2172 from cdavis5e/msl-legacy-subgroup
MSL: Support `SPV_KHR_shader_ballot` and `SPV_KHR_subgroup_vote`.
2023-06-26 12:27:06 +02:00
Chip Davis
00f14ce74f MSL: Support SPV_KHR_shader_ballot and SPV_KHR_subgroup_vote.
Normally, I wouldn't have bothered with this, given that we already
support the Vulkan 1.1 subgroup functionality, but a client asked for
the legacy extensions.
2023-06-24 15:53:04 -07:00
Chip Davis
68f0257f26 Use --preserve-numeric-ids when assembling test shaders.
This makes it easier to debug codegen for these shaders.
2023-06-23 14:54:16 -07:00
Try
34f7bd00cd flip-y-test 2023-06-18 16:19:49 +02:00
Hans-Kristian Arntzen
030d0be28c
Merge pull request #2163 from KhronosGroup/fix-2162
GLSL: Fix bug with mixed precision on PHI variables.
2023-06-07 16:27:50 +02:00
Hans-Kristian Arntzen
5b322555d6 GLSL: Fix bug with mixed precision on PHI variables. 2023-06-07 15:31:29 +02:00
Hans-Kristian Arntzen
13e6981cc8 MSL: Consider changed array types for array-of-constant-bool in struct. 2023-06-07 13:54:50 +02:00
Hans-Kristian Arntzen
8735108609 MSL: Consider bool-short remapping for constant expressions as well. 2023-06-07 12:33:37 +02:00
Hans-Kristian Arntzen
b0b2fd8d90 MSL: Add test for bool-in-struct edge cases. 2023-06-06 15:17:23 +02:00
Hans-Kristian Arntzen
bbcd8de9a3 MSL: Handle more complex array copy scenarios with bool <-> short. 2023-06-06 15:05:56 +02:00
Hans-Kristian Arntzen
bf752edaa4 Update test output for preserve structured. 2023-05-19 11:38:12 +02:00
Hans-Kristian Arntzen
6df60be69f Merge remote-tracking branch 'epic/fixes_hlsl' 2023-05-19 11:10:24 +02:00
Laura Hermanns
578bdf410b Added tests for HLSL structured buffers. 2023-05-17 13:52:24 -04:00
Hans-Kristian Arntzen
cfd1618e31 MSL: Use templated array type when emitting BDA to arrays.
Handling native array types is not really feasible since we need to fuse
the variable declaration with the type declaration.

This is feasible in something like variable_decl, but for plain SSA
pointers, this breaks down.
2023-05-10 13:33:54 +02:00
Hans-Kristian Arntzen
54b48a2f3a
Merge pull request #2133 from georgeouzou/main
GLSL: Support GL_KHR_shader_subgroup_arithmetic (WIP)
2023-05-10 11:32:00 +02:00
George Ouzounoudis
ff962261d4 GLSL: Add tests for subgroup iadd, fadd, imul, fmul 2023-05-01 15:51:54 +03:00
Hans-Kristian Arntzen
a5ec818d41 HLSL: Add test for straddling + holes in struct. 2023-04-27 17:40:02 +02:00
Hans-Kristian Arntzen
e57b901dd1 MSL: Use name_id consistently in argument declaration. 2023-04-11 17:06:56 +02:00
Hans-Kristian Arntzen
884e5c0e06 MSL: Add test for block IO output with function use. 2023-03-30 18:30:44 +02:00
Hans-Kristian Arntzen
1d4e063788 HLSL: Add missing test reference. 2023-03-30 18:30:44 +02:00