Commit Graph

3222 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
cd209ff46d HLSL: Update test from review. 2022-03-22 12:31:52 +01:00
Hans-Kristian Arntzen
c95338e03e Merge branch 'ray_query' of https://github.com/k-payl/SPIRV-Cross into pr-1859 2022-03-22 12:29:49 +01:00
Konstantin Pail
251361bd6f VK_KHR_ray_query implementation 2022-03-15 21:54:29 +03:00
Hans-Kristian Arntzen
565db34cba
Merge pull request #1892 from KhronosGroup/meta-lookup-cleanup
Avoid redundant meta lookups in ParsedIR when setting member decorations
2022-03-12 12:55:03 +01:00
Hans-Kristian Arntzen
39bad2c1f9 Avoid redundant meta lookups in ParsedIR when setting member decorations. 2022-03-12 12:14:01 +01:00
Hans-Kristian Arntzen
d5c3bd8b5e
Merge pull request #1890 from KhronosGroup/fix-1889
Fixup names of anonymous inner structs.
2022-03-10 16:48:01 +01:00
Hans-Kristian Arntzen
4ab5bbb4e5 Fixup names of anonymous inner structs.
Just like we try to fixup struct names for block types, inner structs
can be "anonymous" structs. HLSL codegen from DXC tends to emit this,
and emitting dummy struct names tends to break GL linkage on some
drivers.
2022-03-10 15:45:38 +01:00
Hans-Kristian Arntzen
0b51794f01
Merge pull request #1888 from KhronosGroup/msl-ib-variable-name-alias-fix
MSL: Fix variable name alias in IB structs.
2022-03-07 14:54:27 +01:00
Hans-Kristian Arntzen
1ec9d018fd MSL: Handle aliased variable names for resources placed in IB struct.
Just remember to register the names.
2022-03-07 12:00:40 +01:00
Hans-Kristian Arntzen
213c5f42ea MSL: Fix minor nits. 2022-03-07 11:45:38 +01:00
Hans-Kristian Arntzen
4ec1fb0aa9
Merge pull request #1887 from billhollings/msl-use-var-name-for-flattened-interface-struct-members
MSL: Use var name instead of var-type name for flattened interface members.
2022-03-07 11:45:20 +01:00
Bill Hollings
0c0fd98322 MSL: Use var name instead of var-type name for flattened interface members.
This allows two variables of the same struct type to be flattened
into the same interface struct without a member name conflict.

Add shaders-msl/frag/in_block_with_multiple_structs_of_same_type.frag
unit test shader to demonstrate this.
2022-03-04 11:38:53 -05:00
Hans-Kristian Arntzen
3915c37bb1 Merge branch 'fixup_gl_helper_invocation' of https://github.com/RandomShaper/SPIRV-Cross 2022-03-04 13:14:17 +01:00
Pedro J. Estébanez
c4f9e4fde9 HLSL: Fix Helper Invocation wrongly allowed in compute. 2022-03-04 13:10:41 +01:00
Hans-Kristian Arntzen
a1803778c2
Merge pull request #1885 from KhronosGroup/helper-invocation-rework
Helper invocation rework
2022-03-04 12:36:21 +01:00
Hans-Kristian Arntzen
b192b8887a MSL: Consider that gl_IsHelperInvocation can be Volatile.
Just emit simd_is_helper_thread() directly.
2022-03-04 11:46:35 +01:00
Hans-Kristian Arntzen
15d29f00e2 Add test for SPIR-V 1.6 Volatile HelperInvocation. 2022-03-04 11:19:33 +01:00
Hans-Kristian Arntzen
93b0dc7718 Consider Volatile in should_forward().
Never forward these variables.
2022-03-04 11:08:55 +01:00
Hans-Kristian Arntzen
476b6541fa Remove forwardable bit in SPIRVariable.
Was never really used for anything. It's always true.
2022-03-04 11:05:21 +01:00
Hans-Kristian Arntzen
5d9fc2d903 HLSL: Add test for HelperInvocation. 2022-03-04 10:58:40 +01:00
Hans-Kristian Arntzen
005c14ad6a HLSL: Implement HelperInvocationEXT.
It is volatile by nature and must not be forwarded.
2022-03-04 10:54:31 +01:00
Hans-Kristian Arntzen
75224c6c7c Merge branch 'gl_helper_invocation' of https://github.com/RandomShaper/SPIRV-Cross 2022-03-04 10:49:56 +01:00
Pedro J. Estébanez
278a4c80ed HLSL: Add support for gl_HelperInvocation 2022-03-04 09:25:09 +01:00
Hans-Kristian Arntzen
6c7a40822f
Merge pull request #1881 from KhronosGroup/relax-nan-checks
Add relax_nan_checks options.
2022-03-03 15:31:57 +01:00
Hans-Kristian Arntzen
31be74a853 Add relax_nan_checks options.
Makes codegen from typical D3D emulation SPIR-V more readable.
Also makes cross compilation with NotEqual more sensible.
It's very rare to actually need the strict NaN-checks in practice.

Also, glslang now emits UnordNotEqual by default it seems, so give up
trying to assume OrdNotEqual. Harmonize for UnordNotEqual as the sane
default.
2022-03-03 14:50:56 +01:00
Hans-Kristian Arntzen
b91ecf6077
Merge pull request #1880 from KhronosGroup/fix-1879
Handle OpTerminateInvocation.
2022-03-03 13:49:14 +01:00
Hans-Kristian Arntzen
2ce1e5c140
Merge pull request #1878 from mysterymath/move
Qualify std::move.
2022-03-03 11:06:13 +01:00
Hans-Kristian Arntzen
dc62cc792b Handle OpTerminateInvocation. 2022-03-03 10:36:07 +01:00
Hans-Kristian Arntzen
2a7f436135 Merge branch 'msl-add-nested-structs-to-io-blocks-squash' 2022-03-03 10:29:15 +01:00
Hans-Kristian Arntzen
7b594c125e Fix formatting nits from review. 2022-03-03 10:26:09 +01:00
Bill Hollings
bb4ced0280 MSL: Document clarification of location incrementing. 2022-03-03 10:19:04 +01:00
Bill Hollings
02d588b7e4 MSL: Fix var names in test shaders to avoid reserved identifiers. 2022-03-03 10:19:04 +01:00
Bill Hollings
3bb3b22b34 MSL: Non-functional fixes from PR code review. 2022-03-03 10:19:03 +01:00
Bill Hollings
3d4daab29d MSL: Support input/output blocks containing nested struct arrays
Fixes numerous CTS tests of types
dEQP-VK.pipeline.interface_matching.vector_length.member_of_*,
passing complex nested structs between stages as stage I/O.

- Make add_composite_member_variable_to_interface_block() recursive to allow
  struct members to contain nested structs, building up member names and access
  chains recursively, and only add the resulting flattened leaf members to the
  synthetic input and output interface blocks.
- Recursively generate individual location numbers for the flattened members
  of the input/output block.
- Replace to_qualified_member_name() with append_member_name().
- Update add_variable_to_interface_block() to support arrays as struct members,
  adding a member to input and output interface blocks for each element of the array.
- Pass name qualifiers to add_plain_member_variable_to_interface_block() to allow
  struct members to be arrays of structs, building up member names and access chains,
  and adding multiple distinct flattened leaf members to the synthetic input and
  output interface blocks.
- Generate individual location numbers for the individual array members
  of the input/output block.
- SPIRVCrossDecorationInterfaceMemberIndex references the index of a member
  of a variable that is a struct type. The value is relative to the variable,
  and for structs nested within that top-level struct, the index value needs
  to take into consideration the members within those nested structs.
- Pass var_mbr_idx to add_plain_member_variable_to_interface_block() and
  add_composite_member_variable_to_interface_block(), start at zero for each
  variable, and increment for each member or nested member within that variable.
- Add unit test shaders-msl/vert/out-block-with-nested-struct-array.vert
- Add unit test shaders-msl/vert/out-block-with-struct-array.vert
- Add unit test shaders-msl/tese/in-block-with-nested-struct.tese
2022-03-03 10:18:40 +01:00
Daniel Thornburgh
44c3333a1c Qualify std::move.
Clang added -Wunqualified-std-cast-call in
https://reviews.llvm.org/D119670, which warns on unqualified std::move
and std::forward calls. This change qualifies these calls to allow the
project to build on HEAD Clang -Werror.
2022-03-02 23:17:58 +00:00
Hans-Kristian Arntzen
d16183d1d2
Merge pull request #1873 from KhronosGroup/fix-1861
HLSL: Do not emit VPOS fixup unless position is active.
2022-02-28 12:58:07 +01:00
Hans-Kristian Arntzen
02440e85cf
Merge pull request #1872 from KhronosGroup/fix-1867
MSL: Refactor and fix use of quadgroup vs simdgroup.
2022-02-28 12:50:43 +01:00
Hans-Kristian Arntzen
7af0a5f820 HLSL: Do not emit VPOS fixup unless position is active. 2022-02-28 12:09:57 +01:00
Hans-Kristian Arntzen
5555f2784b MSL: Refactor and fix use of quadgroup vs simdgroup. 2022-02-28 11:58:33 +01:00
Hans-Kristian Arntzen
a569680406
Merge pull request #1870 from abrachet/master
Qualify move as std::move
2022-02-28 11:57:58 +01:00
Alex Brachet
0eda71c409 Qualify move as std::move
Seeing downstream errors:
"spirv_common.hpp:692:19: error: unqualified call to std::move"
2022-02-25 18:15:35 -05:00
Hans-Kristian Arntzen
c08ee860c8
Merge pull request #1869 from xndcn/msl
MSL: append entry point args to local variable names to avoid conflicts
2022-02-25 15:43:10 +01:00
xndcn
1b5c406a3d MSL: append entry point args to local variable names to avoid conflicts 2022-02-24 22:52:21 +08:00
Hans-Kristian Arntzen
188dc8b13c
Merge pull request #1862 from flokart-world/feature/flatten-ubo-for-hlsl
HLSL: Make --flatten-ubo work correctly
2022-02-16 16:39:45 +01:00
Hans-Kristian Arntzen
64e058aa9b
Merge pull request #1863 from KhronosGroup/various-fixes
Various fixes
2022-02-16 14:09:40 +01:00
Shintaro Sakahara
ed4ded040e HLSL: Make --flatten-ubo work correctly 2022-02-16 21:53:24 +09:00
Hans-Kristian Arntzen
a56b22bf4e Add more scenarios where we can guarantee forward progress.
The patterns where we force temporary due to invalid/overused expression -> recompile
should be seen as making forward progress, and there are very rare scenarios where
these recompiles can cascade into many loops.

Refactor this style of logic into a new function which is equivalent to handle_invalid_expression().
2022-02-16 12:12:58 +01:00
Hans-Kristian Arntzen
c716a9a5dd Add debug option to modify maximum number of compile iterations.
Should be seen as a hack, but it's pragmatic in some scenarios.
2022-02-16 12:12:27 +01:00
Hans-Kristian Arntzen
29cc18988c Fix regression from adding 64-bit switch support.
Missed some cases where we did not handle the loaded type width
properly.
2022-02-16 11:49:24 +01:00
Hans-Kristian Arntzen
339e61a0e0 Do not emit hoisted access chain temporaries unless backend supports it.
This can happen for access chains into buffer objects which were marked
as potentially hoisted, but it's benign in almost all cases.
2022-02-16 11:36:38 +01:00