Skip to content

Commit fb574aa

Browse files
author
joaosaffran
committed
updating test
1 parent ca58712 commit fb574aa

File tree

4 files changed

+59
-54
lines changed

4 files changed

+59
-54
lines changed

llvm/include/llvm/BinaryFormat/DXContainer.h

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/Support/SwapByteOrder.h"
1818
#include "llvm/TargetParser/Triple.h"
1919

20-
#include <cstdint>
2120
#include <stdint.h>
2221

2322
namespace llvm {
@@ -64,6 +63,50 @@ struct ShaderHash {
6463
void swapBytes() { sys::swapByteOrder(Flags); }
6564
};
6665

66+
#define ROOT_PARAMETER(Val, Enum) Enum = Val,
67+
enum class RootParameterType : uint8_t {
68+
#include "DXContainerConstants.def"
69+
};
70+
71+
#define SHADER_VISIBILITY(Val, Enum) Enum = Val,
72+
enum class ShaderVisibilityFlag : uint8_t {
73+
#include "DXContainerConstants.def"
74+
};
75+
76+
struct RootConstants {
77+
uint32_t ShaderRegister;
78+
uint32_t RegisterSpace;
79+
uint32_t Num32BitValues;
80+
81+
void swapBytes() {
82+
sys::swapByteOrder(ShaderRegister);
83+
sys::swapByteOrder(RegisterSpace);
84+
sys::swapByteOrder(Num32BitValues);
85+
}
86+
};
87+
88+
struct RootParameter {
89+
RootParameterType ParameterType;
90+
union {
91+
RootConstants Constants;
92+
};
93+
ShaderVisibilityFlag ShaderVisibility;
94+
95+
void swapBytes() {
96+
switch (ParameterType) {
97+
98+
case RootParameterType::Constants32Bit:
99+
Constants.swapBytes();
100+
break;
101+
case RootParameterType::DescriptorTable:
102+
case RootParameterType::CBV:
103+
case RootParameterType::SRV:
104+
case RootParameterType::UAV:
105+
break;
106+
}
107+
}
108+
};
109+
67110
struct ContainerVersion {
68111
uint16_t Major;
69112
uint16_t Minor;
@@ -158,50 +201,6 @@ enum class RootElementFlag : uint32_t {
158201
#include "DXContainerConstants.def"
159202
};
160203

161-
#define ROOT_PARAMETER(Val, Enum) Enum = Val,
162-
enum class RootParameterType : uint8_t {
163-
#include "DXContainerConstants.def"
164-
};
165-
166-
#define SHADER_VISIBILITY(Val, Enum) Enum = Val,
167-
enum class ShaderVisibilityFlag : uint8_t {
168-
#include "DXContainerConstants.def"
169-
};
170-
171-
struct RootConstants {
172-
uint32_t ShaderRegister;
173-
uint32_t RegisterSpace;
174-
uint32_t Num32BitValues;
175-
176-
void swapBytes() {
177-
sys::swapByteOrder(ShaderRegister);
178-
sys::swapByteOrder(RegisterSpace);
179-
sys::swapByteOrder(Num32BitValues);
180-
}
181-
};
182-
183-
struct RootParameter {
184-
RootParameterType ParameterType;
185-
union {
186-
RootConstants Constants;
187-
};
188-
ShaderVisibilityFlag ShaderVisibility;
189-
190-
void swapBytes() {
191-
switch (ParameterType) {
192-
193-
case RootParameterType::Constants32Bit:
194-
Constants.swapBytes();
195-
break;
196-
case RootParameterType::DescriptorTable:
197-
case RootParameterType::CBV:
198-
case RootParameterType::SRV:
199-
case RootParameterType::UAV:
200-
break;
201-
}
202-
}
203-
};
204-
205204
PartType parsePartType(StringRef S);
206205

207206
struct VertexPSVInfo {

llvm/include/llvm/Object/DXContainer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "llvm/Support/MemoryBufferRef.h"
2323
#include "llvm/TargetParser/Triple.h"
2424
#include <array>
25-
#include <cstdint>
2625
#include <variant>
2726

2827
namespace llvm {

llvm/lib/MC/DXContainerRootSignature.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "llvm/MC/DXContainerRootSignature.h"
1010
#include "llvm/BinaryFormat/DXContainer.h"
1111
#include "llvm/Support/EndianStream.h"
12-
#include <cstdint>
1312

1413
using namespace llvm;
1514
using namespace llvm::mcdxbc;

llvm/test/ObjectYAML/DXContainer/RootSignature-Flags.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Parts:
1414
RootSignature:
1515
Size: 44
1616
Version: 1
17-
AllowInputAssemblerInputLayout: true
1817
NumParameters: 1
1918
Parameters:
2019
- Type: Constants32Bit
@@ -23,10 +22,19 @@ Parts:
2322
Num32BitValues: 3
2423
ShaderRegister: 1
2524
RegisterSpace: 2
25+
AllowInputAssemblerInputLayout: true
2626

27-
#CHECK: - Name: RTS0
28-
#CHECK-NEXT: Size: 8
29-
#CHECK-NEXT: RootSignature:
30-
#CHECK-NEXT: Size: 8
31-
#CHECK-NEXT: Version: 1
32-
#CHECK-NEXT: AllowInputAssemblerInputLayout: true
27+
#CHECK: - Name: RTS0
28+
#CHECK-NEXT: Size: 44
29+
#CHECK-NEXT: RootSignature:
30+
#CHECK-NEXT: Size: 64
31+
#CHECK-NEXT: Version: 1
32+
#CHECK-NEXT: NumParameters: 1
33+
#CHECK-NEXT: Parameters:
34+
#CHECK-NEXT: - Type: Constants32Bit
35+
#CHECK-NEXT: ShaderVisibility: All
36+
#CHECK-NEXT: Constants:
37+
#CHECK-NEXT: Num32BitValues: 3
38+
#CHECK-NEXT: ShaderRegister: 1
39+
#CHECK-NEXT: RegisterSpace: 2
40+
#CHECK-NEXT: AllowInputAssemblerInputLayout: true

0 commit comments

Comments
 (0)