Skip to content

Commit b93a66f

Browse files
authored
Merge branch 'main' into mat_bool_operator_tests
2 parents f13b9ff + 3dd467d commit b93a66f

17 files changed

Lines changed: 1476 additions & 692 deletions

.github/workflows/pr-matrix.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
SKU: ${{ matrix.SKU }}
3333
TestTarget: ${{ matrix.TestTarget }}
3434
OffloadTest-branch: ${{ github.event.pull_request.head.sha }}
35+
SplitBuild: true
3536
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On
3637

3738
Exec-Tests-Windows-Warp:
@@ -50,6 +51,7 @@ jobs:
5051
SKU: ${{ matrix.SKU }}
5152
TestTarget: ${{ matrix.TestTarget }}
5253
OffloadTest-branch: ${{ github.event.pull_request.head.sha }}
54+
SplitBuild: true
5355
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On
5456

5557
Exec-Tests-Extra:
@@ -72,6 +74,47 @@ jobs:
7274
SKU: ${{ matrix.SKU }}
7375
TestTarget: ${{ matrix.TestTarget }}
7476
OffloadTest-branch: ${{ github.event.pull_request.head.sha }}
77+
SplitBuild: true
78+
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On
79+
80+
Exec-Tests-Extra-DX-All:
81+
permissions:
82+
contents: read
83+
checks: write
84+
if: contains( github.event.pull_request.labels.*.name, 'test-dx-all')
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
SKU: [windows-amd, windows-qc]
89+
TestTarget: [check-hlsl-d3d12, check-hlsl-clang-d3d12]
90+
91+
uses: ./.github/workflows/build-and-test-callable.yaml
92+
with:
93+
OS: windows
94+
SKU: ${{ matrix.SKU }}
95+
TestTarget: ${{ matrix.TestTarget }}
96+
OffloadTest-branch: ${{ github.event.pull_request.head.sha }}
97+
SplitBuild: true
98+
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On
99+
100+
Exec-Tests-Extra-VK-All:
101+
permissions:
102+
contents: read
103+
checks: write
104+
if: contains( github.event.pull_request.labels.*.name, 'test-vk-all')
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
SKU: [windows-amd, windows-nvidia, windows-qc]
109+
TestTarget: [check-hlsl-vk, check-hlsl-clang-vk]
110+
111+
uses: ./.github/workflows/build-and-test-callable.yaml
112+
with:
113+
OS: windows
114+
SKU: ${{ matrix.SKU }}
115+
TestTarget: ${{ matrix.TestTarget }}
116+
OffloadTest-branch: ${{ github.event.pull_request.head.sha }}
117+
SplitBuild: true
75118
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On
76119

77120
Exec-Tests-MacOS:

include/API/AccelerationStructure.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,26 @@
1414
#include "API/Resources.h"
1515

1616
#include "llvm/ADT/ArrayRef.h"
17+
#include "llvm/ADT/BitmaskEnum.h"
1718
#include "llvm/ADT/SmallVector.h"
1819
#include "llvm/Support/Error.h"
1920

2021
#include <cstdint>
2122
#include <variant>
2223

2324
namespace offloadtest {
25+
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
26+
27+
// Bit values match D3D12_RAYTRACING_INSTANCE_FLAGS, VkGeometryInstanceFlagBits-
28+
// KHR, and MTLAccelerationStructureInstanceOptions so backends can pass the
29+
// value through unchanged.
30+
enum AccelerationStructureInstanceFlags : uint32_t {
31+
InstanceFlagNone = 0,
32+
TriangleCullDisable = 1 << 0,
33+
TriangleFrontCounterclockwise = 1 << 1,
34+
ForceOpaque = 1 << 2,
35+
ForceNonOpaque = 1 << 3,
36+
};
2437

2538
struct AccelerationStructureSizes {
2639
uint64_t ResultDataMaxSizeInBytes = 0;
@@ -57,6 +70,7 @@ struct AccelerationStructureInstance {
5770
uint8_t InstanceMask = 0xFF;
5871
// 24-bit; high bits are truncated by the backend to match DXR's bitfield.
5972
uint32_t InstanceContributionToHitGroupIndex = 0;
73+
AccelerationStructureInstanceFlags Flags = InstanceFlagNone;
6074
AccelerationStructure *BLAS = nullptr;
6175
};
6276

@@ -178,4 +192,9 @@ class AccelerationStructure {
178192

179193
} // namespace offloadtest
180194

195+
namespace llvm {
196+
LLVM_DECLARE_ENUM_AS_BITMASK(::offloadtest::AccelerationStructureInstanceFlags,
197+
::offloadtest::ForceNonOpaque);
198+
} // namespace llvm
199+
181200
#endif // OFFLOADTEST_API_ACCELERATIONSTRUCTURE_H

include/Support/Pipeline.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef OFFLOADTEST_SUPPORT_PIPELINE_H
1414
#define OFFLOADTEST_SUPPORT_PIPELINE_H
1515

16+
#include "API/AccelerationStructure.h"
1617
#include "API/Enums.h"
1718
#include "API/Resources.h"
1819
#include "llvm/ADT/SmallVector.h"
@@ -574,6 +575,7 @@ struct InstanceDesc {
574575
uint32_t InstanceID = 0;
575576
uint8_t InstanceMask = 0xFF;
576577
uint32_t InstanceContributionToHitGroupIndex = 0;
578+
AccelerationStructureInstanceFlags Flags = InstanceFlagNone;
577579
};
578580

579581
struct TLASDesc {
@@ -850,6 +852,19 @@ template <> struct MappingTraits<offloadtest::ShaderBindingTableDesc> {
850852
static void mapping(IO &I, offloadtest::ShaderBindingTableDesc &S);
851853
};
852854

855+
template <>
856+
struct ScalarBitSetTraits<offloadtest::AccelerationStructureInstanceFlags> {
857+
static void bitset(IO &I,
858+
offloadtest::AccelerationStructureInstanceFlags &V) {
859+
#define BIT_CASE(Val) I.bitSetCase(V, #Val, offloadtest::Val)
860+
BIT_CASE(TriangleCullDisable);
861+
BIT_CASE(TriangleFrontCounterclockwise);
862+
BIT_CASE(ForceOpaque);
863+
BIT_CASE(ForceNonOpaque);
864+
#undef BIT_CASE
865+
}
866+
};
867+
853868
template <> struct ScalarEnumerationTraits<offloadtest::Rule> {
854869
static void enumeration(IO &I, offloadtest::Rule &V) {
855870
#define ENUM_CASE(Val) I.enumCase(V, #Val, offloadtest::Rule::Val)

0 commit comments

Comments
 (0)