Skip to content

Commit dd8382e

Browse files
authored
[NFC] Extract Pipeline into support library (#15)
This extracts the pipeline description into a new Support library. This is preprataion for generating an Image library to work with images more formally, which will in turn depend on the Pipeline data structures.
1 parent 587340e commit dd8382e

File tree

11 files changed

+19
-11
lines changed

11 files changed

+19
-11
lines changed
File renamed without changes.

include/WinError.h renamed to include/Support/WinError.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- HLSLTest/WinError.h - Windows Error Utils ----------------*- C++ -*-===//
1+
//===- HLSLTest/Support/WinError.h - Windows Error Utils --------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,6 +9,9 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
#ifndef HLSLTEST_SUPPORT_WINERROR_H
13+
#define HLSLTEST_SUPPORT_WINERROR_H
14+
1215
#include "llvm/Support/Error.h"
1316

1417
namespace HR {
@@ -21,3 +24,5 @@ inline llvm::Error toError(HRESULT HR, llvm::StringRef Msg) {
2124
return llvm::Error::success();
2225
}
2326
} // namespace HR
27+
28+
#endif // #ifndef HLSLTEST_SUPPORT_WINERROR_H

lib/API/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ endif()
2323
add_hlsl_library(API
2424
Capabilities.cpp
2525
Device.cpp
26-
Pipeline.cpp
2726
${api_sources})
2827

2928
target_include_directories(HLSLTestAPI SYSTEM BEFORE ${api_headers})
3029

31-
target_link_libraries(HLSLTestAPI INTERFACE ${api_libraries})
30+
target_link_libraries(HLSLTestAPI INTERFACE HLSLTestSupport ${api_libraries})
3231
if (TARGET DIRECTX_HEADERS)
3332
add_dependencies(HLSLTestAPI DIRECTX_HEADERS)
3433
endif()

lib/API/DX/Device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "DXFeatures.h"
2525
#include "API/Capabilities.h"
2626
#include "API/Device.h"
27-
#include "API/Pipeline.h"
28-
#include "WinError.h"
27+
#include "Support/Pipeline.h"
28+
#include "Support/WinError.h"
2929

3030
#include "llvm/ADT/SmallVector.h"
3131
#include "llvm/Support/Error.h"

lib/API/MTL/MTLDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "metal_irconverter_runtime.h"
1111

1212
#include "API/Device.h"
13-
#include "API/Pipeline.h"
13+
#include "Support/Pipeline.h"
1414

1515
#include "llvm/ADT/SmallString.h"
1616
#include "llvm/Support/Error.h"

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
add_subdirectory(API)
2+
add_subdirectory(Support)

lib/Support/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_hlsl_library(Support Pipeline.cpp)

lib/API/Pipeline.cpp renamed to lib/Support/Pipeline.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- Pipeline.cpp - HLSL API Pipeline API -------------------------------===//
1+
//===- Pipeline.cpp - Support Pipeline API --------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#include "API/Pipeline.h"
12+
#include "Support/Pipeline.h"
1313

1414
using namespace hlsltest;
1515

tools/offloader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ add_hlsl_tool(offloader
44

55
target_include_directories(offloader PRIVATE SYSTEM BEFORE "${HLSLTEST_BINARY_DIR}/third-party/libpng/")
66

7-
target_link_libraries(offloader PRIVATE LLVMSupport HLSLTestAPI png_static)
7+
target_link_libraries(offloader PRIVATE LLVMSupport HLSLTestAPI HLSLTestSupport png_static)

tools/offloader/WritePNG.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#include "API/Pipeline.h"
12+
#include "Support/Pipeline.h"
13+
1314
#include "llvm/ADT/ScopeExit.h"
1415
#include "llvm/ADT/StringRef.h"
1516
#include "llvm/Support/Error.h"

0 commit comments

Comments
 (0)