Skip to content

Commit 00175bf

Browse files
author
joaosaffran
committed
clean up
1 parent 1026a8e commit 00175bf

File tree

9 files changed

+9
-24
lines changed

9 files changed

+9
-24
lines changed

llvm/include/llvm/BinaryFormat/DXContainer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
#define LLVM_BINARYFORMAT_DXCONTAINER_H
1515

1616
#include "llvm/ADT/StringRef.h"
17-
#include "llvm/Support/ErrorHandling.h"
1817
#include "llvm/Support/SwapByteOrder.h"
1918
#include "llvm/TargetParser/Triple.h"
2019

21-
#include <cstdint>
2220
#include <stdint.h>
2321

2422
namespace llvm {
@@ -579,7 +577,7 @@ struct RootConstants {
579577
struct RootParameter {
580578
dxbc::RootParameterType ParameterType;
581579
union {
582-
RootConstants Constants;
580+
dxbc::RootConstants Constants;
583581
};
584582
dxbc::ShaderVisibilityFlag ShaderVisibility;
585583

@@ -594,7 +592,6 @@ struct RootParameter {
594592
sys::swapByteOrder(ParameterType);
595593
sys::swapByteOrder(ShaderVisibility);
596594
switch (ParameterType) {
597-
598595
case RootParameterType::Constants32Bit:
599596
Constants.swapBytes();
600597
break;

llvm/include/llvm/BinaryFormat/DXContainerConstants.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ ROOT_ELEMENT_FLAG(11, SamplerHeapDirectlyIndexed)
7676

7777
ROOT_PARAMETER(1, Constants32Bit)
7878
ROOT_PARAMETER(5, Empty)
79-
8079
#undef ROOT_PARAMETER
8180
#endif // ROOT_PARAMETER
8281

8382
#ifdef SHADER_VISIBILITY
83+
8484
SHADER_VISIBILITY(0, All)
8585
SHADER_VISIBILITY(1, Vertex)
8686
SHADER_VISIBILITY(2, Hull)

llvm/include/llvm/MC/DXContainerRootSignature.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace llvm {
1515
class raw_ostream;
1616

1717
namespace mcdxbc {
18-
1918
struct RootSignatureDesc {
2019
dxbc::RootSignatureHeader Header;
2120
SmallVector<dxbc::RootParameter> Parameters;

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/MC/DXContainerRootSignature.h"
10-
#include "llvm/ADT/bit.h"
1110
#include "llvm/BinaryFormat/DXContainer.h"
1211
#include "llvm/Support/EndianStream.h"
13-
#include "llvm/Support/ErrorHandling.h"
1412
#include <cstdint>
15-
#include <sys/types.h>
1613

1714
using namespace llvm;
1815
using namespace llvm::mcdxbc;
1916

2017
void RootSignatureDesc::write(raw_ostream &OS) const {
18+
// Root signature header in dxcontainer has 6 uint_32t values.
2119
const uint32_t HeaderSize = 24;
2220
const uint32_t ParameterByteSize = Parameters.size_in_bytes();
21+
const uint32_t NumParametes = Parameters.size();
22+
const uint32_t Zero = 0;
2323

2424
// Writing header information
2525
support::endian::write(OS, Header.Version, llvm::endianness::little);
26-
support::endian::write(OS, (uint32_t)Parameters.size(),
27-
llvm::endianness::little);
26+
support::endian::write(OS, NumParametes, llvm::endianness::little);
2827
support::endian::write(OS, HeaderSize, llvm::endianness::little);
29-
support::endian::write(OS, ((uint32_t)0), llvm::endianness::little);
30-
// TODO: this value means nothing right now...
28+
29+
// Static samplers still not implemented
30+
support::endian::write(OS, Zero, llvm::endianness::little);
3131
support::endian::write(OS, ParameterByteSize + HeaderSize,
3232
llvm::endianness::little);
3333

llvm/lib/Object/DXContainer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
#include "llvm/Object/Error.h"
1212
#include "llvm/Support/Alignment.h"
1313
#include "llvm/Support/Endian.h"
14-
#include "llvm/Support/ErrorHandling.h"
1514
#include "llvm/Support/FormatVariadic.h"
16-
#include <cstddef>
17-
#include <cstdint>
1815

1916
using namespace llvm;
2017
using namespace llvm::object;
@@ -331,7 +328,6 @@ Error DirectX::RootSignature::parse(StringRef Data) {
331328
} break;
332329
case dxbc::RootParameterType::Empty:
333330
llvm_unreachable("Invalid value for RootParameterType");
334-
break;
335331
}
336332

337333
Parameters.push_back(NewParam);

llvm/lib/ObjectYAML/DXContainerEmitter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "llvm/Support/Errc.h"
2020
#include "llvm/Support/Error.h"
2121
#include "llvm/Support/raw_ostream.h"
22-
#include <utility>
2322

2423
using namespace llvm;
2524

llvm/lib/ObjectYAML/DXContainerYAML.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "llvm/ObjectYAML/DXContainerYAML.h"
1515
#include "llvm/ADT/ScopeExit.h"
1616
#include "llvm/BinaryFormat/DXContainer.h"
17-
#include "llvm/Support/ErrorHandling.h"
1817
#include "llvm/Support/ScopedPrinter.h"
1918

2019
namespace llvm {
@@ -232,14 +231,11 @@ void MappingTraits<dxbc::RootParameter>::mapping(IO &IO,
232231
IO.mapRequired("ParameterType", P.ParameterType);
233232
IO.mapRequired("ShaderVisibility", P.ShaderVisibility);
234233
switch (P.ParameterType) {
235-
236234
case dxbc::RootParameterType::Constants32Bit:
237235
IO.mapRequired("Constants", P.Constants);
238-
239236
break;
240237
case dxbc::RootParameterType::Empty:
241238
llvm_unreachable("Invalid value for ParameterType");
242-
break;
243239
}
244240
}
245241

llvm/unittests/Object/DXContainerTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "llvm/Support/MemoryBufferRef.h"
1515
#include "llvm/Testing/Support/Error.h"
1616
#include "gtest/gtest.h"
17-
#include <cstdint>
1817

1918
using namespace llvm;
2019
using namespace llvm::object;

0 commit comments

Comments
 (0)