diff --git a/include/dxc/Support/WinAdapter.h b/include/dxc/Support/WinAdapter.h index ac96f63b0c..be36410515 100644 --- a/include/dxc/Support/WinAdapter.h +++ b/include/dxc/Support/WinAdapter.h @@ -50,15 +50,9 @@ #define _countof(a) (sizeof(a) / sizeof(*(a))) // If it is GCC, there is no UUID support and we must emulate it. -#ifdef __APPLE__ -#define __EMULATE_UUID 1 -#else // __APPLE__ -#ifdef __GNUC__ #ifndef __clang__ #define __EMULATE_UUID 1 -#endif // __GNUC__ #endif // __clang__ -#endif // __APPLE__ #ifdef __EMULATE_UUID #define __declspec(x) @@ -452,15 +446,14 @@ typedef GUID CLSID; typedef const GUID &REFGUID; typedef const GUID &REFCLSID; -#ifdef __EMULATE_UUID -typedef const void *REFIID; -#define IsEqualIID(a, b) a == b -#define IsEqualCLSID(a, b) !memcmp(&a, &b, sizeof(GUID)) -#else // __EMULATE_UUID typedef GUID IID; typedef IID *LPIID; typedef const IID &REFIID; inline bool IsEqualGUID(REFGUID rguid1, REFGUID rguid2) { + // Optimization: + if (&rguid1 == &rguid2) + return true; + return !memcmp(&rguid1, &rguid2, sizeof(GUID)); } @@ -479,7 +472,6 @@ inline bool IsEqualIID(REFIID riid1, REFIID riid2) { inline bool IsEqualCLSID(REFCLSID rclsid1, REFCLSID rclsid2) { return IsEqualGUID(rclsid1, rclsid2); } -#endif // __EMULATE_UUID //===--------------------- Struct Types -----------------------------------===// @@ -559,27 +551,63 @@ enum tagSTATFLAG { #ifdef __EMULATE_UUID -size_t UuidStrHash(const char* k); - // The following macros are defined to facilitate the lack of 'uuid' on Linux. -#define DECLARE_CROSS_PLATFORM_UUIDOF(T) \ -public: \ - static REFIID uuidof() { return reinterpret_cast(T##_ID); } \ - \ -private: \ - __attribute__((visibility("default"))) static const size_t T##_ID; - -#define DEFINE_CROSS_PLATFORM_UUIDOF(T) \ - __attribute__((visibility("default"))) const size_t T::T##_ID = \ - UuidStrHash(#T); -#define __uuidof(T) T::uuidof() + +constexpr uint8_t nybble_from_hex(char c) { + return ((c >= '0' && c <= '9') + ? (c - '0') + : ((c >= 'a' && c <= 'f') + ? (c - 'a' + 10) + : ((c >= 'A' && c <= 'F') ? (c - 'A' + 10) + : /* Should be an error */ -1))); +} + +constexpr uint8_t byte_from_hex(char c1, char c2) { + return nybble_from_hex(c1) << 4 | nybble_from_hex(c2); +} + +constexpr uint8_t byte_from_hexstr(const char str[2]) { + return nybble_from_hex(str[0]) << 4 | nybble_from_hex(str[1]); +} + +constexpr GUID guid_from_string(const char str[37]) { + return GUID{static_cast(byte_from_hexstr(str)) << 24 | + static_cast(byte_from_hexstr(str + 2)) << 16 | + static_cast(byte_from_hexstr(str + 4)) << 8 | + byte_from_hexstr(str + 6), + static_cast( + static_cast(byte_from_hexstr(str + 9)) << 8 | + byte_from_hexstr(str + 11)), + static_cast( + static_cast(byte_from_hexstr(str + 14)) << 8 | + byte_from_hexstr(str + 16)), + {byte_from_hexstr(str + 19), byte_from_hexstr(str + 21), + byte_from_hexstr(str + 24), byte_from_hexstr(str + 26), + byte_from_hexstr(str + 28), byte_from_hexstr(str + 30), + byte_from_hexstr(str + 32), byte_from_hexstr(str + 34)}}; +} + +template inline GUID __emulated_uuidof(); + +#define CROSS_PLATFORM_UUIDOF(interface, spec) \ + struct interface; \ + template <> inline GUID __emulated_uuidof() { \ + static const IID _IID = guid_from_string(spec); \ + return _IID; \ + } + +#define __uuidof(T) __emulated_uuidof::type>() + #define IID_PPV_ARGS(ppType) \ - (**(ppType)).uuidof(), reinterpret_cast(ppType) + __uuidof(decltype(**(ppType))), reinterpret_cast(ppType) #else // __EMULATE_UUID -#define DECLARE_CROSS_PLATFORM_UUIDOF(T) -#define DEFINE_CROSS_PLATFORM_UUIDOF(T) +#ifndef CROSS_PLATFORM_UUIDOF +// Warning: This macro exists in dxcapi.h as well +#define CROSS_PLATFORM_UUIDOF(interface, spec) \ + struct __declspec(uuid(spec)) interface; +#endif template inline void **IID_PPV_ARGS_Helper(T **pp) { return reinterpret_cast(pp); @@ -590,8 +618,9 @@ template inline void **IID_PPV_ARGS_Helper(T **pp) { //===--------------------- COM Interfaces ---------------------------------===// -struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown { - IUnknown() : m_count(0){}; +CROSS_PLATFORM_UUIDOF(IUnknown, "00000000-0000-0000-C000-000000000046") +struct IUnknown { + IUnknown() : m_count(0) {}; virtual HRESULT QueryInterface(REFIID riid, void **ppvObject) = 0; virtual ULONG AddRef(); virtual ULONG Release(); @@ -602,33 +631,27 @@ struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown { private: std::atomic m_count; - - DECLARE_CROSS_PLATFORM_UUIDOF(IUnknown) }; -struct __declspec(uuid("ECC8691B-C1DB-4DC0-855E-65F6C551AF49")) INoMarshal - : public IUnknown { - DECLARE_CROSS_PLATFORM_UUIDOF(INoMarshal) -}; +CROSS_PLATFORM_UUIDOF(INoMarshal, "ECC8691B-C1DB-4DC0-855E-65F6C551AF49") +struct INoMarshal : public IUnknown {}; -struct __declspec(uuid("00000002-0000-0000-C000-000000000046")) IMalloc - : public IUnknown { +CROSS_PLATFORM_UUIDOF(IMalloc, "00000002-0000-0000-C000-000000000046") +struct IMalloc : public IUnknown { virtual void *Alloc(size_t size); virtual void *Realloc(void *ptr, size_t size); virtual void Free(void *ptr); virtual HRESULT QueryInterface(REFIID riid, void **ppvObject); }; -struct __declspec(uuid("0C733A30-2A1C-11CE-ADE5-00AA0044773D")) - ISequentialStream : public IUnknown { +CROSS_PLATFORM_UUIDOF(ISequentialStream, "0C733A30-2A1C-11CE-ADE5-00AA0044773D") +struct ISequentialStream : public IUnknown { virtual HRESULT Read(void *pv, ULONG cb, ULONG *pcbRead) = 0; virtual HRESULT Write(const void *pv, ULONG cb, ULONG *pcbWritten) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(ISequentialStream) }; -struct __declspec(uuid("0000000c-0000-0000-C000-000000000046")) IStream - : public ISequentialStream { +CROSS_PLATFORM_UUIDOF(IStream, "0000000c-0000-0000-C000-000000000046") +struct IStream : public ISequentialStream { virtual HRESULT Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) = 0; virtual HRESULT SetSize(ULARGE_INTEGER libNewSize) = 0; @@ -649,8 +672,6 @@ struct __declspec(uuid("0000000c-0000-0000-C000-000000000046")) IStream virtual HRESULT Stat(STATSTG *pstatstg, DWORD grfStatFlag) = 0; virtual HRESULT Clone(IStream **ppstm) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IStream) }; //===--------------------- COM Pointer Types ------------------------------===// diff --git a/include/dxc/dxcapi.h b/include/dxc/dxcapi.h index 897368c07b..e02418732d 100644 --- a/include/dxc/dxcapi.h +++ b/include/dxc/dxcapi.h @@ -24,9 +24,15 @@ #endif #ifdef _WIN32 -#define DECLARE_CROSS_PLATFORM_UUIDOF(T) -#define DEFINE_CROSS_PLATFORM_UUIDOF(T) + +#ifndef CROSS_PLATFORM_UUIDOF +// Warning: This macro exists in WinAdapter.h as well +#define CROSS_PLATFORM_UUIDOF(interface, spec) \ + struct __declspec(uuid(spec)) interface; +#endif + #else + #include #include "dxc/Support/WinAdapter.h" #endif @@ -133,22 +139,18 @@ typedef struct DxcShaderHash { #define DXC_ARG_DEBUG_NAME_FOR_BINARY L"-Zsb" // IDxcBlob is an alias of ID3D10Blob and ID3DBlob -struct __declspec(uuid("8BA5FB08-5195-40e2-AC58-0D989C3A0102")) -IDxcBlob : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcBlob, "8BA5FB08-5195-40e2-AC58-0D989C3A0102") +struct IDxcBlob : public IUnknown { public: virtual LPVOID STDMETHODCALLTYPE GetBufferPointer(void) = 0; virtual SIZE_T STDMETHODCALLTYPE GetBufferSize(void) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcBlob) }; -struct __declspec(uuid("7241d424-2646-4191-97c0-98e96e42fc68")) -IDxcBlobEncoding : public IDxcBlob { +CROSS_PLATFORM_UUIDOF(IDxcBlobEncoding, "7241d424-2646-4191-97c0-98e96e42fc68") +struct IDxcBlobEncoding : public IDxcBlob { public: virtual HRESULT STDMETHODCALLTYPE GetEncoding(_Out_ BOOL *pKnown, _Out_ UINT32 *pCodePage) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcBlobEncoding) }; // Notes on IDxcBlobUtf16 and IDxcBlobUtf8 @@ -160,31 +162,25 @@ IDxcBlobEncoding : public IDxcBlob { // on the -encoding option. // The API will use this interface for output name strings -struct __declspec(uuid("A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84")) -IDxcBlobUtf16 : public IDxcBlobEncoding { +CROSS_PLATFORM_UUIDOF(IDxcBlobUtf16, "A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84") +struct IDxcBlobUtf16 : public IDxcBlobEncoding { public: virtual LPCWSTR STDMETHODCALLTYPE GetStringPointer(void) = 0; virtual SIZE_T STDMETHODCALLTYPE GetStringLength(void) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcBlobUtf16) }; -struct __declspec(uuid("3DA636C9-BA71-4024-A301-30CBF125305B")) -IDxcBlobUtf8 : public IDxcBlobEncoding { +CROSS_PLATFORM_UUIDOF(IDxcBlobUtf8, "3DA636C9-BA71-4024-A301-30CBF125305B") +struct IDxcBlobUtf8 : public IDxcBlobEncoding { public: virtual LPCSTR STDMETHODCALLTYPE GetStringPointer(void) = 0; virtual SIZE_T STDMETHODCALLTYPE GetStringLength(void) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcBlobUtf8) }; -struct __declspec(uuid("7f61fc7d-950d-467f-b3e3-3c02fb49187c")) -IDxcIncludeHandler : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcIncludeHandler, "7f61fc7d-950d-467f-b3e3-3c02fb49187c") +struct IDxcIncludeHandler : public IUnknown { virtual HRESULT STDMETHODCALLTYPE LoadSource( _In_z_ LPCWSTR pFilename, // Candidate filename. _COM_Outptr_result_maybenull_ IDxcBlob **ppIncludeSource // Resultant source object for included file, nullptr if not found. ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcIncludeHandler) }; // Structure for supplying bytes or text input to Dxc APIs. @@ -200,8 +196,8 @@ struct DxcDefine { _Maybenull_ LPCWSTR Value; }; -struct __declspec(uuid("73EFFE2A-70DC-45F8-9690-EFF64C02429D")) -IDxcCompilerArgs : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcCompilerArgs, "73EFFE2A-70DC-45F8-9690-EFF64C02429D") +struct IDxcCompilerArgs : public IUnknown { // Pass GetArguments() and GetCount() to Compile virtual LPCWSTR* STDMETHODCALLTYPE GetArguments() = 0; virtual UINT32 STDMETHODCALLTYPE GetCount() = 0; @@ -219,8 +215,6 @@ IDxcCompilerArgs : public IUnknown { _In_count_(defineCount) const DxcDefine *pDefines, // Array of defines _In_ UINT32 defineCount // Number of defines ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompilerArgs) }; ////////////////////////// @@ -228,8 +222,8 @@ IDxcCompilerArgs : public IUnknown { ///////////////////////// // NOTE: IDxcUtils replaces IDxcLibrary -struct __declspec(uuid("e5204dc7-d18c-4c3c-bdfb-851673980fe7")) -IDxcLibrary : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcLibrary, "e5204dc7-d18c-4c3c-bdfb-851673980fe7") +struct IDxcLibrary : public IUnknown { virtual HRESULT STDMETHODCALLTYPE SetMalloc(_In_opt_ IMalloc *pMalloc) = 0; virtual HRESULT STDMETHODCALLTYPE CreateBlobFromBlob( _In_ IDxcBlob *pBlob, UINT32 offset, UINT32 length, _COM_Outptr_ IDxcBlob **ppResult) = 0; @@ -253,13 +247,11 @@ IDxcLibrary : public IUnknown { _In_ IDxcBlob *pBlob, _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0; virtual HRESULT STDMETHODCALLTYPE GetBlobAsUtf16( _In_ IDxcBlob *pBlob, _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcLibrary) }; // NOTE: IDxcResult replaces IDxcOperationResult -struct __declspec(uuid("CEDB484A-D4E9-445A-B991-CA21CA157DC2")) -IDxcOperationResult : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcOperationResult, "CEDB484A-D4E9-445A-B991-CA21CA157DC2") +struct IDxcOperationResult : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetStatus(_Out_ HRESULT *pStatus) = 0; // GetResult returns the main result of the operation. @@ -272,13 +264,11 @@ IDxcOperationResult : public IUnknown { // GetErrorBuffer Corresponds to DXC_OUT_ERRORS. virtual HRESULT STDMETHODCALLTYPE GetErrorBuffer(_COM_Outptr_result_maybenull_ IDxcBlobEncoding **ppErrors) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcOperationResult) }; // NOTE: IDxcCompiler3 replaces IDxcCompiler and IDxcCompiler2 -struct __declspec(uuid("8c210bf3-011f-4422-8d70-6f9acb8db617")) -IDxcCompiler : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcCompiler, "8c210bf3-011f-4422-8d70-6f9acb8db617") +struct IDxcCompiler : public IUnknown { // Compile a single entry point to the target shader model virtual HRESULT STDMETHODCALLTYPE Compile( _In_ IDxcBlob *pSource, // Source text to compile @@ -312,13 +302,11 @@ IDxcCompiler : public IUnknown { _In_ IDxcBlob *pSource, // Program to disassemble. _COM_Outptr_ IDxcBlobEncoding **ppDisassembly // Disassembly text. ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompiler) }; // NOTE: IDxcCompiler3 replaces IDxcCompiler and IDxcCompiler2 -struct __declspec(uuid("A005A9D9-B8BB-4594-B5C9-0E633BEC4D37")) -IDxcCompiler2 : public IDxcCompiler { +CROSS_PLATFORM_UUIDOF(IDxcCompiler2, "A005A9D9-B8BB-4594-B5C9-0E633BEC4D37") +struct IDxcCompiler2 : public IDxcCompiler { // Compile a single entry point to the target shader model with debug information. virtual HRESULT STDMETHODCALLTYPE CompileWithDebug( _In_ IDxcBlob *pSource, // Source text to compile @@ -335,12 +323,10 @@ IDxcCompiler2 : public IDxcCompiler { _Outptr_opt_result_z_ LPWSTR *ppDebugBlobName,// Suggested file name for debug blob. (Must be HeapFree()'d!) _COM_Outptr_opt_ IDxcBlob **ppDebugBlob // Debug blob ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompiler2) }; -struct __declspec(uuid("F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6")) -IDxcLinker : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcLinker, "F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6") +struct IDxcLinker : public IUnknown { public: // Register a library with name to ref it later. virtual HRESULT RegisterLibrary( @@ -361,8 +347,6 @@ IDxcLinker : public IUnknown { _COM_Outptr_ IDxcOperationResult **ppResult // Linker output status, buffer, and errors ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcLinker) }; ///////////////////////// @@ -370,8 +354,8 @@ IDxcLinker : public IUnknown { //////////////////////// // NOTE: IDxcUtils replaces IDxcLibrary -struct __declspec(uuid("4605C4CB-2019-492A-ADA4-65F20BB7D67F")) -IDxcUtils : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcUtils, "4605C4CB-2019-492A-ADA4-65F20BB7D67F") +struct IDxcUtils : public IUnknown { // Create a sub-blob that holds a reference to the outer blob and points to its memory. virtual HRESULT STDMETHODCALLTYPE CreateBlobFromBlob( _In_ IDxcBlob *pBlob, UINT32 offset, UINT32 length, _COM_Outptr_ IDxcBlob **ppResult) = 0; @@ -444,8 +428,6 @@ IDxcUtils : public IUnknown { // Takes the shader PDB and returns the hash and the container inside it virtual HRESULT STDMETHODCALLTYPE GetPDBContents( _In_ IDxcBlob *pPDBBlob, _COM_Outptr_ IDxcBlob **ppHash, _COM_Outptr_ IDxcBlob **ppContainer) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcUtils) }; // For use with IDxcResult::[Has|Get]Output dxcOutKind argument @@ -466,8 +448,8 @@ typedef enum DXC_OUT_KIND { DXC_OUT_FORCE_DWORD = 0xFFFFFFFF } DXC_OUT_KIND; -struct __declspec(uuid("58346CDA-DDE7-4497-9461-6F87AF5E0659")) -IDxcResult : public IDxcOperationResult { +CROSS_PLATFORM_UUIDOF(IDxcResult, "58346CDA-DDE7-4497-9461-6F87AF5E0659") +struct IDxcResult : public IDxcOperationResult { virtual BOOL STDMETHODCALLTYPE HasOutput(_In_ DXC_OUT_KIND dxcOutKind) = 0; virtual HRESULT STDMETHODCALLTYPE GetOutput(_In_ DXC_OUT_KIND dxcOutKind, _In_ REFIID iid, _COM_Outptr_opt_result_maybenull_ void **ppvObject, @@ -476,28 +458,24 @@ IDxcResult : public IDxcOperationResult { virtual UINT32 GetNumOutputs() = 0; virtual DXC_OUT_KIND GetOutputByIndex(UINT32 Index) = 0; virtual DXC_OUT_KIND PrimaryOutput() = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcResult) }; // Special names for extra output that should get written to specific streams #define DXC_EXTRA_OUTPUT_NAME_STDOUT L"*stdout*" #define DXC_EXTRA_OUTPUT_NAME_STDERR L"*stderr*" -struct __declspec(uuid("319b37a2-a5c2-494a-a5de-4801b2faf989")) -IDxcExtraOutputs : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcExtraOutputs, "319b37a2-a5c2-494a-a5de-4801b2faf989") +struct IDxcExtraOutputs : public IUnknown { virtual UINT32 STDMETHODCALLTYPE GetOutputCount() = 0; virtual HRESULT STDMETHODCALLTYPE GetOutput(_In_ UINT32 uIndex, _In_ REFIID iid, _COM_Outptr_opt_result_maybenull_ void **ppvObject, _COM_Outptr_opt_result_maybenull_ IDxcBlobUtf16 **ppOutputType, _COM_Outptr_opt_result_maybenull_ IDxcBlobUtf16 **ppOutputName) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcExtraOutputs) }; -struct __declspec(uuid("228B4687-5A6A-4730-900C-9702B2203F54")) -IDxcCompiler3 : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcCompiler3, "228B4687-5A6A-4730-900C-9702B2203F54") +struct IDxcCompiler3 : public IUnknown { // Compile a single entry point to the target shader model, // Compile a library to a library target (-T lib_*), // Compile a root signature (-T rootsig_*), or @@ -515,8 +493,6 @@ IDxcCompiler3 : public IUnknown { _In_ const DxcBuffer *pObject, // Program to disassemble: dxil container or bitcode. _In_ REFIID riid, _Out_ LPVOID *ppResult // IDxcResult: status, disassembly text, and errors ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompiler3) }; static const UINT32 DxcValidatorFlags_Default = 0; @@ -525,91 +501,75 @@ static const UINT32 DxcValidatorFlags_RootSignatureOnly = 2; static const UINT32 DxcValidatorFlags_ModuleOnly = 4; static const UINT32 DxcValidatorFlags_ValidMask = 0x7; -struct __declspec(uuid("A6E82BD2-1FD7-4826-9811-2857E797F49A")) -IDxcValidator : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcValidator, "A6E82BD2-1FD7-4826-9811-2857E797F49A") +struct IDxcValidator : public IUnknown { // Validate a shader. virtual HRESULT STDMETHODCALLTYPE Validate( _In_ IDxcBlob *pShader, // Shader to validate. _In_ UINT32 Flags, // Validation flags. _COM_Outptr_ IDxcOperationResult **ppResult // Validation output status, buffer, and errors ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcValidator) }; -struct __declspec(uuid("334b1f50-2292-4b35-99a1-25588d8c17fe")) -IDxcContainerBuilder : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcContainerBuilder, "334b1f50-2292-4b35-99a1-25588d8c17fe") +struct IDxcContainerBuilder : public IUnknown { virtual HRESULT STDMETHODCALLTYPE Load(_In_ IDxcBlob *pDxilContainerHeader) = 0; // Loads DxilContainer to the builder virtual HRESULT STDMETHODCALLTYPE AddPart(_In_ UINT32 fourCC, _In_ IDxcBlob *pSource) = 0; // Part to add to the container virtual HRESULT STDMETHODCALLTYPE RemovePart(_In_ UINT32 fourCC) = 0; // Remove the part with fourCC virtual HRESULT STDMETHODCALLTYPE SerializeContainer(_Out_ IDxcOperationResult **ppResult) = 0; // Builds a container of the given container builder state - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcContainerBuilder) }; -struct __declspec(uuid("091f7a26-1c1f-4948-904b-e6e3a8a771d5")) -IDxcAssembler : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcAssembler, "091f7a26-1c1f-4948-904b-e6e3a8a771d5") +struct IDxcAssembler : public IUnknown { // Assemble dxil in ll or llvm bitcode to DXIL container. virtual HRESULT STDMETHODCALLTYPE AssembleToContainer( _In_ IDxcBlob *pShader, // Shader to assemble. _COM_Outptr_ IDxcOperationResult **ppResult // Assembly output status, buffer, and errors ) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcAssembler) }; -struct __declspec(uuid("d2c21b26-8350-4bdc-976a-331ce6f4c54c")) -IDxcContainerReflection : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcContainerReflection, "d2c21b26-8350-4bdc-976a-331ce6f4c54c") +struct IDxcContainerReflection : public IUnknown { virtual HRESULT STDMETHODCALLTYPE Load(_In_ IDxcBlob *pContainer) = 0; // Container to load. virtual HRESULT STDMETHODCALLTYPE GetPartCount(_Out_ UINT32 *pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetPartKind(UINT32 idx, _Out_ UINT32 *pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetPartContent(UINT32 idx, _COM_Outptr_ IDxcBlob **ppResult) = 0; virtual HRESULT STDMETHODCALLTYPE FindFirstPartKind(UINT32 kind, _Out_ UINT32 *pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetPartReflection(UINT32 idx, REFIID iid, void **ppvObject) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcContainerReflection) }; -struct __declspec(uuid("AE2CD79F-CC22-453F-9B6B-B124E7A5204C")) -IDxcOptimizerPass : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcOptimizerPass, "AE2CD79F-CC22-453F-9B6B-B124E7A5204C") +struct IDxcOptimizerPass : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetOptionName(_COM_Outptr_ LPWSTR *ppResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetDescription(_COM_Outptr_ LPWSTR *ppResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetOptionArgCount(_Out_ UINT32 *pCount) = 0; virtual HRESULT STDMETHODCALLTYPE GetOptionArgName(UINT32 argIndex, _COM_Outptr_ LPWSTR *ppResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetOptionArgDescription(UINT32 argIndex, _COM_Outptr_ LPWSTR *ppResult) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcOptimizerPass) }; -struct __declspec(uuid("25740E2E-9CBA-401B-9119-4FB42F39F270")) -IDxcOptimizer : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcOptimizer, "25740E2E-9CBA-401B-9119-4FB42F39F270") +struct IDxcOptimizer : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetAvailablePassCount(_Out_ UINT32 *pCount) = 0; virtual HRESULT STDMETHODCALLTYPE GetAvailablePass(UINT32 index, _COM_Outptr_ IDxcOptimizerPass** ppResult) = 0; virtual HRESULT STDMETHODCALLTYPE RunOptimizer(IDxcBlob *pBlob, _In_count_(optionCount) LPCWSTR *ppOptions, UINT32 optionCount, _COM_Outptr_ IDxcBlob **pOutputModule, _COM_Outptr_opt_ IDxcBlobEncoding **ppOutputText) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcOptimizer) }; static const UINT32 DxcVersionInfoFlags_None = 0; static const UINT32 DxcVersionInfoFlags_Debug = 1; // Matches VS_FF_DEBUG static const UINT32 DxcVersionInfoFlags_Internal = 2; // Internal Validator (non-signing) -struct __declspec(uuid("b04f5b50-2059-4f12-a8ff-a1e0cde1cc7e")) -IDxcVersionInfo : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcVersionInfo, "b04f5b50-2059-4f12-a8ff-a1e0cde1cc7e") +struct IDxcVersionInfo : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetVersion(_Out_ UINT32 *pMajor, _Out_ UINT32 *pMinor) = 0; virtual HRESULT STDMETHODCALLTYPE GetFlags(_Out_ UINT32 *pFlags) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcVersionInfo) }; -struct __declspec(uuid("fb6904c4-42f0-4b62-9c46-983af7da7c83")) -IDxcVersionInfo2 : public IDxcVersionInfo { +CROSS_PLATFORM_UUIDOF(IDxcVersionInfo2, "fb6904c4-42f0-4b62-9c46-983af7da7c83") +struct IDxcVersionInfo2 : public IDxcVersionInfo { virtual HRESULT STDMETHODCALLTYPE GetCommitInfo(_Out_ UINT32 *pCommitCount, _Out_ char **pCommitHash) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcVersionInfo2) }; // Note: __declspec(selectany) requires 'extern' diff --git a/include/dxc/dxcapi.internal.h b/include/dxc/dxcapi.internal.h index 2acabebcf8..9bc19cd59d 100644 --- a/include/dxc/dxcapi.internal.h +++ b/include/dxc/dxcapi.internal.h @@ -126,8 +126,8 @@ struct HLSL_INTRINSIC { /////////////////////////////////////////////////////////////////////////////// // Interfaces. -struct __declspec(uuid("f0d4da3f-f863-4660-b8b4-dfd94ded6215")) -IDxcIntrinsicTable : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcIntrinsicTable, "f0d4da3f-f863-4660-b8b4-dfd94ded6215") +struct IDxcIntrinsicTable : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetTableName(_Outptr_ LPCSTR *pTableName) = 0; @@ -153,15 +153,15 @@ IDxcIntrinsicTable : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetDxilOpCode(UINT opcode, UINT *pDxilOpcode) = 0; }; -struct __declspec(uuid("1d063e4f-515a-4d57-a12a-431f6a44cfb9")) -IDxcSemanticDefineValidator : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcSemanticDefineValidator, "1d063e4f-515a-4d57-a12a-431f6a44cfb9") +struct IDxcSemanticDefineValidator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetSemanticDefineWarningsAndErrors(LPCSTR pName, LPCSTR pValue, IDxcBlobEncoding **ppWarningBlob, IDxcBlobEncoding **ppErrorBlob) = 0; }; -struct __declspec(uuid("282a56b4-3f56-4360-98c7-9ea04a752272")) -IDxcLangExtensions : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcLangExtensions, "282a56b4-3f56-4360-98c7-9ea04a752272") +struct IDxcLangExtensions : public IUnknown { public: /// @@ -181,19 +181,16 @@ IDxcLangExtensions : public IUnknown virtual HRESULT STDMETHODCALLTYPE SetSemanticDefineValidator(_In_ IDxcSemanticDefineValidator* pValidator) = 0; /// Sets the name for the root metadata node used in DXIL to hold the semantic defines. virtual HRESULT STDMETHODCALLTYPE SetSemanticDefineMetaDataName(LPCSTR name) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcLangExtensions) }; -struct __declspec(uuid("2490C368-89EE-4491-A4B2-C6547B6C9381")) -IDxcLangExtensions2 : public IDxcLangExtensions { +CROSS_PLATFORM_UUIDOF(IDxcLangExtensions2, "2490C368-89EE-4491-A4B2-C6547B6C9381") +struct IDxcLangExtensions2 : public IDxcLangExtensions { public: virtual HRESULT STDMETHODCALLTYPE SetTargetTriple(LPCSTR name) = 0; - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcLangExtensions2) }; -struct __declspec(uuid("454b764f-3549-475b-958c-a7a6fcd05fbc")) -IDxcSystemAccess : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcSystemAccess, "454b764f-3549-475b-958c-a7a6fcd05fbc") +struct IDxcSystemAccess : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE EnumFiles(LPCWSTR fileName, IEnumSTATSTG** pResult) = 0; @@ -237,15 +234,15 @@ IDxcSystemAccess : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetStreamDisplay(_COM_Outptr_result_maybenull_ ITextFont** textFont, _Out_ unsigned* columnCount) = 0; }; -struct __declspec(uuid("e991ca8d-2045-413c-a8b8-788b2c06e14d")) -IDxcContainerEventsHandler : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcContainerEventsHandler, "e991ca8d-2045-413c-a8b8-788b2c06e14d") +struct IDxcContainerEventsHandler : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE OnDxilContainerBuilt(_In_ IDxcBlob *pSource, _Out_ IDxcBlob **ppTarget) = 0; }; -struct __declspec(uuid("0cfc5058-342b-4ff2-83f7-04c12aad3d01")) -IDxcContainerEvent : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcContainerEvent, "0cfc5058-342b-4ff2-83f7-04c12aad3d01") +struct IDxcContainerEvent : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE RegisterDxilContainerEventHandler(IDxcContainerEventsHandler *pHandler, UINT64 *pCookie) = 0; diff --git a/include/dxc/dxcisense.h b/include/dxc/dxcisense.h index c9e55a7199..1b7dc0c7c6 100644 --- a/include/dxc/dxcisense.h +++ b/include/dxc/dxcisense.h @@ -613,8 +613,8 @@ struct IDxcCodeCompleteResults; struct IDxcCompletionResult; struct IDxcCompletionString; -struct __declspec(uuid("1467b985-288d-4d2a-80c1-ef89c42c40bc")) -IDxcCursor : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcCursor, "1467b985-288d-4d2a-80c1-ef89c42c40bc") +struct IDxcCursor : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetExtent(_Outptr_result_nullonfailure_ IDxcSourceRange** pRange) = 0; virtual HRESULT STDMETHODCALLTYPE GetLocation(_Outptr_result_nullonfailure_ IDxcSourceLocation** pResult) = 0; @@ -652,8 +652,8 @@ IDxcCursor : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetSnappedChild(_In_ IDxcSourceLocation* location, _Outptr_result_maybenull_ IDxcCursor** pResult) = 0; }; -struct __declspec(uuid("4f76b234-3659-4d33-99b0-3b0db994b564")) -IDxcDiagnostic : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcDiagnostic, "4f76b234-3659-4d33-99b0-3b0db994b564") +struct IDxcDiagnostic : public IUnknown { virtual HRESULT STDMETHODCALLTYPE FormatDiagnostic( DxcDiagnosticDisplayOptions options, @@ -669,8 +669,8 @@ IDxcDiagnostic : public IUnknown _Outptr_result_nullonfailure_ IDxcSourceRange** pReplacementRange, _Outptr_result_maybenull_ LPSTR* pText) = 0; }; -struct __declspec(uuid("bb2fca9e-1478-47ba-b08c-2c502ada4895")) -IDxcFile : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcFile, "bb2fca9e-1478-47ba-b08c-2c502ada4895") +struct IDxcFile : public IUnknown { /// Gets the file name for this file. virtual HRESULT STDMETHODCALLTYPE GetName(_Outptr_result_maybenull_ LPSTR* pResult) = 0; @@ -678,16 +678,16 @@ IDxcFile : public IUnknown virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcFile* other, _Out_ BOOL* pResult) = 0; }; -struct __declspec(uuid("0c364d65-df44-4412-888e-4e552fc5e3d6")) -IDxcInclusion : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcInclusion, "0c364d65-df44-4412-888e-4e552fc5e3d6") +struct IDxcInclusion : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetIncludedFile(_Outptr_result_nullonfailure_ IDxcFile** pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetStackLength(_Out_ unsigned *pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetStackItem(unsigned index, _Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; }; -struct __declspec(uuid("b1f99513-46d6-4112-8169-dd0d6053f17d")) -IDxcIntelliSense : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcIntelliSense, "b1f99513-46d6-4112-8169-dd0d6053f17d") +struct IDxcIntelliSense : public IUnknown { virtual HRESULT STDMETHODCALLTYPE CreateIndex(_Outptr_result_nullonfailure_ IDxcIndex** index) = 0; virtual HRESULT STDMETHODCALLTYPE GetNullLocation(_Outptr_result_nullonfailure_ IDxcSourceLocation** location) = 0; @@ -700,12 +700,10 @@ IDxcIntelliSense : public IUnknown _Out_ DxcDiagnosticDisplayOptions* pValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetDefaultEditingTUOptions(_Out_ DxcTranslationUnitFlags* pValue) = 0; virtual HRESULT STDMETHODCALLTYPE CreateUnsavedFile(_In_ LPCSTR fileName, _In_ LPCSTR contents, unsigned contentLength, _Outptr_result_nullonfailure_ IDxcUnsavedFile** pResult) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcIntelliSense) }; -struct __declspec(uuid("937824a0-7f5a-4815-9ba7-7fc0424f4173")) -IDxcIndex : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcIndex, "937824a0-7f5a-4815-9ba7-7fc0424f4173") +struct IDxcIndex : public IUnknown { virtual HRESULT STDMETHODCALLTYPE SetGlobalOptions(DxcGlobalOptions options) = 0; virtual HRESULT STDMETHODCALLTYPE GetGlobalOptions(_Out_ DxcGlobalOptions* options) = 0; @@ -719,8 +717,8 @@ IDxcIndex : public IUnknown _Out_ IDxcTranslationUnit** pTranslationUnit) = 0; }; -struct __declspec(uuid("8e7ddf1c-d7d3-4d69-b286-85fccba1e0cf")) -IDxcSourceLocation : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcSourceLocation, "8e7ddf1c-d7d3-4d69-b286-85fccba1e0cf") +struct IDxcSourceLocation : public IUnknown { virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcSourceLocation* other, _Out_ BOOL* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetSpellingLocation( @@ -735,8 +733,8 @@ IDxcSourceLocation : public IUnknown _Out_opt_ unsigned* pCol) = 0; }; -struct __declspec(uuid("f1359b36-a53f-4e81-b514-b6b84122a13f")) -IDxcSourceRange : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcSourceRange, "f1359b36-a53f-4e81-b514-b6b84122a13f") +struct IDxcSourceRange : public IUnknown { virtual HRESULT STDMETHODCALLTYPE IsNull(_Out_ BOOL* pValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetStart(_Out_ IDxcSourceLocation** pValue) = 0; @@ -744,8 +742,8 @@ IDxcSourceRange : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetOffsets(_Out_ unsigned* startOffset, _Out_ unsigned* endOffset) = 0; }; -struct __declspec(uuid("7f90b9ff-a275-4932-97d8-3cfd234482a2")) -IDxcToken : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcToken, "7f90b9ff-a275-4932-97d8-3cfd234482a2") +struct IDxcToken : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetKind(_Out_ DxcTokenKind* pValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetLocation(_Out_ IDxcSourceLocation** pValue) = 0; @@ -753,8 +751,8 @@ IDxcToken : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetSpelling(_Out_ LPSTR* pValue) = 0; }; -struct __declspec(uuid("9677dee0-c0e5-46a1-8b40-3db3168be63d")) -IDxcTranslationUnit : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcTranslationUnit, "9677dee0-c0e5-46a1-8b40-3db3168be63d") +struct IDxcTranslationUnit : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetCursor(_Out_ IDxcCursor** pCursor) = 0; virtual HRESULT STDMETHODCALLTYPE Tokenize( @@ -791,16 +789,16 @@ IDxcTranslationUnit : public IUnknown _Outptr_result_nullonfailure_ IDxcCodeCompleteResults **pResult) = 0; }; -struct __declspec(uuid("2ec912fd-b144-4a15-ad0d-1c5439c81e46")) -IDxcType : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcType, "2ec912fd-b144-4a15-ad0d-1c5439c81e46") +struct IDxcType : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetSpelling(_Outptr_result_z_ LPSTR* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcType* other, _Out_ BOOL* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetKind(_Out_ DxcTypeKind* pResult) = 0; }; -struct __declspec(uuid("8ec00f98-07d0-4e60-9d7c-5a50b5b0017f")) -IDxcUnsavedFile : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcUnsavedFile, "8ec00f98-07d0-4e60-9d7c-5a50b5b0017f") +struct IDxcUnsavedFile : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetFileName(_Outptr_result_z_ LPSTR* pFileName) = 0; virtual HRESULT STDMETHODCALLTYPE GetContents(_Outptr_result_z_ LPSTR* pContents) = 0; @@ -808,22 +806,22 @@ IDxcUnsavedFile : public IUnknown }; -struct __declspec(uuid("1E06466A-FD8B-45F3-A78F-8A3F76EBB552")) -IDxcCodeCompleteResults : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcCodeCompleteResults, "1E06466A-FD8B-45F3-A78F-8A3F76EBB552") +struct IDxcCodeCompleteResults : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetNumResults(_Out_ unsigned* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetResultAt(unsigned index, _Outptr_result_nullonfailure_ IDxcCompletionResult** pResult) = 0; }; -struct __declspec(uuid("943C0588-22D0-4784-86FC-701F802AC2B6")) -IDxcCompletionResult : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcCompletionResult, "943C0588-22D0-4784-86FC-701F802AC2B6") +struct IDxcCompletionResult : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetCursorKind(_Out_ DxcCursorKind* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetCompletionString(_Outptr_result_nullonfailure_ IDxcCompletionString** pResult) = 0; }; -struct __declspec(uuid("06B51E0F-A605-4C69-A110-CD6E14B58EEC")) -IDxcCompletionString : public IUnknown +CROSS_PLATFORM_UUIDOF(IDxcCompletionString, "06B51E0F-A605-4C69-A110-CD6E14B58EEC") +struct IDxcCompletionString : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetNumCompletionChunks(_Out_ unsigned* pResult) = 0; virtual HRESULT STDMETHODCALLTYPE GetCompletionChunkKind(unsigned chunkNumber, _Out_ DxcCompletionChunkKind* pResult) = 0; diff --git a/include/dxc/dxctools.h b/include/dxc/dxctools.h index 49a2830f51..59527b163c 100644 --- a/include/dxc/dxctools.h +++ b/include/dxc/dxctools.h @@ -22,8 +22,8 @@ enum RewriterOptionMask { KeepUserMacro = 8, }; -struct __declspec(uuid("c012115b-8893-4eb9-9c5a-111456ea1c45")) -IDxcRewriter : public IUnknown { +CROSS_PLATFORM_UUIDOF(IDxcRewriter, "c012115b-8893-4eb9-9c5a-111456ea1c45") +struct IDxcRewriter : public IUnknown { virtual HRESULT STDMETHODCALLTYPE RemoveUnusedGlobals(_In_ IDxcBlobEncoding *pSource, _In_z_ LPCWSTR entryPoint, @@ -46,8 +46,6 @@ IDxcRewriter : public IUnknown { _In_opt_ IDxcIncludeHandler *pIncludeHandler, _In_ UINT32 rewriteOption, _COM_Outptr_ IDxcOperationResult **ppResult) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcRewriter) }; #ifdef _MSC_VER @@ -63,8 +61,8 @@ CLSID_SCOPE const CLSID 0x40b3, {0x96, 0x8d, 0x93, 0xe1, 0x24, 0x73, 0x4d, 0xa4}}; -struct __declspec(uuid("261afca1-0609-4ec6-a77f-d98c7035194e")) -IDxcRewriter2 : public IDxcRewriter { +CROSS_PLATFORM_UUIDOF(IDxcRewriter2, "261afca1-0609-4ec6-a77f-d98c7035194e") +struct IDxcRewriter2 : public IDxcRewriter { virtual HRESULT STDMETHODCALLTYPE RewriteWithOptions(_In_ IDxcBlobEncoding *pSource, // Optional file name for pSource. Used in errors and include handlers. @@ -76,8 +74,6 @@ IDxcRewriter2 : public IDxcRewriter { // user-provided interface to handle #include directives (optional) _In_opt_ IDxcIncludeHandler *pIncludeHandler, _COM_Outptr_ IDxcOperationResult **ppResult) = 0; - - DECLARE_CROSS_PLATFORM_UUIDOF(IDxcRewriter2) }; #endif diff --git a/lib/DxcSupport/WinAdapter.cpp b/lib/DxcSupport/WinAdapter.cpp index dcc6303cc6..27bd7c3c7e 100644 --- a/lib/DxcSupport/WinAdapter.cpp +++ b/lib/DxcSupport/WinAdapter.cpp @@ -12,29 +12,6 @@ #include "dxc/Support/WinAdapter.h" #include "dxc/Support/WinFunctions.h" -//===--------------------- UUID Related Macros ----------------------------===// - -#ifdef __EMULATE_UUID - -size_t UuidStrHash(const char* k) { - long h = 0; - while (*k) { - h = (h << 4) + *(k++); - long g = h & 0xF0000000L; - if (g != 0) - h ^= g >> 24; - h &= ~g; - } - return h; -} - -#endif // __EMULATE_UUID - -DEFINE_CROSS_PLATFORM_UUIDOF(IUnknown) -DEFINE_CROSS_PLATFORM_UUIDOF(INoMarshal) -DEFINE_CROSS_PLATFORM_UUIDOF(IStream) -DEFINE_CROSS_PLATFORM_UUIDOF(ISequentialStream) - //===--------------------------- IUnknown ---------------------------------===// ULONG IUnknown::AddRef() { diff --git a/lib/HLSL/DxilContainerReflection.cpp b/lib/HLSL/DxilContainerReflection.cpp index 5235a9a9c3..997a5f7267 100644 --- a/lib/HLSL/DxilContainerReflection.cpp +++ b/lib/HLSL/DxilContainerReflection.cpp @@ -2762,7 +2762,4 @@ void hlsl::CreateDxcContainerReflection(IDxcContainerReflection **ppResult) { *ppResult = nullptr; } -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcContainerReflection) - #endif // LLVM_ON_WIN32 - diff --git a/tools/clang/tools/dxcompiler/dxcapi.cpp b/tools/clang/tools/dxcompiler/dxcapi.cpp index 7fc8fb1988..ec80ca7d1c 100644 --- a/tools/clang/tools/dxcompiler/dxcapi.cpp +++ b/tools/clang/tools/dxcompiler/dxcapi.cpp @@ -27,33 +27,6 @@ #include "dxc/DxilContainer/DxcContainerBuilder.h" #include -// Initialize the UUID for the interfaces. -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcLibrary) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcBlobEncoding) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcOperationResult) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcAssembler) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcBlob) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcIncludeHandler) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcCompiler) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcCompiler2) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcVersionInfo) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcVersionInfo2) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcValidator) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcContainerBuilder) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcOptimizerPass) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcOptimizer) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcRewriter) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcRewriter2) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcIntelliSense) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcLinker) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcBlobUtf16) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcBlobUtf8) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcCompilerArgs) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcUtils) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcResult) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcExtraOutputs) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcCompiler3) - HRESULT CreateDxcCompiler(_In_ REFIID riid, _Out_ LPVOID *ppv); HRESULT CreateDxcDiaDataSource(_In_ REFIID riid, _Out_ LPVOID *ppv); HRESULT CreateDxcIntelliSense(_In_ REFIID riid, _Out_ LPVOID *ppv); diff --git a/tools/clang/tools/dxcompiler/dxcompilerobj.cpp b/tools/clang/tools/dxcompiler/dxcompilerobj.cpp index 53c3147b48..c66f1a7b12 100644 --- a/tools/clang/tools/dxcompiler/dxcompilerobj.cpp +++ b/tools/clang/tools/dxcompiler/dxcompilerobj.cpp @@ -67,9 +67,6 @@ using namespace clang; using namespace hlsl; using std::string; -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcLangExtensions) -DEFINE_CROSS_PLATFORM_UUIDOF(IDxcLangExtensions2) - // This declaration is used for the locally-linked validator. HRESULT CreateDxcValidator(_In_ REFIID riid, _Out_ LPVOID *ppv);