|
@@ -29,14 +29,6 @@
|
|
#include "dxc/HLSL/DxilRootSignature.h"
|
|
#include "dxc/HLSL/DxilRootSignature.h"
|
|
#include "dxcutil.h"
|
|
#include "dxcutil.h"
|
|
#include "dxc/Support/dxcfilesystem.h"
|
|
#include "dxc/Support/dxcfilesystem.h"
|
|
-
|
|
|
|
-// SPIRV change starts
|
|
|
|
-#ifdef ENABLE_SPIRV_CODEGEN
|
|
|
|
-#include "clang/SPIRV/EmitSPIRVAction.h"
|
|
|
|
-#endif
|
|
|
|
-// SPIRV change ends
|
|
|
|
-
|
|
|
|
-
|
|
|
|
#include "dxc/Support/WinIncludes.h"
|
|
#include "dxc/Support/WinIncludes.h"
|
|
#include "dxc/HLSL/DxilContainer.h"
|
|
#include "dxc/HLSL/DxilContainer.h"
|
|
#include "dxc/dxcapi.internal.h"
|
|
#include "dxc/dxcapi.internal.h"
|
|
@@ -55,6 +47,16 @@
|
|
#include "dxillib.h"
|
|
#include "dxillib.h"
|
|
#include <algorithm>
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
+// SPIRV change starts
|
|
|
|
+#ifdef ENABLE_SPIRV_CODEGEN
|
|
|
|
+#include "clang/SPIRV/EmitSPIRVAction.h"
|
|
|
|
+#endif
|
|
|
|
+// SPIRV change ends
|
|
|
|
+
|
|
|
|
+#ifdef SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+#include "GitCommitInfo.inc" // Auto generated file containing Git commit info
|
|
|
|
+#endif // SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+
|
|
#define CP_UTF16 1200
|
|
#define CP_UTF16 1200
|
|
|
|
|
|
using namespace llvm;
|
|
using namespace llvm;
|
|
@@ -196,7 +198,15 @@ public:
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-class DxcCompiler : public IDxcCompiler2, public IDxcLangExtensions, public IDxcContainerEvent, public IDxcVersionInfo {
|
|
|
|
|
|
+class DxcCompiler : public IDxcCompiler2,
|
|
|
|
+ public IDxcLangExtensions,
|
|
|
|
+ public IDxcContainerEvent,
|
|
|
|
+#ifdef SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+ public IDxcVersionInfo2
|
|
|
|
+#else
|
|
|
|
+ public IDxcVersionInfo
|
|
|
|
+#endif // SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+{
|
|
private:
|
|
private:
|
|
DXC_MICROCOM_TM_REF_FIELDS()
|
|
DXC_MICROCOM_TM_REF_FIELDS()
|
|
DxcLangExtensionsHelper m_langExtensionsHelper;
|
|
DxcLangExtensionsHelper m_langExtensionsHelper;
|
|
@@ -260,7 +270,11 @@ public:
|
|
IDxcCompiler2,
|
|
IDxcCompiler2,
|
|
IDxcLangExtensions,
|
|
IDxcLangExtensions,
|
|
IDxcContainerEvent,
|
|
IDxcContainerEvent,
|
|
- IDxcVersionInfo>
|
|
|
|
|
|
+ IDxcVersionInfo
|
|
|
|
+#ifdef SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+ ,IDxcVersionInfo2
|
|
|
|
+#endif // SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+ >
|
|
(this, iid, ppvObject);
|
|
(this, iid, ppvObject);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -908,6 +922,23 @@ public:
|
|
*pMinor = DXIL::kDxilMinor;
|
|
*pMinor = DXIL::kDxilMinor;
|
|
return S_OK;
|
|
return S_OK;
|
|
}
|
|
}
|
|
|
|
+#ifdef SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
|
|
+ HRESULT STDMETHODCALLTYPE GetCommitInfo(_Out_ UINT32 *pCommitCount,
|
|
|
|
+ _Out_ char **pCommitHash) override {
|
|
|
|
+ if (pCommitCount == nullptr || pCommitHash == nullptr)
|
|
|
|
+ return E_INVALIDARG;
|
|
|
|
+
|
|
|
|
+ char *const hash = (char *)CoTaskMemAlloc(ARRAYSIZE(kGitCommitHash) + 1);
|
|
|
|
+ if (hash == nullptr)
|
|
|
|
+ return E_OUTOFMEMORY;
|
|
|
|
+ std::strcpy(hash, kGitCommitHash);
|
|
|
|
+
|
|
|
|
+ *pCommitHash = hash;
|
|
|
|
+ *pCommitCount = kGitCommitCount;
|
|
|
|
+
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+#endif // SUPPORT_QUERY_GIT_COMMIT_INFO
|
|
HRESULT STDMETHODCALLTYPE GetFlags(_Out_ UINT32 *pFlags) override {
|
|
HRESULT STDMETHODCALLTYPE GetFlags(_Out_ UINT32 *pFlags) override {
|
|
if (pFlags == nullptr)
|
|
if (pFlags == nullptr)
|
|
return E_INVALIDARG;
|
|
return E_INVALIDARG;
|
|
@@ -917,7 +948,6 @@ public:
|
|
#endif
|
|
#endif
|
|
return S_OK;
|
|
return S_OK;
|
|
}
|
|
}
|
|
-
|
|
|
|
};
|
|
};
|
|
|
|
|
|
HRESULT CreateDxcCompiler(_In_ REFIID riid, _Out_ LPVOID* ppv) {
|
|
HRESULT CreateDxcCompiler(_In_ REFIID riid, _Out_ LPVOID* ppv) {
|