123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694 |
- #ifndef __DXC_API__
- #define __DXC_API__
- #ifdef _WIN32
- #ifndef DXC_API_IMPORT
- #define DXC_API_IMPORT __declspec(dllimport)
- #endif
- #else
- #ifndef DXC_API_IMPORT
- #define DXC_API_IMPORT __attribute__ ((visibility ("default")))
- #endif
- #endif
- #ifdef _WIN32
- #define DECLARE_CROSS_PLATFORM_UUIDOF(T)
- #define DEFINE_CROSS_PLATFORM_UUIDOF(T)
- #else
- #include <dlfcn.h>
- #include "dxc/Support/WinAdapter.h"
- #endif
- struct IMalloc;
- struct IDxcIncludeHandler;
- typedef HRESULT (__stdcall *DxcCreateInstanceProc)(
- _In_ REFCLSID rclsid,
- _In_ REFIID riid,
- _Out_ LPVOID* ppv
- );
- typedef HRESULT(__stdcall *DxcCreateInstance2Proc)(
- _In_ IMalloc *pMalloc,
- _In_ REFCLSID rclsid,
- _In_ REFIID riid,
- _Out_ LPVOID* ppv
- );
- extern "C"
- DXC_API_IMPORT HRESULT __stdcall DxcCreateInstance(
- _In_ REFCLSID rclsid,
- _In_ REFIID riid,
- _Out_ LPVOID* ppv
- );
- extern "C"
- DXC_API_IMPORT HRESULT __stdcall DxcCreateInstance2(
- _In_ IMalloc *pMalloc,
- _In_ REFCLSID rclsid,
- _In_ REFIID riid,
- _Out_ LPVOID* ppv
- );
- #define DXC_CP_UTF8 65001
- #define DXC_CP_UTF16 1200
- #define DXC_CP_ACP 0
- #define DXC_HASHFLAG_INCLUDES_SOURCE 1
- typedef struct DxcShaderHash {
- UINT32 Flags;
- BYTE HashDigest[16];
- } DxcShaderHash;
- #define DXC_FOURCC(ch0, ch1, ch2, ch3) ( \
- (UINT32)(UINT8)(ch0) | (UINT32)(UINT8)(ch1) << 8 | \
- (UINT32)(UINT8)(ch2) << 16 | (UINT32)(UINT8)(ch3) << 24 \
- )
- #define DXC_PART_PDB DXC_FOURCC('I', 'L', 'D', 'B')
- #define DXC_PART_PDB_NAME DXC_FOURCC('I', 'L', 'D', 'N')
- #define DXC_PART_PRIVATE_DATA DXC_FOURCC('P', 'R', 'I', 'V')
- #define DXC_PART_ROOT_SIGNATURE DXC_FOURCC('R', 'T', 'S', '0')
- #define DXC_PART_DXIL DXC_FOURCC('D', 'X', 'I', 'L')
- #define DXC_PART_REFLECTION_DATA DXC_FOURCC('S', 'T', 'A', 'T')
- #define DXC_PART_SHADER_HASH DXC_FOURCC('H', 'A', 'S', 'H')
- #define DXC_PART_INPUT_SIGNATURE DXC_FOURCC('I', 'S', 'G', '1')
- #define DXC_PART_OUTPUT_SIGNATURE DXC_FOURCC('O', 'S', 'G', '1')
- #define DXC_PART_PATCH_CONSTANT_SIGNATURE DXC_FOURCC('P', 'S', 'G', '1')
- #define DXC_ARG_DEBUG L"-Zi"
- #define DXC_ARG_SKIP_VALIDATION L"-Vd"
- #define DXC_ARG_SKIP_OPTIMIZATIONS L"-Od"
- #define DXC_ARG_PACK_MATRIX_ROW_MAJOR L"-Zpr"
- #define DXC_ARG_PACK_MATRIX_COLUMN_MAJOR L"-Zpc"
- #define DXC_ARG_AVOID_FLOW_CONTROL L"-Gfa"
- #define DXC_ARG_PREFER_FLOW_CONTROL L"-Gfp"
- #define DXC_ARG_ENABLE_STRICTNESS L"-Ges"
- #define DXC_ARG_ENABLE_BACKWARDS_COMPATIBILITY L"-Gec"
- #define DXC_ARG_IEEE_STRICTNESS L"-Gis"
- #define DXC_ARG_OPTIMIZATION_LEVEL0 L"-O0"
- #define DXC_ARG_OPTIMIZATION_LEVEL1 L"-O1"
- #define DXC_ARG_OPTIMIZATION_LEVEL2 L"-O2"
- #define DXC_ARG_OPTIMIZATION_LEVEL3 L"-O3"
- #define DXC_ARG_WARNINGS_ARE_ERRORS L"-WX"
- #define DXC_ARG_RESOURCES_MAY_ALIAS L"-res_may_alias"
- #define DXC_ARG_ALL_RESOURCES_BOUND L"-all_resources_bound"
- #define DXC_ARG_DEBUG_NAME_FOR_SOURCE L"-Zss"
- #define DXC_ARG_DEBUG_NAME_FOR_BINARY L"-Zsb"
- struct __declspec(uuid("8BA5FB08-5195-40e2-AC58-0D989C3A0102"))
- 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 {
- public:
- virtual HRESULT STDMETHODCALLTYPE GetEncoding(_Out_ BOOL *pKnown,
- _Out_ UINT32 *pCodePage) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcBlobEncoding)
- };
- struct __declspec(uuid("A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84"))
- 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 {
- 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 {
- 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)
- };
- typedef struct DxcBuffer {
- LPCVOID Ptr;
- SIZE_T Size;
- UINT Encoding;
- } DxcText;
- struct DxcDefine {
- LPCWSTR Name;
- _Maybenull_ LPCWSTR Value;
- };
- struct __declspec(uuid("73EFFE2A-70DC-45F8-9690-EFF64C02429D"))
- IDxcCompilerArgs : public IUnknown {
-
- virtual LPCWSTR* STDMETHODCALLTYPE GetArguments() = 0;
- virtual UINT32 STDMETHODCALLTYPE GetCount() = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddArguments(
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount
- ) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddArgumentsUTF8(
- _In_opt_count_(argCount)LPCSTR *pArguments,
- _In_ UINT32 argCount
- ) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddDefines(
- _In_count_(defineCount) const DxcDefine *pDefines,
- _In_ UINT32 defineCount
- ) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompilerArgs)
- };
- struct __declspec(uuid("e5204dc7-d18c-4c3c-bdfb-851673980fe7"))
- 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;
- virtual HRESULT STDMETHODCALLTYPE CreateBlobFromFile(
- _In_z_ LPCWSTR pFileName, _In_opt_ UINT32* codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateBlobWithEncodingFromPinned(
- _In_bytecount_(size) LPCVOID pText, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateBlobWithEncodingOnHeapCopy(
- _In_bytecount_(size) LPCVOID pText, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateBlobWithEncodingOnMalloc(
- _In_bytecount_(size) LPCVOID pText, IMalloc *pIMalloc, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateIncludeHandler(
- _COM_Outptr_ IDxcIncludeHandler **ppResult) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateStreamFromBlobReadOnly(
- _In_ IDxcBlob *pBlob, _COM_Outptr_ IStream **ppStream) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetBlobAsUtf8(
- _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)
- };
- struct __declspec(uuid("CEDB484A-D4E9-445A-B991-CA21CA157DC2"))
- IDxcOperationResult : public IUnknown {
- virtual HRESULT STDMETHODCALLTYPE GetStatus(_Out_ HRESULT *pStatus) = 0;
-
-
-
-
-
-
- virtual HRESULT STDMETHODCALLTYPE GetResult(_COM_Outptr_result_maybenull_ IDxcBlob **ppResult) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetErrorBuffer(_COM_Outptr_result_maybenull_ IDxcBlobEncoding **ppErrors) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcOperationResult)
- };
- struct __declspec(uuid("8c210bf3-011f-4422-8d70-6f9acb8db617"))
- IDxcCompiler : public IUnknown {
-
- virtual HRESULT STDMETHODCALLTYPE Compile(
- _In_ IDxcBlob *pSource, // Source text to compile
- _In_opt_z_ LPCWSTR pSourceName, // Optional file name for pSource. Used in errors and include handlers.
- _In_opt_z_ LPCWSTR pEntryPoint, // entry point name
- _In_z_ LPCWSTR pTargetProfile, // shader profile to compile
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _In_count_(defineCount)
- const DxcDefine *pDefines,
- _In_ UINT32 defineCount,
- _In_opt_ IDxcIncludeHandler *pIncludeHandler,
- _COM_Outptr_ IDxcOperationResult **ppResult
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Preprocess(
- _In_ IDxcBlob *pSource, // Source text to preprocess
- _In_opt_z_ LPCWSTR pSourceName, // Optional file name for pSource. Used in errors and include handlers.
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _In_count_(defineCount)
- const DxcDefine *pDefines,
- _In_ UINT32 defineCount,
- _In_opt_ IDxcIncludeHandler *pIncludeHandler,
- _COM_Outptr_ IDxcOperationResult **ppResult
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Disassemble(
- _In_ IDxcBlob *pSource, // Program to disassemble.
- _COM_Outptr_ IDxcBlobEncoding **ppDisassembly // Disassembly text.
- ) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompiler)
- };
- struct __declspec(uuid("A005A9D9-B8BB-4594-B5C9-0E633BEC4D37"))
- IDxcCompiler2 : public IDxcCompiler {
-
- virtual HRESULT STDMETHODCALLTYPE CompileWithDebug(
- _In_ IDxcBlob *pSource, // Source text to compile
- _In_opt_z_ LPCWSTR pSourceName, // Optional file name for pSource. Used in errors and include handlers.
- _In_opt_z_ LPCWSTR pEntryPoint, // Entry point name
- _In_z_ LPCWSTR pTargetProfile, // Shader profile to compile
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _In_count_(defineCount)
- const DxcDefine *pDefines,
- _In_ UINT32 defineCount,
- _In_opt_ IDxcIncludeHandler *pIncludeHandler,
- _COM_Outptr_ IDxcOperationResult **ppResult,
- _Outptr_opt_result_z_ LPWSTR *ppDebugBlobName,
- _COM_Outptr_opt_ IDxcBlob **ppDebugBlob
- ) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcCompiler2)
- };
- struct __declspec(uuid("F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6"))
- IDxcLinker : public IUnknown {
- public:
-
- virtual HRESULT RegisterLibrary(
- _In_opt_ LPCWSTR pLibName, // Name of the library.
- _In_ IDxcBlob *pLib // Library blob.
- ) = 0;
-
-
- virtual HRESULT STDMETHODCALLTYPE Link(
- _In_opt_ LPCWSTR pEntryName, // Entry point name
- _In_ LPCWSTR pTargetProfile, // shader profile to link
- _In_count_(libCount)
- const LPCWSTR *pLibNames,
- _In_ UINT32 libCount,
- _In_opt_count_(argCount) const LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _COM_Outptr_
- IDxcOperationResult **ppResult
- ) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcLinker)
- };
- struct __declspec(uuid("4605C4CB-2019-492A-ADA4-65F20BB7D67F"))
- IDxcUtils : public IUnknown {
-
- virtual HRESULT STDMETHODCALLTYPE CreateBlobFromBlob(
- _In_ IDxcBlob *pBlob, UINT32 offset, UINT32 length, _COM_Outptr_ IDxcBlob **ppResult) = 0;
-
-
-
-
- virtual HRESULT STDMETHODCALLTYPE CreateBlobFromPinned(
- _In_bytecount_(size) LPCVOID pData, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
-
-
- virtual HRESULT STDMETHODCALLTYPE MoveToBlob(
- _In_bytecount_(size) LPCVOID pData, IMalloc *pIMalloc, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
-
-
-
-
- virtual HRESULT STDMETHODCALLTYPE CreateBlob(
- _In_bytecount_(size) LPCVOID pData, UINT32 size, UINT32 codePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE LoadFile(
- _In_z_ LPCWSTR pFileName, _In_opt_ UINT32* pCodePage,
- _COM_Outptr_ IDxcBlobEncoding **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateReadOnlyStreamFromBlob(
- _In_ IDxcBlob *pBlob, _COM_Outptr_ IStream **ppStream) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateDefaultIncludeHandler(
- _COM_Outptr_ IDxcIncludeHandler **ppResult) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetBlobAsUtf8(
- _In_ IDxcBlob *pBlob, _COM_Outptr_ IDxcBlobUtf8 **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetBlobAsUtf16(
- _In_ IDxcBlob *pBlob, _COM_Outptr_ IDxcBlobUtf16 **pBlobEncoding) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetDxilContainerPart(
- _In_ const DxcBuffer *pShader,
- _In_ UINT32 DxcPart,
- _Outptr_result_nullonfailure_ void **ppPartData,
- _Out_ UINT32 *pPartSizeInBytes) = 0;
-
-
- virtual HRESULT STDMETHODCALLTYPE CreateReflection(
- _In_ const DxcBuffer *pData, REFIID iid, void **ppvReflection) = 0;
- virtual HRESULT STDMETHODCALLTYPE BuildArguments(
- _In_opt_z_ LPCWSTR pSourceName, // Optional file name for pSource. Used in errors and include handlers.
- _In_opt_z_ LPCWSTR pEntryPoint, // Entry point name. (-E)
- _In_z_ LPCWSTR pTargetProfile,
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _In_count_(defineCount)
- const DxcDefine *pDefines,
- _In_ UINT32 defineCount,
- _COM_Outptr_ IDxcCompilerArgs **ppArgs
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetPDBContents(
- _In_ IDxcBlob *pPDBBlob, _COM_Outptr_ IDxcBlob **ppHash, _COM_Outptr_ IDxcBlob **ppContainer) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcUtils)
- };
- typedef enum DXC_OUT_KIND {
- DXC_OUT_NONE = 0,
- DXC_OUT_OBJECT = 1,
- DXC_OUT_ERRORS = 2,
- DXC_OUT_PDB = 3,
- DXC_OUT_SHADER_HASH = 4,
- DXC_OUT_DISASSEMBLY = 5,
- DXC_OUT_HLSL = 6,
- DXC_OUT_TEXT = 7,
- DXC_OUT_REFLECTION = 8,
- DXC_OUT_ROOT_SIGNATURE = 9,
- DXC_OUT_EXTRA_OUTPUTS = 10,
- DXC_OUT_FORCE_DWORD = 0xFFFFFFFF
- } DXC_OUT_KIND;
- struct __declspec(uuid("58346CDA-DDE7-4497-9461-6F87AF5E0659"))
- 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,
- _COM_Outptr_ IDxcBlobUtf16 **ppOutputName) = 0;
- virtual UINT32 GetNumOutputs() = 0;
- virtual DXC_OUT_KIND GetOutputByIndex(UINT32 Index) = 0;
- virtual DXC_OUT_KIND PrimaryOutput() = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcResult)
- };
- #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 {
- 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 {
-
-
-
-
- virtual HRESULT STDMETHODCALLTYPE Compile(
- _In_ const DxcBuffer *pSource, // Source text to compile
- _In_opt_count_(argCount) LPCWSTR *pArguments,
- _In_ UINT32 argCount,
- _In_opt_ IDxcIncludeHandler *pIncludeHandler,
- _In_ REFIID riid, _Out_ LPVOID *ppResult
- ) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Disassemble(
- _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;
- static const UINT32 DxcValidatorFlags_InPlaceEdit = 1;
- 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 {
-
- 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 {
- virtual HRESULT STDMETHODCALLTYPE Load(_In_ IDxcBlob *pDxilContainerHeader) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddPart(_In_ UINT32 fourCC, _In_ IDxcBlob *pSource) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemovePart(_In_ UINT32 fourCC) = 0;
- virtual HRESULT STDMETHODCALLTYPE SerializeContainer(_Out_ IDxcOperationResult **ppResult) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcContainerBuilder)
- };
- struct __declspec(uuid("091f7a26-1c1f-4948-904b-e6e3a8a771d5"))
- IDxcAssembler : public IUnknown {
-
- 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 {
- virtual HRESULT STDMETHODCALLTYPE Load(_In_ IDxcBlob *pContainer) = 0;
- 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 {
- 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 {
- 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;
- static const UINT32 DxcVersionInfoFlags_Internal = 2;
- struct __declspec(uuid("b04f5b50-2059-4f12-a8ff-a1e0cde1cc7e"))
- 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 {
- virtual HRESULT STDMETHODCALLTYPE GetCommitInfo(_Out_ UINT32 *pCommitCount, _Out_ char **pCommitHash) = 0;
- DECLARE_CROSS_PLATFORM_UUIDOF(IDxcVersionInfo2)
- };
- #ifdef _MSC_VER
- #define CLSID_SCOPE __declspec(selectany) extern
- #else
- #define CLSID_SCOPE
- #endif
- CLSID_SCOPE const CLSID CLSID_DxcCompiler = {
- 0x73e22d93,
- 0xe6ce,
- 0x47f3,
- {0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0}};
- CLSID_SCOPE const GUID CLSID_DxcLinker = {
- 0xef6a8087,
- 0xb0ea,
- 0x4d56,
- {0x9e, 0x45, 0xd0, 0x7e, 0x1a, 0x8b, 0x78, 0x6}};
- CLSID_SCOPE const CLSID CLSID_DxcDiaDataSource = {
- 0xcd1f6b73,
- 0x2ab0,
- 0x484d,
- {0x8e, 0xdc, 0xeb, 0xe7, 0xa4, 0x3c, 0xa0, 0x9f}};
- CLSID_SCOPE const CLSID CLSID_DxcCompilerArgs = {
- 0x3e56ae82,
- 0x224d,
- 0x470f,
- {0xa1, 0xa1, 0xfe, 0x30, 0x16, 0xee, 0x9f, 0x9d}};
- CLSID_SCOPE const GUID CLSID_DxcLibrary = {
- 0x6245d6af,
- 0x66e0,
- 0x48fd,
- {0x80, 0xb4, 0x4d, 0x27, 0x17, 0x96, 0x74, 0x8c}};
- CLSID_SCOPE const GUID CLSID_DxcUtils = CLSID_DxcLibrary;
- CLSID_SCOPE const GUID CLSID_DxcValidator = {
- 0x8ca3e215,
- 0xf728,
- 0x4cf3,
- {0x8c, 0xdd, 0x88, 0xaf, 0x91, 0x75, 0x87, 0xa1}};
- CLSID_SCOPE const GUID CLSID_DxcAssembler = {
- 0xd728db68,
- 0xf903,
- 0x4f80,
- {0x94, 0xcd, 0xdc, 0xcf, 0x76, 0xec, 0x71, 0x51}};
- CLSID_SCOPE const GUID CLSID_DxcContainerReflection = {
- 0xb9f54489,
- 0x55b8,
- 0x400c,
- {0xba, 0x3a, 0x16, 0x75, 0xe4, 0x72, 0x8b, 0x91}};
- CLSID_SCOPE const GUID CLSID_DxcOptimizer = {
- 0xae2cd79f,
- 0xcc22,
- 0x453f,
- {0x9b, 0x6b, 0xb1, 0x24, 0xe7, 0xa5, 0x20, 0x4c}};
- CLSID_SCOPE const GUID CLSID_DxcContainerBuilder = {
- 0x94134294,
- 0x411f,
- 0x4574,
- {0xb4, 0xd0, 0x87, 0x41, 0xe2, 0x52, 0x40, 0xd2}};
- #endif
|