File tree Expand file tree Collapse file tree 4 files changed +49
-4
lines changed Expand file tree Collapse file tree 4 files changed +49
-4
lines changed Original file line number Diff line number Diff line change 4
4
#ifndef _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_CORE_INCLUDED_
5
5
#define _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_CORE_INCLUDED_
6
6
7
-
8
7
#ifdef __HLSL_VERSION // TODO: AnastZIuk fix public search paths so we don't choke
9
8
#include "spirv/unified1/spirv.hpp"
10
9
11
10
#include <nbl/builtin/hlsl/vector_utils/vector_traits.hlsl>
12
- #include " nbl/builtin/hlsl/type_traits.hlsl"
11
+ #include < nbl/builtin/hlsl/type_traits.hlsl>
13
12
#include <nbl/builtin/hlsl/concepts.hlsl>
13
+ #include <nbl/builtin/hlsl/spirv_intrinsics/output_structs.hlsl>
14
14
15
15
namespace nbl
16
16
{
@@ -300,6 +300,14 @@ template<typename BooleanVector>
300
300
[[vk::ext_instruction (spv::OpAny)]]
301
301
enable_if_t<is_vector_v<BooleanVector>&& is_same_v<typename vector_traits<BooleanVector>::scalar_type, bool >, BooleanVector> any (BooleanVector vec);
302
302
303
+ template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
304
+ [[vk::ext_instruction (spv::OpIAddCarry)]]
305
+ AddCarryOutput<T> AddCarry (T operand1, T operand2);
306
+
307
+ template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
308
+ [[vk::ext_instruction (spv::OpISubBorrow)]]
309
+ SubBorrowOutput<T> SubBorrow (T operand1, T operand2);
310
+
303
311
}
304
312
305
313
#endif
Original file line number Diff line number Diff line change
1
+ // Copyright (C) 2023 - DevSH Graphics Programming Sp. z O.O.
2
+ // This file is part of the "Nabla Engine".
3
+ // For conditions of distribution and use, see copyright notice in nabla.h
4
+ #ifndef _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
5
+ #define _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
6
+
7
+ #include <nbl/builtin/hlsl/concepts/core.hlsl>
8
+
9
+ namespace nbl
10
+ {
11
+ namespace hlsl
12
+ {
13
+
14
+ template<typename T NBL_STRUCT_CONSTRAINABLE>
15
+ struct AddCarryOutput;
16
+ template<typename T NBL_STRUCT_CONSTRAINABLE>
17
+ struct SubBorrowOutput;
18
+
19
+
20
+ template<typename T> NBL_PARTIAL_REQ_TOP (concepts::UnsignedIntegral<T>)
21
+ struct AddCarryOutput<T NBL_PARTIAL_REQ_BOT (concepts::UnsignedIntegral<T>) >
22
+ {
23
+ T result;
24
+ T carry;
25
+ };
26
+
27
+ template<typename T> NBL_PARTIAL_REQ_TOP (concepts::UnsignedIntegral<T>)
28
+ struct SubBorrowOutput<T NBL_PARTIAL_REQ_BOT (concepts::UnsignedIntegral<T>) >
29
+ {
30
+ T result;
31
+ T borrow;
32
+ };
33
+ }
34
+ }
35
+
36
+ #endif
Original file line number Diff line number Diff line change 1
1
// Copyright (C) 2023 - DevSH Graphics Programming Sp. z O.O.
2
2
// This file is part of the "Nabla Engine".
3
3
// For conditions of distribution and use, see copyright notice in nabla.h
4
- #ifndef _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
5
- #define _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
4
+ #ifndef _NBL_BUILTIN_HLSL_TGMATH_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
5
+ #define _NBL_BUILTIN_HLSL_TGMATH_SPIRV_INTRINSICS_OUTPUT_STRUCTS_INCLUDED_
6
6
7
7
#include <nbl/builtin/hlsl/concepts/core.hlsl>
8
8
#include <nbl/builtin/hlsl/concepts/vector .hlsl>
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ LIST_BUILTIN_RESOURCE(NBL_RESOURCES_TO_EMBED "hlsl/spirv_intrinsics/subgroup_bas
238
238
LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/spirv_intrinsics/subgroup_shuffle.hlsl" )
239
239
LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/spirv_intrinsics/subgroup_vote.hlsl" )
240
240
LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/spirv_intrinsics/glsl.std.450.hlsl" )
241
+ LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/spirv_intrinsics/output_structs.hlsl" )
241
242
#C++ compatibility
242
243
LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/cpp_compat.hlsl" )
243
244
LIST_BUILTIN_RESOURCE (NBL_RESOURCES_TO_EMBED "hlsl/cpp_compat/basic.h" )
You can’t perform that action at this time.
0 commit comments