diff options
Diffstat (limited to 'contrib/dxc_2025_07_14/inc/hlsl/vk/spirv.h')
| -rw-r--r-- | contrib/dxc_2025_07_14/inc/hlsl/vk/spirv.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/contrib/dxc_2025_07_14/inc/hlsl/vk/spirv.h b/contrib/dxc_2025_07_14/inc/hlsl/vk/spirv.h new file mode 100644 index 0000000..69bb53b --- /dev/null +++ b/contrib/dxc_2025_07_14/inc/hlsl/vk/spirv.h | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | // Copyright (c) 2024 Google LLC | ||
| 2 | // | ||
| 3 | // This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
| 4 | // See https://llvm.org/LICENSE.txt for license information. | ||
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| 6 | |||
| 7 | #ifndef _HLSL_VK_SPIRV_H_ | ||
| 8 | #define _HLSL_VK_SPIRV_H_ | ||
| 9 | |||
| 10 | namespace vk { | ||
| 11 | |||
| 12 | enum CooperativeMatrixUse { | ||
| 13 | CooperativeMatrixUseMatrixAKHR = 0, | ||
| 14 | CooperativeMatrixUseMatrixBKHR = 1, | ||
| 15 | CooperativeMatrixUseMatrixAccumulatorKHR = 2, | ||
| 16 | CooperativeMatrixUseMax = 0x7fffffff, | ||
| 17 | }; | ||
| 18 | |||
| 19 | enum CooperativeMatrixLayout { | ||
| 20 | CooperativeMatrixLayoutRowMajorKHR = 0, | ||
| 21 | CooperativeMatrixLayoutColumnMajorKHR = 1, | ||
| 22 | CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202, | ||
| 23 | CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203, | ||
| 24 | CooperativeMatrixLayoutMax = 0x7fffffff, | ||
| 25 | }; | ||
| 26 | |||
| 27 | enum CooperativeMatrixOperandsMask { | ||
| 28 | CooperativeMatrixOperandsMaskNone = 0, | ||
| 29 | CooperativeMatrixOperandsMatrixASignedComponentsKHRMask = 0x00000001, | ||
| 30 | CooperativeMatrixOperandsMatrixBSignedComponentsKHRMask = 0x00000002, | ||
| 31 | CooperativeMatrixOperandsMatrixCSignedComponentsKHRMask = 0x00000004, | ||
| 32 | CooperativeMatrixOperandsMatrixResultSignedComponentsKHRMask = 0x00000008, | ||
| 33 | CooperativeMatrixOperandsSaturatingAccumulationKHRMask = 0x00000010, | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum MemoryAccessMask { | ||
| 37 | MemoryAccessMaskNone = 0, | ||
| 38 | MemoryAccessVolatileMask = 0x00000001, | ||
| 39 | MemoryAccessAlignedMask = 0x00000002, | ||
| 40 | MemoryAccessNontemporalMask = 0x00000004, | ||
| 41 | MemoryAccessMakePointerAvailableMask = 0x00000008, | ||
| 42 | MemoryAccessMakePointerAvailableKHRMask = 0x00000008, | ||
| 43 | MemoryAccessMakePointerVisibleMask = 0x00000010, | ||
| 44 | MemoryAccessMakePointerVisibleKHRMask = 0x00000010, | ||
| 45 | MemoryAccessNonPrivatePointerMask = 0x00000020, | ||
| 46 | MemoryAccessNonPrivatePointerKHRMask = 0x00000020, | ||
| 47 | MemoryAccessAliasScopeINTELMaskMask = 0x00010000, | ||
| 48 | MemoryAccessNoAliasINTELMaskMask = 0x00020000, | ||
| 49 | }; | ||
| 50 | |||
| 51 | enum Scope { | ||
| 52 | ScopeCrossDevice = 0, | ||
| 53 | ScopeDevice = 1, | ||
| 54 | ScopeWorkgroup = 2, | ||
| 55 | ScopeSubgroup = 3, | ||
| 56 | ScopeInvocation = 4, | ||
| 57 | ScopeQueueFamily = 5, | ||
| 58 | ScopeQueueFamilyKHR = 5, | ||
| 59 | ScopeShaderCallKHR = 6, | ||
| 60 | ScopeMax = 0x7fffffff, | ||
| 61 | }; | ||
| 62 | |||
| 63 | enum StorageClass { | ||
| 64 | StorageClassWorkgroup = 4, | ||
| 65 | }; | ||
| 66 | |||
| 67 | // An opaque type to represent a Spir-V pointer to the workgroup storage class. | ||
| 68 | // clang-format off | ||
| 69 | template <typename PointeeType> | ||
| 70 | using WorkgroupSpirvPointer = const vk::SpirvOpaqueType< | ||
| 71 | /* OpTypePointer */ 32, | ||
| 72 | vk::Literal<vk::integral_constant<uint, StorageClassWorkgroup> >, | ||
| 73 | PointeeType>; | ||
| 74 | // clang-format on | ||
| 75 | |||
| 76 | // Returns an opaque Spir-V pointer to v. The memory object v's storage class | ||
| 77 | // modifier must be groupshared. If the incorrect storage class is used, then | ||
| 78 | // there will be a validation error, and it will not show the correct | ||
| 79 | template <typename T> | ||
| 80 | [[vk::ext_instruction(/* OpCopyObject */ 83)]] WorkgroupSpirvPointer<T> | ||
| 81 | GetGroupSharedAddress([[vk::ext_reference]] T v); | ||
| 82 | |||
| 83 | } // namespace vk | ||
| 84 | |||
| 85 | #endif // _HLSL_VK_SPIRV_H_ | ||
