소스 검색

Compile DxilLibraryReflection.inl on Linux and macOS

Lei Zhang 6 년 전
부모
커밋
b107c06d97
2개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 3
      include/dxc/HLSL/DxilRuntimeReflection.inl
  2. 5 3
      lib/HLSL/DxilContainerReflection.cpp

+ 3 - 3
include/dxc/HLSL/DxilRuntimeReflection.inl

@@ -9,8 +9,8 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "dxc/hlsl/DxilRuntimeReflection.h"
-#include <windows.h>
+#include "dxc/HLSL/DxilRuntimeReflection.h"
+#include "llvm/ADT/STLExtras.h"
 #include <unordered_map>
 #include <vector>
 #include <memory>
@@ -312,7 +312,7 @@ void DxilRuntimeReflection_impl::AddString(const char *ptr) {
     int size = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, ptr, -1,
                                      nullptr, 0);
     if (size != 0) {
-      auto pNew = std::make_unique<wchar_t[]>(size);
+      auto pNew = llvm::make_unique<wchar_t[]>(size);
       ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, ptr, -1,
                             pNew.get(), size);
       m_StringMap[ptr] = std::move(pNew);

+ 5 - 3
lib/HLSL/DxilContainerReflection.cpp

@@ -2341,13 +2341,15 @@ ID3D12FunctionReflection *DxilLibraryReflection::GetFunctionByIndex(INT Function
   return m_FunctionVector[FunctionIndex];
 }
 
-// DxilRuntimeReflection implementation
-#include "dxc/HLSL/DxilRuntimeReflection.inl"
+#else // LLVM_ON_WIN32
 
-#else
 void hlsl::CreateDxcContainerReflection(IDxcContainerReflection **ppResult) {
   *ppResult = nullptr;
 }
 
 DEFINE_CROSS_PLATFORM_UUIDOF(IDxcContainerReflection)
+
 #endif // LLVM_ON_WIN32
+
+// DxilRuntimeReflection implementation
+#include "dxc/HLSL/DxilRuntimeReflection.inl"