From d0ef6d2a9b7a160531579c7460a417b790c90bcc Mon Sep 17 00:00:00 2001 From: AbdelHameed-Hamed Date: Thu, 31 Aug 2023 11:50:29 +0200 Subject: [PATCH 1/2] Add unix bindings for DXC. --- vendor/directx/dxc/dxcapi_unix.odin | 626 ++++++++++++++++++ .../dxc/{dxcapi.odin => dxcapi_windows.odin} | 1 + 2 files changed, 627 insertions(+) create mode 100644 vendor/directx/dxc/dxcapi_unix.odin rename vendor/directx/dxc/{dxcapi.odin => dxcapi_windows.odin} (99%) diff --git a/vendor/directx/dxc/dxcapi_unix.odin b/vendor/directx/dxc/dxcapi_unix.odin new file mode 100644 index 000000000..d92eaccd7 --- /dev/null +++ b/vendor/directx/dxc/dxcapi_unix.odin @@ -0,0 +1,626 @@ +//+build linux, darwin +package directx_dxc +import "core:c" + +foreign import dxcompiler "system:dxcompiler" + +FILETIME :: struct { + dwLowDateTime: DWORD, + dwHighDateTime: DWORD, +} + +GUID :: struct { + Data1: DWORD, + Data2: WORD, + Data3: WORD, + Data4: [8]BYTE, +} + +BYTE :: distinct u8 +WORD :: u16 +DWORD :: u32 +BOOL :: distinct b32 +SIZE_T :: uint +ULONG :: c.ulong +CLSID :: GUID +IID :: GUID +LONG :: distinct c.long +HRESULT :: distinct LONG +wstring :: [^]c.wchar_t +BSTR :: wstring + +IUnknown :: struct { + using _iunknown_vtable: ^IUnknown_VTable, +} +IUnknown_VTable :: struct { + QueryInterface: proc "c" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT, + AddRef: proc "c" (this: ^IUnknown) -> ULONG, + Release: proc "c" (this: ^IUnknown) -> ULONG, +} + +@(default_calling_convention="c", link_prefix="Dxc") +foreign dxcompiler { + CreateInstance :: proc (rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT --- + CreateInstance2 :: proc (pMalloc: ^IMalloc, rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT --- +} + +pCreateInstanceProc :: #type proc "c" (rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT +pCreateInstance2Proc :: #type proc "c" (pMalloc: ^IMalloc, rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT + +CreateInstance_ProcName :: "DxcCreateInstance" +CreateInstance2_ProcName :: "DxcCreateInstance2" + +IMalloc :: struct #raw_union { + #subtype iunknown: IUnknown, + using imalloc_vtable: ^IMalloc_VTable, +} +IMalloc_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Alloc: proc "c" (this: ^IMalloc, cb: SIZE_T) -> rawptr, + Realloc: proc "c" (this: ^IMalloc, pv: rawptr, cb: SIZE_T) -> rawptr, + Free: proc "c" (this: ^IMalloc, pv: rawptr), + GetSize: proc "c" (this: ^IMalloc, pv: rawptr) -> SIZE_T, + DidAlloc: proc "c" (this: ^IMalloc, pv: rawptr) -> i32, + HeapMinimize: proc "c" (this: ^IMalloc), +} + +ISequentialStream :: struct #raw_union { + #subtype iunknown: IUnknown, + using isequentialstream_vtable: ^ISequentialStream_VTable, +} +ISequentialStream_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Read: proc "c" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, + Write: proc "c" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, +} + +STATSTG :: struct { + pwcsName: wstring, + type: u32, + cbSize: u64, + mtime: FILETIME, + ctime: FILETIME, + atime: FILETIME, + grfMode: u32, + grfLocksSupported: u32, + clsid: CLSID, + grfStateBits: u32, + reserved: u32, +} + +IStream :: struct #raw_union { + #subtype isequentialstream: ISequentialStream, + using istream_vtable: ^IStream_VTable, +} +IStream_VTable :: struct { + using isequentialstream_vtable: ISequentialStream_VTable, + Seek: proc "c" (this: ^IStream, dlibMove: i64, dwOrigin: u32, plibNewPosition: ^u64) -> HRESULT, + SetSize: proc "c" (this: ^IStream, libNewSize: u64) -> HRESULT, + CopyTo: proc "c" (this: ^IStream, pstm: ^IStream, cb: u64, pcbRead: ^u64, pcbWritten: ^u64) -> HRESULT, + Commit: proc "c" (this: ^IStream, grfCommitFlags: u32) -> HRESULT, + Revert: proc "c" (this: ^IStream) -> HRESULT, + LockRegion: proc "c" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, + UnlockRegion: proc "c" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, + Stat: proc "c" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: u32) -> HRESULT, + Clone: proc "c" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, +} + +IBlob_UUID_STRING :: "8BA5FB08-5195-40E2-AC58-0D989C3A0102" +IBlob_UUID := &IID{0x8BA5FB08, 0x5195, 0x40E2, {0xAC, 0x58, 0x0D, 0x98, 0x9C, 0x3A, 0x01, 0x02}} +IBlob :: struct #raw_union { + #subtype iunknown: IUnknown, + using id3d10blob_vtable: ^IBlob_VTable, +} +IBlob_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetBufferPointer: proc "c" (this: ^IBlob) -> rawptr, + GetBufferSize: proc "c" (this: ^IBlob) -> SIZE_T, +} + +IBlobEncoding_UUID_STRRING :: "7241D424-2646-4191-97C0-98E96E42FC68" +IBlobEncoding_UUID := &IID{0x7241D424, 0x2646, 0x4191, {0x97, 0xC0, 0x98, 0xE9, 0x6E, 0x42, 0xFC, 0x68}} +IBlobEncoding :: struct #raw_union { + #subtype idxcblob: IBlob, + using idxcblobencoding_vtable: ^IBlobEncoding_VTable, +} +IBlobEncoding_VTable :: struct { + using idxcblob_vtable: IBlob_VTable, + GetEncoding: proc "c" (this: ^IBlobEncoding, pKnown: ^BOOL, pCodePage: ^u32) -> HRESULT, +} + +IBlobUtf16_UUID_STRING :: "A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84" +IBlobUtf16_UUID := &IID{0xA3F84EAB, 0x0FAA, 0x497E, {0xA3, 0x9C, 0xEE, 0x6E, 0xD6, 0x0B, 0x2D, 0x84}} +IBlobUtf16 :: struct #raw_union { + #subtype idxcblobencoding: IBlobEncoding, + using idxcblobutf16_vtable : ^IBlobUtf16_VTable, +} +IBlobUtf16_VTable :: struct { + using idxcblobencoding_vtable: IBlobEncoding_VTable, + GetStringPointer: proc "c" (this: ^IBlobUtf16) -> wstring, + GetStringLength: proc "c" (this: ^IBlobUtf16) -> SIZE_T, +} + +IBlobUtf8_UUID_STRING :: "3DA636C9-BA71-4024-A301-30CBF125305B" +IBlobUtf8_UUID := &IID{0x3DA636C9, 0xBA71, 0x4024, {0xA3, 0x01, 0x30, 0xCB, 0xF1, 0x25, 0x30, 0x5B}} +IBlobUtf8 :: struct #raw_union { + #subtype idxcblobencoding: IBlobEncoding, + using idxcblobutf8_vtable : ^IBlobUtf8_VTable, +} +IBlobUtf8_VTable :: struct { + using idxcblobencoding_vtable: IBlobEncoding_VTable, + GetStringPointer: proc "c" (this: ^IBlobUtf8) -> cstring, + GetStringLength: proc "c" (this: ^IBlobUtf8) -> SIZE_T, +} + +IIncludeHandler_UUID_STRING :: "7F61FC7D-950D-467F-B3E3-3C02FB49187C" +IIncludeHandler_UUID := &IID{0x7F61FC7D, 0x950D, 0x467F, {0xB3, 0xE3, 0x3C, 0x02, 0xFB, 0x49, 0x18, 0x7C}} +IIncludeHandler :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcincludehandler_vtable: ^IIncludeHandler_VTable, +} +IIncludeHandler_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + LoadSource: proc "c" (this: ^IIncludeHandler, pFilename: wstring, ppIncludeSource: ^^IBlob) -> HRESULT, +} + +Define :: struct { + Name: wstring, + Value: wstring, +} + +ICompilerArgs_UUID_STRING :: "73EFFE2A-70DC-45F8-9690-EFF64C02429D" +ICompilerArgs_UUID := &IID{0x73EFFE2A, 0x70DC, 0x45F8, {0x96, 0x90, 0xEF, 0xF6, 0x4C, 0x02, 0x42, 0x9D}} +ICompilerArgs :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxccompilerargs_vtable: ^ICompilerArgs_VTable, +} +ICompilerArgs_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetArguments: proc "c" (this: ^ICompilerArgs) -> [^]wstring, + GetCount: proc "c" (this: ^ICompilerArgs) -> u32, + AddArguments: proc "c" (this: ^ICompilerArgs, pArguments: [^]wstring, argCount: u32) -> HRESULT, + AddArgumentsUTF8: proc "c" (this: ^ICompilerArgs, pArguments: [^]cstring, argCount: u32) -> HRESULT, + AddDefines: proc "c" (this: ^ICompilerArgs, pDefines: [^]Define, defineCount: u32) -> HRESULT, +} + +ILibrary_UUID_STRING :: "E5204DC7-D18C-4C3C-BDFB-851673980FE7" +ILibrary_UUID := &IID{0xE5204DC7, 0xD18C, 0x4C3C, {0xBD, 0xFB, 0x85, 0x16, 0x73, 0x98, 0x0F, 0xE7}} +ILibrary :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxclibrary_vtable: ^ILibrary_VTable, +} +ILibrary_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + SetMalloc: proc "c" (this: ^ILibrary, pMalloc: ^IMalloc) -> HRESULT, + CreateBlobFromBlob: proc "c" (this: ^ILibrary, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, + CreateBlobFromFile: proc "c" (this: ^ILibrary, pFileName: wstring, codePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingFromPinned: proc "c" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingOnHeapCopy: proc "c" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingOnMalloc: proc "c" (this: ^ILibrary, pText: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateIncludeHandler: proc "c" (this: ^ILibrary, ppResult: ^^IIncludeHandler) -> HRESULT, + CreateStreamFromBlobReadOnly: proc "c" (this: ^ILibrary, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, + GetBlobAsUtf8: proc "c" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + GetBlobAsUtf16: proc "c" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, +} + +IOperationResult_UUID_STRING :: "CEDB484A-D4E9-445A-B991-CA21CA157DC2" +IOperationResult_UUID := &IID{0xCEDB484A, 0xD4E9, 0x445A, {0xB9, 0x91, 0xCA, 0x21, 0xCA, 0x15, 0x7D, 0xC2}} +IOperationResult :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcoperationresult_vtable: ^IOperationResult_VTable, +} +IOperationResult_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetStatus: proc "c" (this: ^IOperationResult, pStatus: ^HRESULT) -> HRESULT, + GetResult: proc "c" (this: ^IOperationResult, ppResult: ^^IBlob) -> HRESULT, + GetErrorBuffer: proc "c" (this: ^IOperationResult, ppErrors: ^^IBlobEncoding) -> HRESULT, +} + +ICompiler_UUID_STRING :: "8C210BF3-011F-4422-8D70-6F9ACB8DB617" +ICompiler_UUID := &IID{0x8C210BF3, 0x011F, 0x4422, {0x8D, 0x70, 0x6F, 0x9A, 0xCB, 0x8D, 0xB6, 0x17}} +ICompiler :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxccompiler_vtable: ^ICompiler_VTable, +} +ICompiler_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Compile: proc "c" ( + this: ^ICompiler, + pSource: ^Buffer, + pSourceName: wstring, + pEntryPoint: wstring, + pTargetProfile: wstring, + pArguments: [^]wstring, + argCount: u32, + pDefines: [^]Define, + defineCount: u32, + pIncludeHandler: ^IIncludeHandler, + ppResult: ^^IOperationResult) -> HRESULT, + Preprocess: proc "c" ( + this: ^ICompiler, + pSource: ^Buffer, + pSourceName: wstring, + pArguments: [^]wstring, + argCount: u32, + pDefines: [^]Define, + defineCount: u32, + pIncludeHandler: ^IIncludeHandler, + ppResult: ^^IOperationResult) -> HRESULT, + Disassemble: proc "c" (this: ^ICompiler, pSource: ^Buffer, ppDisassembly: ^IBlobEncoding) -> HRESULT, +} + +ICompiler2_UUID_STRING :: "A005A9D9-B8BB-4594-B5C9-0E633BEC4D37" +ICompiler2_UUID := &IID{0xA005A9D9, 0xB8BB, 0x4594, {0xB5, 0xC9, 0x0E, 0x63, 0x3B, 0xEC, 0x4D, 0x37}} +ICompiler2 :: struct #raw_union { + #subtype icompiler: ICompiler, + using idxccompiler2_vtable: ^ICompiler2_VTable, +} +ICompiler2_VTable :: struct { + using idxccompiler_vtable: ^ICompiler_VTable, + CompileWithDebug: proc "c" ( + this: ^ICompiler2, + pSource: ^Buffer, + pSourceName: wstring, + pEntryPoint: wstring, + pTargetProfile: wstring, + pArguments: [^]wstring, + argCount: u32, + pDefines: [^]Define, + defineCount: u32, + pIncludeHandler: ^IIncludeHandler, + ppResult: ^^IOperationResult, + ppDebugBlobName: ^wstring, + ppDebugBlob: ^^IBlob) -> HRESULT, +} + +ILinker_UUID_STRING :: "F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6" +ILinker_UUID := &IID{0xF1B5BE2A, 0x62DD, 0x4327, {0xA1, 0xC2, 0x42, 0xAC, 0x1E, 0x1E, 0x78, 0xE6}} +ILinker :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxclinker_vtable: ^ILinker_VTable, +} +ILinker_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + RegisterLibrary: proc "c" (this: ^ILinker, pLibName: ^IBlob) -> HRESULT, + Link: proc "c" ( + this: ^ILinker, + pEntryName: wstring, + pTargetProfile: wstring, + pLibNames: [^]wstring, + libCount: u32, + pArguments: [^]wstring, + argCount: u32, + ppResult: ^^IOperationResult) -> HRESULT, +} + +Buffer :: struct { + Ptr: rawptr, + Size: SIZE_T, + Encoding: u32, +} + +IUtils_UUID_STRING :: "4605C4CB-2019-492A-ADA4-65F20BB7D67F" +IUtils_UUID := &IID{0x4605C4CB, 0x2019, 0x492A, {0xAD, 0xA4, 0x65, 0xF2, 0x0B, 0xB7, 0xD6, 0x7F}} +IUtils :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcutils_vtable: ^IUtils_VTable, +} +IUtils_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + CreateBlobFromBlob: proc "c" (this: ^IUtils, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, + CreateBlobFromPinned: proc "c" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + MoveToBlob: proc "c" (this: ^IUtils, pData: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlob: proc "c" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + LoadFile: proc "c" (this: ^IUtils, pFileName: wstring, pCodePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateReadOnlyStreamFromBlob: proc "c" (this: ^IUtils, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, + CreateDefaultIncludeHandler: proc "c" (this: ^IUtils, ppResult: ^^IIncludeHandler) -> HRESULT, + GetBlobAsUtf8: proc "c" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf8) -> HRESULT, + GetBlobAsUtf16: proc "c" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf16) -> HRESULT, + GetDxilContainerPart: proc "c" (this: ^IUtils, pShader: ^Buffer, Part: u32, ppPartData: rawptr, pPartSizeInBytes: ^u32) -> HRESULT, + CreateReflection: proc "c" (this: ^IUtils, pData: ^Buffer, iid: ^IID, ppvReflection: rawptr) -> HRESULT, + BuildArguments: proc "c" (this: ^IUtils, pSourceName: wstring, pEntryPoint: wstring, pTargetProfile: wstring, pArguments: [^]wstring, argCount: u32, pDefines: [^]Define, defineCount: u32, ppArgs: ^[^]ICompilerArgs) -> HRESULT, + GetPDBContents: proc "c" (this: ^IUtils, pPDBBlob: ^IBlob, ppHash: ^^IBlob, ppContainer: ^^IBlob) -> HRESULT, +} + +DXC_OUT_KIND :: enum u32 { + NONE = 0, + OBJECT = 1, + ERRORS = 2, + PDB = 3, + SHADER_HASH = 4, + DISASSEMBLY = 5, + HLSL = 6, + TEXT = 7, + REFLECTION = 8, + ROOT_SIGNATURE = 9, + EXTRA_OUTPUTS = 10, + FORCE_DWORD = 0xFFFFFFFF, +} + +IResult_UUID_STRING :: "58346CDA-DDE7-4497-9461-6F87AF5E0659" +IResult_UUID := &IID{0x58346CDA, 0xDDE7, 0x4497, {0x94, 0x61, 0x6F, 0x87, 0xAF, 0x5E, 0x06, 0x59}} +IResult :: struct #raw_union { + #subtype idxcoperationresult: IOperationResult, + using idxcresult_vtable: ^IResult_VTable, +} +IResult_VTable :: struct { + using idxcoperationresult_vtable: IOperationResult_VTable, + HasOutput: proc "c" (this: ^IResult, dxcOutKind: DXC_OUT_KIND) -> BOOL, + GetOutput: proc "c" (this: ^IResult, dxcOutKind: DXC_OUT_KIND, iid: ^IID, ppvObject: rawptr, ppOutputName: ^^IBlobUtf16) -> HRESULT, + GetNumOutputs: proc "c" (this: ^IResult) -> u32, + GetOutputByIndex: proc "c" (this: ^IResult, Index: u32) -> DXC_OUT_KIND, + PrimaryOutput: proc "c" (this: ^IResult) -> DXC_OUT_KIND, +} + +IExtraOutputs_UUID_STRING :: "319B37A2-A5C2-494A-A5DE-4801B2FAF989" +IExtraOutputs_UUID := &IID{0x319B37A2, 0xA5C2, 0x494A, {0xA5, 0xDE, 0x48, 0x01, 0xB2, 0xFA, 0xF9, 0x89}} +IExtraOutputs :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcextraoutputs_vtable: ^IExtraOutputs_VTable, +} +IExtraOutputs_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetOutputCount: proc "c" (this: ^IExtraOutputs) -> u32, + GetOutput: proc "c" (this: ^IExtraOutputs, uIndex: u32, iid: ^IID, ppvObject: rawptr, ppOutputType: ^^IBlobUtf16, ppOutputName: ^^IBlobUtf16) -> HRESULT, +} + +ICompiler3_UUID_STRING :: "228B4687-5A6A-4730-900C-9702B2203F54" +ICompiler3_UUID := &IID{0x228B4687, 0x5A6A, 0x4730, {0x90, 0x0C, 0x97, 0x02, 0xB2, 0x20, 0x3F, 0x54}} +ICompiler3 :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxccompiler3_vtable: ^ICompiler3_VTable, +} +ICompiler3_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Compile: proc "c" (this: ^ICompiler3, pSource: ^Buffer, pArguments: [^]wstring, argCount: u32, pIncludeHandler: ^IIncludeHandler, riid: ^IID, ppResult: rawptr) -> HRESULT, + Disassemble: proc "c" (this: ^ICompiler3, pObject: ^Buffer, riid: ^IID, ppResult: rawptr) -> HRESULT, +} + +IValidator_UUID_STRING :: "A6E82BD2-1FD7-4826-9811-2857E797F49A" +IValidator_UUID := &IID{0xA6E82BD2, 0x1FD7, 0x4826, {0x98, 0x11, 0x28, 0x57, 0xE7, 0x97, 0xF4, 0x9A}} +IValidator :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcvalidator_vtable: ^IValidator_VTable, +} +IValidator_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Validate: proc "c" (this: ^IValidator, pShader: ^IBlob, Flags: u32, ppResult: ^^IOperationResult) -> HRESULT, +} + +IValidator2_UUID_STRING :: "458E1FD1-B1B2-4750-A6E1-9C10F03BED92" +IValidator2_UUID := &IID{0x458E1FD1, 0xB1B2, 0x4750, {0xA6, 0xE1, 0x9C, 0x10, 0xF0, 0x3B, 0xED, 0x92}} +IValidator2 :: struct #raw_union { + #subtype idxcvalidator: IValidator, + using idxcvalidator2_vtable: ^IValidator2_VTable, +} +IValidator2_VTable :: struct { + using idxcvalidator_vtable: IValidator_VTable, + ValidateWithDebug: proc "c" (this: ^IValidator2, pShader: ^IBlob, Flags: u32, pOptDebugBitcode: ^Buffer, ppResult: ^^IOperationResult) -> HRESULT, +} + +IContainerBuilder_UUID_STRING :: "334B1F50-2292-4B35-99A1-25588D8C17FE" +IContainerBuilder_UUID := &IID{0x334B1F50, 0x2292, 0x4B35, {0x99, 0xA1, 0x25, 0x58, 0x8D, 0x8C, 0x17, 0xFE}} +IContainerBuilder :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxccontainerbuilder_vtable: ^IContainerBuilder_VTable, +} +IContainerBuilder_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Load: proc "c" (this: ^IContainerBuilder, pDxilContainerHeader: ^IBlob) -> HRESULT, + AddPart: proc "c" (this: ^IContainerBuilder, fourCC: u32, pSource: ^IBlob) -> HRESULT, + RemovePart: proc "c" (this: ^IContainerBuilder, fourCC: u32) -> HRESULT, + SerializeContainer: proc "c" (this: ^IContainerBuilder, ppResult: ^^IOperationResult) -> HRESULT, +} + +IAssembler_UUID_STRING :: "091F7A26-1C1F-4948-904B-E6E3A8A771D5" +IAssembler_UUID := &IID{0x091F7A26, 0x1C1F, 0x4948, {0x90, 0x4B, 0xE6, 0xE3, 0xA8, 0xA7, 0x71, 0xD5}} +IAssembler :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcassembler_vtable: ^IAssembler_VTable, +} +IAssembler_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + AssembleToContainer: proc "c" (this: ^IAssembler, pShader: ^IBlob, ppResult: ^^IOperationResult) -> HRESULT, +} + +IContainerReflection_UUID_STRING :: "D2C21B26-8350-4BDC-976A-331CE6F4C54C" +IContainerReflection_UUID := &IID{0xD2C21B26, 0x8350, 0x4BDC, {0x97, 0x6A, 0x33, 0x1C, 0xE6, 0xF4, 0xC5, 0x4C}} +IContainerReflection :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxccontainerreflection_vtable: ^IContainerReflection_VTable, +} +IContainerReflection_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Load: proc "c" (this: ^IContainerReflection, pContainer: ^IBlob) -> HRESULT, + GetPartCount: proc "c" (this: ^IContainerReflection, pResult: ^u32) -> HRESULT, + GetPartKind: proc "c" (this: ^IContainerReflection, idx: u32, pResult: ^u32) -> HRESULT, + GetPartContent: proc "c" (this: ^IContainerReflection, idx: u32, ppResult: ^^IBlob) -> HRESULT, + FindFirstPartKind: proc "c" (this: ^IContainerReflection, kind: u32, pResult: ^u32) -> HRESULT, + GetPartReflection: proc "c" (this: ^IContainerReflection, idx: u32, iid: ^IID, ppvObject: rawptr) -> HRESULT, +} + +IOptimizerPass_UUID_STRING :: "AE2CD79F-CC22-453F-9B6B-B124E7A5204C" +IOptimizerPass_UUID := &IID{0xAE2CD79F, 0xCC22, 0x453F, {0x9B, 0x6B, 0xB1, 0x24, 0xE7, 0xA5, 0x20, 0x4C}} +IOptimizerPass :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcoptimizerpass_vtable: ^IOptimizerPass_VTable, +} +IOptimizerPass_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetOptionName: proc "c" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, + GetDescription: proc "c" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, + GetOptionArgCount: proc "c" (this: ^IOptimizerPass, pCount: ^u32) -> HRESULT, + GetOptionArgName: proc "c" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, + GetOptionArgDescription: proc "c" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, +} + +IOptimizer_UUID_STRING :: "25740E2E-9CBA-401B-9119-4FB42F39F270" +IOptimizer_UUID := &IID{0x25740E2E, 0x9CBA, 0x401B, {0x91, 0x19, 0x4F, 0xB4, 0x2F, 0x39, 0xF2, 0x70}} +IOptimizer :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcoptimizer_vtable: ^IOptimizer_VTable, +} +IOptimizer_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetAvailablePassCount: proc "c" (this: ^IOptimizer, pCount: ^u32) -> HRESULT, + GetAvailablePass: proc "c" (this: ^IOptimizer, index: u32, ppResult: ^^IOptimizerPass) -> HRESULT, + RunOptimizer: proc "c" (this: ^IOptimizer, pBlob: ^IBlob, ppOptions: [^]wstring, optionCount: u32, pOutputModule: ^^IBlob, ppOutputText: ^^IBlobEncoding) -> HRESULT, +} + +VersionInfoFlags :: enum u32 { + None = 0, + Debug = 1, + Internal = 2, +} + +IVersionInfo_UUID_STRING :: "B04F5B50-2059-4F12-A8FF-A1E0CDE1CC7E" +IVersionInfo_UUID := &IID{0xB04F5B50, 0x2059, 0x4F12, {0xA8, 0xFF, 0xA1, 0xE0, 0xCD, 0xE1, 0xCC, 0x7E}} +IVersionInfo :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcversioninfo_vtable: ^IVersionInfo_VTable, +} +IVersionInfo_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetVersion: proc "c" (this: ^IVersionInfo, pMajor: ^u32, pMinor: ^u32) -> HRESULT, + GetFlags: proc "c" (this: ^IVersionInfo, pFlags: ^VersionInfoFlags) -> HRESULT, +} + +IVersionInfo2_UUID_STRING :: "FB6904C4-42F0-4B62-9C46-983AF7DA7C83" +IVersionInfo2_UUID := &IID{0xFB6904C4, 0x42F0, 0x4B62, {0x9C, 0x46, 0x98, 0x3A, 0xF7, 0xDA, 0x7C, 0x83}} +IVersionInfo2 :: struct #raw_union { + #subtype idxcversioninfo: IVersionInfo, + using idxcversioninfo2_vtable: ^IVersionInfo2_VTable, +} +IVersionInfo2_VTable :: struct { + using idxcversioninfo_vtable: IVersionInfo_VTable, + GetCommitInfo: proc "c" (this: ^IVersionInfo2, pCommitCount: ^u32, pCommitHash: ^[^]byte) -> HRESULT, +} + +IVersionInfo3_UUID_STRING :: "5E13E843-9D25-473C-9AD2-03B2D0B44B1E" +IVersionInfo3_UUID := &IID{0x5E13E843, 0x9D25, 0x473C, {0x9A, 0xD2, 0x03, 0xB2, 0xD0, 0xB4, 0x4B, 0x1E}} +IVersionInfo3 :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcversioninfo3_vtable: ^IVersionInfo3_VTable, +} +IVersionInfo3_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + GetCustomVersionString: proc "c" (this: ^IVersionInfo3, pVersionString: ^cstring) -> HRESULT, +} + +ArgPair :: struct { + pName: wstring, + pValue: wstring, +} + +IPdbUtils_UUID_STRING :: "E6C9647E-9D6A-4C3B-B94C-524B5A6C343D" +IPdbUtils_UUID := &IID{0xE6C9647E, 0x9D6A, 0x4C3B, {0xB9, 0x4C, 0x52, 0x4B, 0x5A, 0x6C, 0x34, 0x3D}} +IPdbUtils :: struct #raw_union { + #subtype iunknown: IUnknown, + using idxcpdbutils_vtable: ^IPdbUtils_VTable, +} +IPdbUtils_VTable :: struct { + using iunknown_vtable: IUnknown_VTable, + Load: proc "c" (this: ^IPdbUtils, pPdbOrDxil: ^IBlob) -> HRESULT, + GetSourceCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetSource: proc "c" (this: ^IPdbUtils, uIndex: u32, ppResult: ^^IBlobEncoding) -> HRESULT, + GetSourceName: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetFlagCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetFlag: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetArgCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetArg: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetArgPairCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetArgPair: proc "c" (this: ^IPdbUtils, uIndex: u32, pName: ^BSTR, pValue: ^BSTR) -> HRESULT, + GetDefineCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetDefine: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetTargetProfile: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetEntryPoint: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetMainFileName: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetHash: proc "c" (this: ^IPdbUtils, ppResult: ^^IBlob) -> HRESULT, + GetName: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + IsFullPDB: proc "c" (this: ^IPdbUtils) -> BOOL, + GetFullPDB: proc "c" (this: ^IPdbUtils, ppFullPDB: ^^IBlob) -> HRESULT, + GetVersionInfo: proc "c" (this: ^IPdbUtils, ppVersionInfo: ^^IVersionInfo) -> HRESULT, + SetCompiler: proc "c" (this: ^IPdbUtils, pCompiler: ^ICompiler3) -> HRESULT, + CompileForFullPDB: proc "c" (this: ^IPdbUtils, ppResult: ^^IResult) -> HRESULT, + OverrideArgs: proc "c" (this: ^IPdbUtils, pArgPairs: ^ArgPair, uNumArgPairs: u32) -> HRESULT, + OverrideRootSignature: proc "c" (this: ^IPdbUtils, pRootSignature: wstring) -> HRESULT, +} + + +Compiler_CLSID_STRING :: "73E22D93-E6CE-47F3-B5BF-F0664F39C1B0" +Compiler_CLSID := &CLSID{0x73E22D93, 0xE6CE, 0x47F3, {0xB5, 0xBF, 0xF0, 0x66, 0x4F, 0x39, 0xC1, 0xB0}} + +Linker_CLSID_STRING :: "EF6A8087-B0EA-4D56-9E45-D07E1A8B7806" +Linker_CLSID := &CLSID{0xEF6A8087, 0xB0EA, 0x4D56, {0x9E, 0x45, 0xD0, 0x7E, 0x1A, 0x8B, 0x78, 0x6}} + +DiaDataSource_CLSID_STRING :: "CD1F6B73-2AB0-484D-8EDC-EBE7A43CA09F" +DiaDataSource_CLSID := &CLSID{0xCD1F6B73, 0x2AB0, 0x484D, {0x8E, 0xDC, 0xEB, 0xE7, 0xA4, 0x3C, 0xA0, 0x9F}} + +CompilerArgs_CLSID_STRING :: "3E56AE82-224D-470F-A1A1-FE3016EE9F9D" +CompilerArgs_CLSID := &CLSID{0x3E56AE82, 0x224D, 0x470F, {0xA1, 0xA1, 0xFE, 0x30, 0x16, 0xEE, 0x9F, 0x9D}} + +Library_CLSID_STRING :: "6245D6AF-66E0-48FD-80B4-4D271796748C" +Library_CLSID := &CLSID{0x6245D6AF, 0x66E0, 0x48FD, {0x80, 0xB4, 0x4D, 0x27, 0x17, 0x96, 0x74, 0x8C}} + +Utils_CLSID_STRING :: Library_CLSID_STRING +Utils_CLSID := Library_CLSID + +Validator_CLSID_STRING :: "8CA3E215-F728-4CF3-8CDD-88AF917587A1" +Validator_CLSID := &CLSID{0x8CA3E215, 0xF728, 0x4CF3, {0x8C, 0xDD, 0x88, 0xAF, 0x91, 0x75, 0x87, 0xA1}} + +Assembler_CLSID_STRING :: "D728DB68-F903-4F80-94CD-DCCF76EC7151" +Assembler_CLSID := &CLSID{0xD728DB68, 0xF903, 0x4F80, {0x94, 0xCD, 0xDC, 0xCF, 0x76, 0xEC, 0x71, 0x51}} + +ContainerReflection_CLSID_STRING :: "b9f54489-55b8-400c-ba3a-1675e4728b91" +ContainerReflection_CLSID := &CLSID{0xB9F54489, 0x55B8, 0x400C, {0xBA, 0x3A, 0x16, 0x75, 0xE4, 0x72, 0x8B, 0x91}} + +Optimizer_CLSID_STRING :: "AE2CD79F-CC22-453F-9B6B-B124E7A5204C" +Optimizer_CLSID := &CLSID{0xAE2CD79F, 0xCC22, 0x453F, {0x9B, 0x6B, 0xB1, 0x24, 0xE7, 0xA5, 0x20, 0x4C}} + +ContainerBuilder_CLSID_STRING :: "94134294-411f-4574-b4d0-8741e25240d2" +ContainerBuilder_CLSID := &CLSID{0x94134294, 0x411F, 0x4574, {0xB4, 0xD0, 0x87, 0x41, 0xE2, 0x52, 0x40, 0xD2}} + +PdbUtils_CLSID_STRING :: "54621dfb-f2ce-457e-ae8c-ec355faeec7c" +PdbUtils_CLSID := &CLSID{0x54621DFB, 0xF2CE, 0x457E, {0xAE, 0x8C, 0xEC, 0x35, 0x5F, 0xAE, 0xEC, 0x7C}} + +CP_UTF8 :: 65001 +CP_UTF16 :: 1200 +CP_ACP :: 0 + +make_fourcc :: proc "contextless" (ch0, ch1, ch2, ch3: u32) -> u32 { + return ch0 | (ch1 << 8) | (ch2 << 16) | (ch3 << 24) +} + +PART_PDB :: u32('I') | (u32('L')<<8) | (u32('D')<<16) | (u32('B')<<24) +PART_PDB_NAME :: u32('I') | (u32('L')<<8) | (u32('D')<<16) | (u32('N')<<24) +PART_PRIVATE_DATA :: u32('P') | (u32('R')<<8) | (u32('I')<<16) | (u32('V')<<24) +PART_ROOT_SIGNATURE :: u32('R') | (u32('T')<<8) | (u32('S')<<16) | (u32('0')<<24) +PART_DXIL :: u32('D') | (u32('X')<<8) | (u32('I')<<16) | (u32('L')<<24) +PART_REFLECTION_DATA :: u32('S') | (u32('T')<<8) | (u32('A')<<16) | (u32('T')<<24) +PART_SHADER_HASH :: u32('H') | (u32('A')<<8) | (u32('S')<<16) | (u32('H')<<24) +PART_INPUT_SIGNATURE :: u32('I') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) +PART_OUTPUT_SIGNATURE :: u32('O') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) +PART_PATCH_CONSTANT_SIGNATURE :: u32('P') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) + +ARG_DEBUG :: "-Zi" +ARG_SKIP_VALIDATION :: "-Vd" +ARG_SKIP_OPTIMIZATIONS :: "-Od" +ARG_PACK_MATRIX_ROW_MAJOR :: "-Zpr" +ARG_PACK_MATRIX_COLUMN_MAJOR :: "-Zpc" +ARG_AVOID_FLOW_CONTROL :: "-Gfa" +ARG_PREFER_FLOW_CONTROL :: "-Gfp" +ARG_ENABLE_STRICTNESS :: "-Ges" +ARG_ENABLE_BACKWARDS_COMPATIBILITY :: "-Gec" +ARG_IEEE_STRICTNESS :: "-Gis" +ARG_OPTIMIZATION_LEVEL0 :: "-O0" +ARG_OPTIMIZATION_LEVEL1 :: "-O1" +ARG_OPTIMIZATION_LEVEL2 :: "-O2" +ARG_OPTIMIZATION_LEVEL3 :: "-O3" +ARG_WARNINGS_ARE_ERRORS :: "-WX" +ARG_RESOURCES_MAY_ALIAS :: "-res_may_alias" +ARG_ALL_RESOURCES_BOUND :: "-all_resources_bound" +ARG_DEBUG_NAME_FOR_SOURCE :: "-Zss" +ARG_DEBUG_NAME_FOR_BINARY :: "-Zsb" + +EXTRA_OUTPUT_NAME_STDOUT :: "*stdout*" +EXTRA_OUTPUT_NAME_STDERR :: "*stderr*" diff --git a/vendor/directx/dxc/dxcapi.odin b/vendor/directx/dxc/dxcapi_windows.odin similarity index 99% rename from vendor/directx/dxc/dxcapi.odin rename to vendor/directx/dxc/dxcapi_windows.odin index aa0bb8443..217fd1f21 100644 --- a/vendor/directx/dxc/dxcapi.odin +++ b/vendor/directx/dxc/dxcapi_windows.odin @@ -1,3 +1,4 @@ +//+build windows package directx_dxc import win32 "core:sys/windows" import dxgi "vendor:directx/dxgi" From 06d26df046cad644cad066ffaa9978c423f54f8b Mon Sep 17 00:00:00 2001 From: AbdelHameed-Hamed Date: Thu, 14 Sep 2023 19:24:44 +0200 Subject: [PATCH 2/2] Move API into one file and use "system" calling convention, and move data definitions into platform specific files. --- .../dxc/{dxcapi_unix.odin => dxcapi.odin} | 280 ++++---- vendor/directx/dxc/dxcapi_windows.odin | 604 ------------------ vendor/directx/dxc/dxcdef_unix.odin | 37 ++ vendor/directx/dxc/dxcdef_windows.odin | 16 + 4 files changed, 177 insertions(+), 760 deletions(-) rename vendor/directx/dxc/{dxcapi_unix.odin => dxcapi.odin} (57%) delete mode 100644 vendor/directx/dxc/dxcapi_windows.odin create mode 100644 vendor/directx/dxc/dxcdef_unix.odin create mode 100644 vendor/directx/dxc/dxcdef_windows.odin diff --git a/vendor/directx/dxc/dxcapi_unix.odin b/vendor/directx/dxc/dxcapi.odin similarity index 57% rename from vendor/directx/dxc/dxcapi_unix.odin rename to vendor/directx/dxc/dxcapi.odin index d92eaccd7..79d305ea0 100644 --- a/vendor/directx/dxc/dxcapi_unix.odin +++ b/vendor/directx/dxc/dxcapi.odin @@ -1,41 +1,9 @@ -//+build linux, darwin package directx_dxc -import "core:c" -foreign import dxcompiler "system:dxcompiler" - -FILETIME :: struct { - dwLowDateTime: DWORD, - dwHighDateTime: DWORD, -} - -GUID :: struct { - Data1: DWORD, - Data2: WORD, - Data3: WORD, - Data4: [8]BYTE, -} - -BYTE :: distinct u8 -WORD :: u16 -DWORD :: u32 -BOOL :: distinct b32 -SIZE_T :: uint -ULONG :: c.ulong -CLSID :: GUID -IID :: GUID -LONG :: distinct c.long -HRESULT :: distinct LONG -wstring :: [^]c.wchar_t -BSTR :: wstring - -IUnknown :: struct { - using _iunknown_vtable: ^IUnknown_VTable, -} -IUnknown_VTable :: struct { - QueryInterface: proc "c" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT, - AddRef: proc "c" (this: ^IUnknown) -> ULONG, - Release: proc "c" (this: ^IUnknown) -> ULONG, +when ODIN_OS == .Windows { + foreign import dxcompiler "dxcompiler.lib" +} else { + foreign import dxcompiler "system:dxcompiler" } @(default_calling_convention="c", link_prefix="Dxc") @@ -56,12 +24,12 @@ IMalloc :: struct #raw_union { } IMalloc_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Alloc: proc "c" (this: ^IMalloc, cb: SIZE_T) -> rawptr, - Realloc: proc "c" (this: ^IMalloc, pv: rawptr, cb: SIZE_T) -> rawptr, - Free: proc "c" (this: ^IMalloc, pv: rawptr), - GetSize: proc "c" (this: ^IMalloc, pv: rawptr) -> SIZE_T, - DidAlloc: proc "c" (this: ^IMalloc, pv: rawptr) -> i32, - HeapMinimize: proc "c" (this: ^IMalloc), + Alloc: proc "system" (this: ^IMalloc, cb: SIZE_T) -> rawptr, + Realloc: proc "system" (this: ^IMalloc, pv: rawptr, cb: SIZE_T) -> rawptr, + Free: proc "system" (this: ^IMalloc, pv: rawptr), + GetSize: proc "system" (this: ^IMalloc, pv: rawptr) -> SIZE_T, + DidAlloc: proc "system" (this: ^IMalloc, pv: rawptr) -> i32, + HeapMinimize: proc "system" (this: ^IMalloc), } ISequentialStream :: struct #raw_union { @@ -70,8 +38,8 @@ ISequentialStream :: struct #raw_union { } ISequentialStream_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Read: proc "c" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, - Write: proc "c" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, + Read: proc "system" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, + Write: proc "system" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, } STATSTG :: struct { @@ -94,15 +62,15 @@ IStream :: struct #raw_union { } IStream_VTable :: struct { using isequentialstream_vtable: ISequentialStream_VTable, - Seek: proc "c" (this: ^IStream, dlibMove: i64, dwOrigin: u32, plibNewPosition: ^u64) -> HRESULT, - SetSize: proc "c" (this: ^IStream, libNewSize: u64) -> HRESULT, - CopyTo: proc "c" (this: ^IStream, pstm: ^IStream, cb: u64, pcbRead: ^u64, pcbWritten: ^u64) -> HRESULT, - Commit: proc "c" (this: ^IStream, grfCommitFlags: u32) -> HRESULT, - Revert: proc "c" (this: ^IStream) -> HRESULT, - LockRegion: proc "c" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, - UnlockRegion: proc "c" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, - Stat: proc "c" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: u32) -> HRESULT, - Clone: proc "c" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, + Seek: proc "system" (this: ^IStream, dlibMove: i64, dwOrigin: u32, plibNewPosition: ^u64) -> HRESULT, + SetSize: proc "system" (this: ^IStream, libNewSize: u64) -> HRESULT, + CopyTo: proc "system" (this: ^IStream, pstm: ^IStream, cb: u64, pcbRead: ^u64, pcbWritten: ^u64) -> HRESULT, + Commit: proc "system" (this: ^IStream, grfCommitFlags: u32) -> HRESULT, + Revert: proc "system" (this: ^IStream) -> HRESULT, + LockRegion: proc "system" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, + UnlockRegion: proc "system" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, + Stat: proc "system" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: u32) -> HRESULT, + Clone: proc "system" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, } IBlob_UUID_STRING :: "8BA5FB08-5195-40E2-AC58-0D989C3A0102" @@ -113,8 +81,8 @@ IBlob :: struct #raw_union { } IBlob_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetBufferPointer: proc "c" (this: ^IBlob) -> rawptr, - GetBufferSize: proc "c" (this: ^IBlob) -> SIZE_T, + GetBufferPointer: proc "system" (this: ^IBlob) -> rawptr, + GetBufferSize: proc "system" (this: ^IBlob) -> SIZE_T, } IBlobEncoding_UUID_STRRING :: "7241D424-2646-4191-97C0-98E96E42FC68" @@ -125,7 +93,7 @@ IBlobEncoding :: struct #raw_union { } IBlobEncoding_VTable :: struct { using idxcblob_vtable: IBlob_VTable, - GetEncoding: proc "c" (this: ^IBlobEncoding, pKnown: ^BOOL, pCodePage: ^u32) -> HRESULT, + GetEncoding: proc "system" (this: ^IBlobEncoding, pKnown: ^BOOL, pCodePage: ^u32) -> HRESULT, } IBlobUtf16_UUID_STRING :: "A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84" @@ -136,8 +104,8 @@ IBlobUtf16 :: struct #raw_union { } IBlobUtf16_VTable :: struct { using idxcblobencoding_vtable: IBlobEncoding_VTable, - GetStringPointer: proc "c" (this: ^IBlobUtf16) -> wstring, - GetStringLength: proc "c" (this: ^IBlobUtf16) -> SIZE_T, + GetStringPointer: proc "system" (this: ^IBlobUtf16) -> wstring, + GetStringLength: proc "system" (this: ^IBlobUtf16) -> SIZE_T, } IBlobUtf8_UUID_STRING :: "3DA636C9-BA71-4024-A301-30CBF125305B" @@ -148,8 +116,8 @@ IBlobUtf8 :: struct #raw_union { } IBlobUtf8_VTable :: struct { using idxcblobencoding_vtable: IBlobEncoding_VTable, - GetStringPointer: proc "c" (this: ^IBlobUtf8) -> cstring, - GetStringLength: proc "c" (this: ^IBlobUtf8) -> SIZE_T, + GetStringPointer: proc "system" (this: ^IBlobUtf8) -> cstring, + GetStringLength: proc "system" (this: ^IBlobUtf8) -> SIZE_T, } IIncludeHandler_UUID_STRING :: "7F61FC7D-950D-467F-B3E3-3C02FB49187C" @@ -160,7 +128,7 @@ IIncludeHandler :: struct #raw_union { } IIncludeHandler_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - LoadSource: proc "c" (this: ^IIncludeHandler, pFilename: wstring, ppIncludeSource: ^^IBlob) -> HRESULT, + LoadSource: proc "system" (this: ^IIncludeHandler, pFilename: wstring, ppIncludeSource: ^^IBlob) -> HRESULT, } Define :: struct { @@ -176,11 +144,11 @@ ICompilerArgs :: struct #raw_union { } ICompilerArgs_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetArguments: proc "c" (this: ^ICompilerArgs) -> [^]wstring, - GetCount: proc "c" (this: ^ICompilerArgs) -> u32, - AddArguments: proc "c" (this: ^ICompilerArgs, pArguments: [^]wstring, argCount: u32) -> HRESULT, - AddArgumentsUTF8: proc "c" (this: ^ICompilerArgs, pArguments: [^]cstring, argCount: u32) -> HRESULT, - AddDefines: proc "c" (this: ^ICompilerArgs, pDefines: [^]Define, defineCount: u32) -> HRESULT, + GetArguments: proc "system" (this: ^ICompilerArgs) -> [^]wstring, + GetCount: proc "system" (this: ^ICompilerArgs) -> u32, + AddArguments: proc "system" (this: ^ICompilerArgs, pArguments: [^]wstring, argCount: u32) -> HRESULT, + AddArgumentsUTF8: proc "system" (this: ^ICompilerArgs, pArguments: [^]cstring, argCount: u32) -> HRESULT, + AddDefines: proc "system" (this: ^ICompilerArgs, pDefines: [^]Define, defineCount: u32) -> HRESULT, } ILibrary_UUID_STRING :: "E5204DC7-D18C-4C3C-BDFB-851673980FE7" @@ -191,16 +159,16 @@ ILibrary :: struct #raw_union { } ILibrary_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetMalloc: proc "c" (this: ^ILibrary, pMalloc: ^IMalloc) -> HRESULT, - CreateBlobFromBlob: proc "c" (this: ^ILibrary, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, - CreateBlobFromFile: proc "c" (this: ^ILibrary, pFileName: wstring, codePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingFromPinned: proc "c" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingOnHeapCopy: proc "c" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingOnMalloc: proc "c" (this: ^ILibrary, pText: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateIncludeHandler: proc "c" (this: ^ILibrary, ppResult: ^^IIncludeHandler) -> HRESULT, - CreateStreamFromBlobReadOnly: proc "c" (this: ^ILibrary, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, - GetBlobAsUtf8: proc "c" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - GetBlobAsUtf16: proc "c" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + SetMalloc: proc "system" (this: ^ILibrary, pMalloc: ^IMalloc) -> HRESULT, + CreateBlobFromBlob: proc "system" (this: ^ILibrary, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, + CreateBlobFromFile: proc "system" (this: ^ILibrary, pFileName: wstring, codePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingFromPinned: proc "system" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingOnHeapCopy: proc "system" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlobWithEncodingOnMalloc: proc "system" (this: ^ILibrary, pText: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateIncludeHandler: proc "system" (this: ^ILibrary, ppResult: ^^IIncludeHandler) -> HRESULT, + CreateStreamFromBlobReadOnly: proc "system" (this: ^ILibrary, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, + GetBlobAsUtf8: proc "system" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + GetBlobAsUtf16: proc "system" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, } IOperationResult_UUID_STRING :: "CEDB484A-D4E9-445A-B991-CA21CA157DC2" @@ -211,9 +179,9 @@ IOperationResult :: struct #raw_union { } IOperationResult_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetStatus: proc "c" (this: ^IOperationResult, pStatus: ^HRESULT) -> HRESULT, - GetResult: proc "c" (this: ^IOperationResult, ppResult: ^^IBlob) -> HRESULT, - GetErrorBuffer: proc "c" (this: ^IOperationResult, ppErrors: ^^IBlobEncoding) -> HRESULT, + GetStatus: proc "system" (this: ^IOperationResult, pStatus: ^HRESULT) -> HRESULT, + GetResult: proc "system" (this: ^IOperationResult, ppResult: ^^IBlob) -> HRESULT, + GetErrorBuffer: proc "system" (this: ^IOperationResult, ppErrors: ^^IBlobEncoding) -> HRESULT, } ICompiler_UUID_STRING :: "8C210BF3-011F-4422-8D70-6F9ACB8DB617" @@ -224,7 +192,7 @@ ICompiler :: struct #raw_union { } ICompiler_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Compile: proc "c" ( + Compile: proc "system" ( this: ^ICompiler, pSource: ^Buffer, pSourceName: wstring, @@ -236,7 +204,7 @@ ICompiler_VTable :: struct { defineCount: u32, pIncludeHandler: ^IIncludeHandler, ppResult: ^^IOperationResult) -> HRESULT, - Preprocess: proc "c" ( + Preprocess: proc "system" ( this: ^ICompiler, pSource: ^Buffer, pSourceName: wstring, @@ -246,7 +214,7 @@ ICompiler_VTable :: struct { defineCount: u32, pIncludeHandler: ^IIncludeHandler, ppResult: ^^IOperationResult) -> HRESULT, - Disassemble: proc "c" (this: ^ICompiler, pSource: ^Buffer, ppDisassembly: ^IBlobEncoding) -> HRESULT, + Disassemble: proc "system" (this: ^ICompiler, pSource: ^Buffer, ppDisassembly: ^IBlobEncoding) -> HRESULT, } ICompiler2_UUID_STRING :: "A005A9D9-B8BB-4594-B5C9-0E633BEC4D37" @@ -257,7 +225,7 @@ ICompiler2 :: struct #raw_union { } ICompiler2_VTable :: struct { using idxccompiler_vtable: ^ICompiler_VTable, - CompileWithDebug: proc "c" ( + CompileWithDebug: proc "system" ( this: ^ICompiler2, pSource: ^Buffer, pSourceName: wstring, @@ -281,8 +249,8 @@ ILinker :: struct #raw_union { } ILinker_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - RegisterLibrary: proc "c" (this: ^ILinker, pLibName: ^IBlob) -> HRESULT, - Link: proc "c" ( + RegisterLibrary: proc "system" (this: ^ILinker, pLibName: ^IBlob) -> HRESULT, + Link: proc "system" ( this: ^ILinker, pEntryName: wstring, pTargetProfile: wstring, @@ -307,19 +275,19 @@ IUtils :: struct #raw_union { } IUtils_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateBlobFromBlob: proc "c" (this: ^IUtils, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, - CreateBlobFromPinned: proc "c" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - MoveToBlob: proc "c" (this: ^IUtils, pData: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlob: proc "c" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - LoadFile: proc "c" (this: ^IUtils, pFileName: wstring, pCodePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateReadOnlyStreamFromBlob: proc "c" (this: ^IUtils, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, - CreateDefaultIncludeHandler: proc "c" (this: ^IUtils, ppResult: ^^IIncludeHandler) -> HRESULT, - GetBlobAsUtf8: proc "c" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf8) -> HRESULT, - GetBlobAsUtf16: proc "c" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf16) -> HRESULT, - GetDxilContainerPart: proc "c" (this: ^IUtils, pShader: ^Buffer, Part: u32, ppPartData: rawptr, pPartSizeInBytes: ^u32) -> HRESULT, - CreateReflection: proc "c" (this: ^IUtils, pData: ^Buffer, iid: ^IID, ppvReflection: rawptr) -> HRESULT, - BuildArguments: proc "c" (this: ^IUtils, pSourceName: wstring, pEntryPoint: wstring, pTargetProfile: wstring, pArguments: [^]wstring, argCount: u32, pDefines: [^]Define, defineCount: u32, ppArgs: ^[^]ICompilerArgs) -> HRESULT, - GetPDBContents: proc "c" (this: ^IUtils, pPDBBlob: ^IBlob, ppHash: ^^IBlob, ppContainer: ^^IBlob) -> HRESULT, + CreateBlobFromBlob: proc "system" (this: ^IUtils, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, + CreateBlobFromPinned: proc "system" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + MoveToBlob: proc "system" (this: ^IUtils, pData: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateBlob: proc "system" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + LoadFile: proc "system" (this: ^IUtils, pFileName: wstring, pCodePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, + CreateReadOnlyStreamFromBlob: proc "system" (this: ^IUtils, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, + CreateDefaultIncludeHandler: proc "system" (this: ^IUtils, ppResult: ^^IIncludeHandler) -> HRESULT, + GetBlobAsUtf8: proc "system" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf8) -> HRESULT, + GetBlobAsUtf16: proc "system" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf16) -> HRESULT, + GetDxilContainerPart: proc "system" (this: ^IUtils, pShader: ^Buffer, Part: u32, ppPartData: rawptr, pPartSizeInBytes: ^u32) -> HRESULT, + CreateReflection: proc "system" (this: ^IUtils, pData: ^Buffer, iid: ^IID, ppvReflection: rawptr) -> HRESULT, + BuildArguments: proc "system" (this: ^IUtils, pSourceName: wstring, pEntryPoint: wstring, pTargetProfile: wstring, pArguments: [^]wstring, argCount: u32, pDefines: [^]Define, defineCount: u32, ppArgs: ^[^]ICompilerArgs) -> HRESULT, + GetPDBContents: proc "system" (this: ^IUtils, pPDBBlob: ^IBlob, ppHash: ^^IBlob, ppContainer: ^^IBlob) -> HRESULT, } DXC_OUT_KIND :: enum u32 { @@ -345,11 +313,11 @@ IResult :: struct #raw_union { } IResult_VTable :: struct { using idxcoperationresult_vtable: IOperationResult_VTable, - HasOutput: proc "c" (this: ^IResult, dxcOutKind: DXC_OUT_KIND) -> BOOL, - GetOutput: proc "c" (this: ^IResult, dxcOutKind: DXC_OUT_KIND, iid: ^IID, ppvObject: rawptr, ppOutputName: ^^IBlobUtf16) -> HRESULT, - GetNumOutputs: proc "c" (this: ^IResult) -> u32, - GetOutputByIndex: proc "c" (this: ^IResult, Index: u32) -> DXC_OUT_KIND, - PrimaryOutput: proc "c" (this: ^IResult) -> DXC_OUT_KIND, + HasOutput: proc "system" (this: ^IResult, dxcOutKind: DXC_OUT_KIND) -> BOOL, + GetOutput: proc "system" (this: ^IResult, dxcOutKind: DXC_OUT_KIND, iid: ^IID, ppvObject: rawptr, ppOutputName: ^^IBlobUtf16) -> HRESULT, + GetNumOutputs: proc "system" (this: ^IResult) -> u32, + GetOutputByIndex: proc "system" (this: ^IResult, Index: u32) -> DXC_OUT_KIND, + PrimaryOutput: proc "system" (this: ^IResult) -> DXC_OUT_KIND, } IExtraOutputs_UUID_STRING :: "319B37A2-A5C2-494A-A5DE-4801B2FAF989" @@ -360,8 +328,8 @@ IExtraOutputs :: struct #raw_union { } IExtraOutputs_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetOutputCount: proc "c" (this: ^IExtraOutputs) -> u32, - GetOutput: proc "c" (this: ^IExtraOutputs, uIndex: u32, iid: ^IID, ppvObject: rawptr, ppOutputType: ^^IBlobUtf16, ppOutputName: ^^IBlobUtf16) -> HRESULT, + GetOutputCount: proc "system" (this: ^IExtraOutputs) -> u32, + GetOutput: proc "system" (this: ^IExtraOutputs, uIndex: u32, iid: ^IID, ppvObject: rawptr, ppOutputType: ^^IBlobUtf16, ppOutputName: ^^IBlobUtf16) -> HRESULT, } ICompiler3_UUID_STRING :: "228B4687-5A6A-4730-900C-9702B2203F54" @@ -372,8 +340,8 @@ ICompiler3 :: struct #raw_union { } ICompiler3_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Compile: proc "c" (this: ^ICompiler3, pSource: ^Buffer, pArguments: [^]wstring, argCount: u32, pIncludeHandler: ^IIncludeHandler, riid: ^IID, ppResult: rawptr) -> HRESULT, - Disassemble: proc "c" (this: ^ICompiler3, pObject: ^Buffer, riid: ^IID, ppResult: rawptr) -> HRESULT, + Compile: proc "system" (this: ^ICompiler3, pSource: ^Buffer, pArguments: [^]wstring, argCount: u32, pIncludeHandler: ^IIncludeHandler, riid: ^IID, ppResult: rawptr) -> HRESULT, + Disassemble: proc "system" (this: ^ICompiler3, pObject: ^Buffer, riid: ^IID, ppResult: rawptr) -> HRESULT, } IValidator_UUID_STRING :: "A6E82BD2-1FD7-4826-9811-2857E797F49A" @@ -384,7 +352,7 @@ IValidator :: struct #raw_union { } IValidator_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Validate: proc "c" (this: ^IValidator, pShader: ^IBlob, Flags: u32, ppResult: ^^IOperationResult) -> HRESULT, + Validate: proc "system" (this: ^IValidator, pShader: ^IBlob, Flags: u32, ppResult: ^^IOperationResult) -> HRESULT, } IValidator2_UUID_STRING :: "458E1FD1-B1B2-4750-A6E1-9C10F03BED92" @@ -395,7 +363,7 @@ IValidator2 :: struct #raw_union { } IValidator2_VTable :: struct { using idxcvalidator_vtable: IValidator_VTable, - ValidateWithDebug: proc "c" (this: ^IValidator2, pShader: ^IBlob, Flags: u32, pOptDebugBitcode: ^Buffer, ppResult: ^^IOperationResult) -> HRESULT, + ValidateWithDebug: proc "system" (this: ^IValidator2, pShader: ^IBlob, Flags: u32, pOptDebugBitcode: ^Buffer, ppResult: ^^IOperationResult) -> HRESULT, } IContainerBuilder_UUID_STRING :: "334B1F50-2292-4B35-99A1-25588D8C17FE" @@ -406,10 +374,10 @@ IContainerBuilder :: struct #raw_union { } IContainerBuilder_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Load: proc "c" (this: ^IContainerBuilder, pDxilContainerHeader: ^IBlob) -> HRESULT, - AddPart: proc "c" (this: ^IContainerBuilder, fourCC: u32, pSource: ^IBlob) -> HRESULT, - RemovePart: proc "c" (this: ^IContainerBuilder, fourCC: u32) -> HRESULT, - SerializeContainer: proc "c" (this: ^IContainerBuilder, ppResult: ^^IOperationResult) -> HRESULT, + Load: proc "system" (this: ^IContainerBuilder, pDxilContainerHeader: ^IBlob) -> HRESULT, + AddPart: proc "system" (this: ^IContainerBuilder, fourCC: u32, pSource: ^IBlob) -> HRESULT, + RemovePart: proc "system" (this: ^IContainerBuilder, fourCC: u32) -> HRESULT, + SerializeContainer: proc "system" (this: ^IContainerBuilder, ppResult: ^^IOperationResult) -> HRESULT, } IAssembler_UUID_STRING :: "091F7A26-1C1F-4948-904B-E6E3A8A771D5" @@ -420,7 +388,7 @@ IAssembler :: struct #raw_union { } IAssembler_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - AssembleToContainer: proc "c" (this: ^IAssembler, pShader: ^IBlob, ppResult: ^^IOperationResult) -> HRESULT, + AssembleToContainer: proc "system" (this: ^IAssembler, pShader: ^IBlob, ppResult: ^^IOperationResult) -> HRESULT, } IContainerReflection_UUID_STRING :: "D2C21B26-8350-4BDC-976A-331CE6F4C54C" @@ -431,12 +399,12 @@ IContainerReflection :: struct #raw_union { } IContainerReflection_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Load: proc "c" (this: ^IContainerReflection, pContainer: ^IBlob) -> HRESULT, - GetPartCount: proc "c" (this: ^IContainerReflection, pResult: ^u32) -> HRESULT, - GetPartKind: proc "c" (this: ^IContainerReflection, idx: u32, pResult: ^u32) -> HRESULT, - GetPartContent: proc "c" (this: ^IContainerReflection, idx: u32, ppResult: ^^IBlob) -> HRESULT, - FindFirstPartKind: proc "c" (this: ^IContainerReflection, kind: u32, pResult: ^u32) -> HRESULT, - GetPartReflection: proc "c" (this: ^IContainerReflection, idx: u32, iid: ^IID, ppvObject: rawptr) -> HRESULT, + Load: proc "system" (this: ^IContainerReflection, pContainer: ^IBlob) -> HRESULT, + GetPartCount: proc "system" (this: ^IContainerReflection, pResult: ^u32) -> HRESULT, + GetPartKind: proc "system" (this: ^IContainerReflection, idx: u32, pResult: ^u32) -> HRESULT, + GetPartContent: proc "system" (this: ^IContainerReflection, idx: u32, ppResult: ^^IBlob) -> HRESULT, + FindFirstPartKind: proc "system" (this: ^IContainerReflection, kind: u32, pResult: ^u32) -> HRESULT, + GetPartReflection: proc "system" (this: ^IContainerReflection, idx: u32, iid: ^IID, ppvObject: rawptr) -> HRESULT, } IOptimizerPass_UUID_STRING :: "AE2CD79F-CC22-453F-9B6B-B124E7A5204C" @@ -447,11 +415,11 @@ IOptimizerPass :: struct #raw_union { } IOptimizerPass_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetOptionName: proc "c" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, - GetDescription: proc "c" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, - GetOptionArgCount: proc "c" (this: ^IOptimizerPass, pCount: ^u32) -> HRESULT, - GetOptionArgName: proc "c" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, - GetOptionArgDescription: proc "c" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, + GetOptionName: proc "system" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, + GetDescription: proc "system" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, + GetOptionArgCount: proc "system" (this: ^IOptimizerPass, pCount: ^u32) -> HRESULT, + GetOptionArgName: proc "system" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, + GetOptionArgDescription: proc "system" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, } IOptimizer_UUID_STRING :: "25740E2E-9CBA-401B-9119-4FB42F39F270" @@ -462,9 +430,9 @@ IOptimizer :: struct #raw_union { } IOptimizer_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetAvailablePassCount: proc "c" (this: ^IOptimizer, pCount: ^u32) -> HRESULT, - GetAvailablePass: proc "c" (this: ^IOptimizer, index: u32, ppResult: ^^IOptimizerPass) -> HRESULT, - RunOptimizer: proc "c" (this: ^IOptimizer, pBlob: ^IBlob, ppOptions: [^]wstring, optionCount: u32, pOutputModule: ^^IBlob, ppOutputText: ^^IBlobEncoding) -> HRESULT, + GetAvailablePassCount: proc "system" (this: ^IOptimizer, pCount: ^u32) -> HRESULT, + GetAvailablePass: proc "system" (this: ^IOptimizer, index: u32, ppResult: ^^IOptimizerPass) -> HRESULT, + RunOptimizer: proc "system" (this: ^IOptimizer, pBlob: ^IBlob, ppOptions: [^]wstring, optionCount: u32, pOutputModule: ^^IBlob, ppOutputText: ^^IBlobEncoding) -> HRESULT, } VersionInfoFlags :: enum u32 { @@ -481,8 +449,8 @@ IVersionInfo :: struct #raw_union { } IVersionInfo_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetVersion: proc "c" (this: ^IVersionInfo, pMajor: ^u32, pMinor: ^u32) -> HRESULT, - GetFlags: proc "c" (this: ^IVersionInfo, pFlags: ^VersionInfoFlags) -> HRESULT, + GetVersion: proc "system" (this: ^IVersionInfo, pMajor: ^u32, pMinor: ^u32) -> HRESULT, + GetFlags: proc "system" (this: ^IVersionInfo, pFlags: ^VersionInfoFlags) -> HRESULT, } IVersionInfo2_UUID_STRING :: "FB6904C4-42F0-4B62-9C46-983AF7DA7C83" @@ -493,7 +461,7 @@ IVersionInfo2 :: struct #raw_union { } IVersionInfo2_VTable :: struct { using idxcversioninfo_vtable: IVersionInfo_VTable, - GetCommitInfo: proc "c" (this: ^IVersionInfo2, pCommitCount: ^u32, pCommitHash: ^[^]byte) -> HRESULT, + GetCommitInfo: proc "system" (this: ^IVersionInfo2, pCommitCount: ^u32, pCommitHash: ^[^]byte) -> HRESULT, } IVersionInfo3_UUID_STRING :: "5E13E843-9D25-473C-9AD2-03B2D0B44B1E" @@ -504,7 +472,7 @@ IVersionInfo3 :: struct #raw_union { } IVersionInfo3_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetCustomVersionString: proc "c" (this: ^IVersionInfo3, pVersionString: ^cstring) -> HRESULT, + GetCustomVersionString: proc "system" (this: ^IVersionInfo3, pVersionString: ^cstring) -> HRESULT, } ArgPair :: struct { @@ -520,30 +488,30 @@ IPdbUtils :: struct #raw_union { } IPdbUtils_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Load: proc "c" (this: ^IPdbUtils, pPdbOrDxil: ^IBlob) -> HRESULT, - GetSourceCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetSource: proc "c" (this: ^IPdbUtils, uIndex: u32, ppResult: ^^IBlobEncoding) -> HRESULT, - GetSourceName: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetFlagCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetFlag: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetArgCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetArg: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetArgPairCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetArgPair: proc "c" (this: ^IPdbUtils, uIndex: u32, pName: ^BSTR, pValue: ^BSTR) -> HRESULT, - GetDefineCount: proc "c" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetDefine: proc "c" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetTargetProfile: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetEntryPoint: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetMainFileName: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetHash: proc "c" (this: ^IPdbUtils, ppResult: ^^IBlob) -> HRESULT, - GetName: proc "c" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - IsFullPDB: proc "c" (this: ^IPdbUtils) -> BOOL, - GetFullPDB: proc "c" (this: ^IPdbUtils, ppFullPDB: ^^IBlob) -> HRESULT, - GetVersionInfo: proc "c" (this: ^IPdbUtils, ppVersionInfo: ^^IVersionInfo) -> HRESULT, - SetCompiler: proc "c" (this: ^IPdbUtils, pCompiler: ^ICompiler3) -> HRESULT, - CompileForFullPDB: proc "c" (this: ^IPdbUtils, ppResult: ^^IResult) -> HRESULT, - OverrideArgs: proc "c" (this: ^IPdbUtils, pArgPairs: ^ArgPair, uNumArgPairs: u32) -> HRESULT, - OverrideRootSignature: proc "c" (this: ^IPdbUtils, pRootSignature: wstring) -> HRESULT, + Load: proc "system" (this: ^IPdbUtils, pPdbOrDxil: ^IBlob) -> HRESULT, + GetSourceCount: proc "system" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetSource: proc "system" (this: ^IPdbUtils, uIndex: u32, ppResult: ^^IBlobEncoding) -> HRESULT, + GetSourceName: proc "system" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetFlagCount: proc "system" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetFlag: proc "system" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetArgCount: proc "system" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetArg: proc "system" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetArgPairCount: proc "system" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetArgPair: proc "system" (this: ^IPdbUtils, uIndex: u32, pName: ^BSTR, pValue: ^BSTR) -> HRESULT, + GetDefineCount: proc "system" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, + GetDefine: proc "system" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, + GetTargetProfile: proc "system" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetEntryPoint: proc "system" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetMainFileName: proc "system" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + GetHash: proc "system" (this: ^IPdbUtils, ppResult: ^^IBlob) -> HRESULT, + GetName: proc "system" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, + IsFullPDB: proc "system" (this: ^IPdbUtils) -> BOOL, + GetFullPDB: proc "system" (this: ^IPdbUtils, ppFullPDB: ^^IBlob) -> HRESULT, + GetVersionInfo: proc "system" (this: ^IPdbUtils, ppVersionInfo: ^^IVersionInfo) -> HRESULT, + SetCompiler: proc "system" (this: ^IPdbUtils, pCompiler: ^ICompiler3) -> HRESULT, + CompileForFullPDB: proc "system" (this: ^IPdbUtils, ppResult: ^^IResult) -> HRESULT, + OverrideArgs: proc "system" (this: ^IPdbUtils, pArgPairs: ^ArgPair, uNumArgPairs: u32) -> HRESULT, + OverrideRootSignature: proc "system" (this: ^IPdbUtils, pRootSignature: wstring) -> HRESULT, } diff --git a/vendor/directx/dxc/dxcapi_windows.odin b/vendor/directx/dxc/dxcapi_windows.odin deleted file mode 100644 index 217fd1f21..000000000 --- a/vendor/directx/dxc/dxcapi_windows.odin +++ /dev/null @@ -1,604 +0,0 @@ -//+build windows -package directx_dxc -import win32 "core:sys/windows" -import dxgi "vendor:directx/dxgi" -foreign import "dxcompiler.lib" - -BOOL :: dxgi.BOOL -SIZE_T :: dxgi.SIZE_T -ULONG :: dxgi.ULONG -CLSID :: dxgi.GUID -IID :: dxgi.IID -HRESULT :: dxgi.HRESULT -IUnknown :: dxgi.IUnknown -IUnknown_VTable :: dxgi.IUnknown_VTable -wstring :: win32.wstring -FILETIME :: win32.FILETIME -BSTR :: wstring - -@(default_calling_convention="c", link_prefix="Dxc") -foreign dxcompiler { - CreateInstance :: proc (rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT --- - CreateInstance2 :: proc (pMalloc: ^IMalloc, rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT --- -} - -pCreateInstanceProc :: #type proc "c" (rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT -pCreateInstance2Proc :: #type proc "c" (pMalloc: ^IMalloc, rclsid: ^CLSID, riid: ^IID, ppv: rawptr) -> HRESULT - -CreateInstance_ProcName :: "DxcCreateInstance" -CreateInstance2_ProcName :: "DxcCreateInstance2" - -IMalloc :: struct #raw_union { - #subtype iunknown: IUnknown, - using imalloc_vtable: ^IMalloc_VTable, -} -IMalloc_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Alloc: proc "stdcall" (this: ^IMalloc, cb: SIZE_T) -> rawptr, - Realloc: proc "stdcall" (this: ^IMalloc, pv: rawptr, cb: SIZE_T) -> rawptr, - Free: proc "stdcall" (this: ^IMalloc, pv: rawptr), - GetSize: proc "stdcall" (this: ^IMalloc, pv: rawptr) -> SIZE_T, - DidAlloc: proc "stdcall" (this: ^IMalloc, pv: rawptr) -> i32, - HeapMinimize: proc "stdcall" (this: ^IMalloc), -} - -ISequentialStream :: struct #raw_union { - #subtype iunknown: IUnknown, - using isequentialstream_vtable: ^ISequentialStream_VTable, -} -ISequentialStream_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Read: proc "stdcall" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, - Write: proc "stdcall" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, -} - -STATSTG :: struct { - pwcsName: wstring, - type: u32, - cbSize: u64, - mtime: FILETIME, - ctime: FILETIME, - atime: FILETIME, - grfMode: u32, - grfLocksSupported: u32, - clsid: CLSID, - grfStateBits: u32, - reserved: u32, -} - -IStream :: struct #raw_union { - #subtype isequentialstream: ISequentialStream, - using istream_vtable: ^IStream_VTable, -} -IStream_VTable :: struct { - using isequentialstream_vtable: ISequentialStream_VTable, - Seek: proc "stdcall" (this: ^IStream, dlibMove: i64, dwOrigin: u32, plibNewPosition: ^u64) -> HRESULT, - SetSize: proc "stdcall" (this: ^IStream, libNewSize: u64) -> HRESULT, - CopyTo: proc "stdcall" (this: ^IStream, pstm: ^IStream, cb: u64, pcbRead: ^u64, pcbWritten: ^u64) -> HRESULT, - Commit: proc "stdcall" (this: ^IStream, grfCommitFlags: u32) -> HRESULT, - Revert: proc "stdcall" (this: ^IStream) -> HRESULT, - LockRegion: proc "stdcall" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, - UnlockRegion: proc "stdcall" (this: ^IStream, libOffset: u64, cb: u64, dwLockType: u32) -> HRESULT, - Stat: proc "stdcall" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: u32) -> HRESULT, - Clone: proc "stdcall" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, -} - -IBlob_UUID_STRING :: "8BA5FB08-5195-40E2-AC58-0D989C3A0102" -IBlob_UUID := &IID{0x8BA5FB08, 0x5195, 0x40E2, {0xAC, 0x58, 0x0D, 0x98, 0x9C, 0x3A, 0x01, 0x02}} -IBlob :: struct #raw_union { - #subtype iunknown: IUnknown, - using id3d10blob_vtable: ^IBlob_VTable, -} -IBlob_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetBufferPointer: proc "stdcall" (this: ^IBlob) -> rawptr, - GetBufferSize: proc "stdcall" (this: ^IBlob) -> SIZE_T, -} - -IBlobEncoding_UUID_STRRING :: "7241D424-2646-4191-97C0-98E96E42FC68" -IBlobEncoding_UUID := &IID{0x7241D424, 0x2646, 0x4191, {0x97, 0xC0, 0x98, 0xE9, 0x6E, 0x42, 0xFC, 0x68}} -IBlobEncoding :: struct #raw_union { - #subtype idxcblob: IBlob, - using idxcblobencoding_vtable: ^IBlobEncoding_VTable, -} -IBlobEncoding_VTable :: struct { - using idxcblob_vtable: IBlob_VTable, - GetEncoding: proc "stdcall" (this: ^IBlobEncoding, pKnown: ^BOOL, pCodePage: ^u32) -> HRESULT, -} - -IBlobUtf16_UUID_STRING :: "A3F84EAB-0FAA-497E-A39C-EE6ED60B2D84" -IBlobUtf16_UUID := &IID{0xA3F84EAB, 0x0FAA, 0x497E, {0xA3, 0x9C, 0xEE, 0x6E, 0xD6, 0x0B, 0x2D, 0x84}} -IBlobUtf16 :: struct #raw_union { - #subtype idxcblobencoding: IBlobEncoding, - using idxcblobutf16_vtable : ^IBlobUtf16_VTable, -} -IBlobUtf16_VTable :: struct { - using idxcblobencoding_vtable: IBlobEncoding_VTable, - GetStringPointer: proc "stdcall" (this: ^IBlobUtf16) -> wstring, - GetStringLength: proc "stdcall" (this: ^IBlobUtf16) -> SIZE_T, -} - -IBlobUtf8_UUID_STRING :: "3DA636C9-BA71-4024-A301-30CBF125305B" -IBlobUtf8_UUID := &IID{0x3DA636C9, 0xBA71, 0x4024, {0xA3, 0x01, 0x30, 0xCB, 0xF1, 0x25, 0x30, 0x5B}} -IBlobUtf8 :: struct #raw_union { - #subtype idxcblobencoding: IBlobEncoding, - using idxcblobutf8_vtable : ^IBlobUtf8_VTable, -} -IBlobUtf8_VTable :: struct { - using idxcblobencoding_vtable: IBlobEncoding_VTable, - GetStringPointer: proc "stdcall" (this: ^IBlobUtf8) -> cstring, - GetStringLength: proc "stdcall" (this: ^IBlobUtf8) -> SIZE_T, -} - -IIncludeHandler_UUID_STRING :: "7F61FC7D-950D-467F-B3E3-3C02FB49187C" -IIncludeHandler_UUID := &IID{0x7F61FC7D, 0x950D, 0x467F, {0xB3, 0xE3, 0x3C, 0x02, 0xFB, 0x49, 0x18, 0x7C}} -IIncludeHandler :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcincludehandler_vtable: ^IIncludeHandler_VTable, -} -IIncludeHandler_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - LoadSource: proc "stdcall" (this: ^IIncludeHandler, pFilename: wstring, ppIncludeSource: ^^IBlob) -> HRESULT, -} - -Define :: struct { - Name: wstring, - Value: wstring, -} - -ICompilerArgs_UUID_STRING :: "73EFFE2A-70DC-45F8-9690-EFF64C02429D" -ICompilerArgs_UUID := &IID{0x73EFFE2A, 0x70DC, 0x45F8, {0x96, 0x90, 0xEF, 0xF6, 0x4C, 0x02, 0x42, 0x9D}} -ICompilerArgs :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxccompilerargs_vtable: ^ICompilerArgs_VTable, -} -ICompilerArgs_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetArguments: proc "stdcall" (this: ^ICompilerArgs) -> [^]wstring, - GetCount: proc "stdcall" (this: ^ICompilerArgs) -> u32, - AddArguments: proc "stdcall" (this: ^ICompilerArgs, pArguments: [^]wstring, argCount: u32) -> HRESULT, - AddArgumentsUTF8: proc "stdcall" (this: ^ICompilerArgs, pArguments: [^]cstring, argCount: u32) -> HRESULT, - AddDefines: proc "stdcall" (this: ^ICompilerArgs, pDefines: [^]Define, defineCount: u32) -> HRESULT, -} - -ILibrary_UUID_STRING :: "E5204DC7-D18C-4C3C-BDFB-851673980FE7" -ILibrary_UUID := &IID{0xE5204DC7, 0xD18C, 0x4C3C, {0xBD, 0xFB, 0x85, 0x16, 0x73, 0x98, 0x0F, 0xE7}} -ILibrary :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxclibrary_vtable: ^ILibrary_VTable, -} -ILibrary_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - SetMalloc: proc "stdcall" (this: ^ILibrary, pMalloc: ^IMalloc) -> HRESULT, - CreateBlobFromBlob: proc "stdcall" (this: ^ILibrary, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, - CreateBlobFromFile: proc "stdcall" (this: ^ILibrary, pFileName: wstring, codePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingFromPinned: proc "stdcall" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingOnHeapCopy: proc "stdcall" (this: ^ILibrary, pText: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlobWithEncodingOnMalloc: proc "stdcall" (this: ^ILibrary, pText: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateIncludeHandler: proc "stdcall" (this: ^ILibrary, ppResult: ^^IIncludeHandler) -> HRESULT, - CreateStreamFromBlobReadOnly: proc "stdcall" (this: ^ILibrary, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, - GetBlobAsUtf8: proc "stdcall" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - GetBlobAsUtf16: proc "stdcall" (this: ^ILibrary, pBlob: ^IBlob, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, -} - -IOperationResult_UUID_STRING :: "CEDB484A-D4E9-445A-B991-CA21CA157DC2" -IOperationResult_UUID := &IID{0xCEDB484A, 0xD4E9, 0x445A, {0xB9, 0x91, 0xCA, 0x21, 0xCA, 0x15, 0x7D, 0xC2}} -IOperationResult :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcoperationresult_vtable: ^IOperationResult_VTable, -} -IOperationResult_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetStatus: proc "stdcall" (this: ^IOperationResult, pStatus: ^HRESULT) -> HRESULT, - GetResult: proc "stdcall" (this: ^IOperationResult, ppResult: ^^IBlob) -> HRESULT, - GetErrorBuffer: proc "stdcall" (this: ^IOperationResult, ppErrors: ^^IBlobEncoding) -> HRESULT, -} - -ICompiler_UUID_STRING :: "8C210BF3-011F-4422-8D70-6F9ACB8DB617" -ICompiler_UUID := &IID{0x8C210BF3, 0x011F, 0x4422, {0x8D, 0x70, 0x6F, 0x9A, 0xCB, 0x8D, 0xB6, 0x17}} -ICompiler :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxccompiler_vtable: ^ICompiler_VTable, -} -ICompiler_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Compile: proc "stdcall" ( - this: ^ICompiler, - pSource: ^Buffer, - pSourceName: wstring, - pEntryPoint: wstring, - pTargetProfile: wstring, - pArguments: [^]wstring, - argCount: u32, - pDefines: [^]Define, - defineCount: u32, - pIncludeHandler: ^IIncludeHandler, - ppResult: ^^IOperationResult) -> HRESULT, - Preprocess: proc "stdcall" ( - this: ^ICompiler, - pSource: ^Buffer, - pSourceName: wstring, - pArguments: [^]wstring, - argCount: u32, - pDefines: [^]Define, - defineCount: u32, - pIncludeHandler: ^IIncludeHandler, - ppResult: ^^IOperationResult) -> HRESULT, - Disassemble: proc "stdcall" (this: ^ICompiler, pSource: ^Buffer, ppDisassembly: ^IBlobEncoding) -> HRESULT, -} - -ICompiler2_UUID_STRING :: "A005A9D9-B8BB-4594-B5C9-0E633BEC4D37" -ICompiler2_UUID := &IID{0xA005A9D9, 0xB8BB, 0x4594, {0xB5, 0xC9, 0x0E, 0x63, 0x3B, 0xEC, 0x4D, 0x37}} -ICompiler2 :: struct #raw_union { - #subtype icompiler: ICompiler, - using idxccompiler2_vtable: ^ICompiler2_VTable, -} -ICompiler2_VTable :: struct { - using idxccompiler_vtable: ^ICompiler_VTable, - CompileWithDebug: proc "stdcall" ( - this: ^ICompiler2, - pSource: ^Buffer, - pSourceName: wstring, - pEntryPoint: wstring, - pTargetProfile: wstring, - pArguments: [^]wstring, - argCount: u32, - pDefines: [^]Define, - defineCount: u32, - pIncludeHandler: ^IIncludeHandler, - ppResult: ^^IOperationResult, - ppDebugBlobName: ^wstring, - ppDebugBlob: ^^IBlob) -> HRESULT, -} - -ILinker_UUID_STRING :: "F1B5BE2A-62DD-4327-A1C2-42AC1E1E78E6" -ILinker_UUID := &IID{0xF1B5BE2A, 0x62DD, 0x4327, {0xA1, 0xC2, 0x42, 0xAC, 0x1E, 0x1E, 0x78, 0xE6}} -ILinker :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxclinker_vtable: ^ILinker_VTable, -} -ILinker_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - RegisterLibrary: proc "stdcall" (this: ^ILinker, pLibName: ^IBlob) -> HRESULT, - Link: proc "stdcall" ( - this: ^ILinker, - pEntryName: wstring, - pTargetProfile: wstring, - pLibNames: [^]wstring, - libCount: u32, - pArguments: [^]wstring, - argCount: u32, - ppResult: ^^IOperationResult) -> HRESULT, -} - -Buffer :: struct { - Ptr: rawptr, - Size: SIZE_T, - Encoding: u32, -} - -IUtils_UUID_STRING :: "4605C4CB-2019-492A-ADA4-65F20BB7D67F" -IUtils_UUID := &IID{0x4605C4CB, 0x2019, 0x492A, {0xAD, 0xA4, 0x65, 0xF2, 0x0B, 0xB7, 0xD6, 0x7F}} -IUtils :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcutils_vtable: ^IUtils_VTable, -} -IUtils_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - CreateBlobFromBlob: proc "stdcall" (this: ^IUtils, pBlob: ^IBlob, offset: u32, length: u32, ppResult: ^^IBlob) -> HRESULT, - CreateBlobFromPinned: proc "stdcall" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - MoveToBlob: proc "stdcall" (this: ^IUtils, pData: rawptr, pIMalloc: ^IMalloc, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateBlob: proc "stdcall" (this: ^IUtils, pData: rawptr, size: u32, codePage: u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - LoadFile: proc "stdcall" (this: ^IUtils, pFileName: wstring, pCodePage: ^u32, pBlobEncoding: ^^IBlobEncoding) -> HRESULT, - CreateReadOnlyStreamFromBlob: proc "stdcall" (this: ^IUtils, pBlob: ^IBlob, ppStream: ^^IStream) -> HRESULT, - CreateDefaultIncludeHandler: proc "stdcall" (this: ^IUtils, ppResult: ^^IIncludeHandler) -> HRESULT, - GetBlobAsUtf8: proc "stdcall" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf8) -> HRESULT, - GetBlobAsUtf16: proc "stdcall" (this: ^IUtils, pBlob: ^IBlob, pBlobEncoding: ^^IBlobUtf16) -> HRESULT, - GetDxilContainerPart: proc "stdcall" (this: ^IUtils, pShader: ^Buffer, Part: u32, ppPartData: rawptr, pPartSizeInBytes: ^u32) -> HRESULT, - CreateReflection: proc "stdcall" (this: ^IUtils, pData: ^Buffer, iid: ^IID, ppvReflection: rawptr) -> HRESULT, - BuildArguments: proc "stdcall" (this: ^IUtils, pSourceName: wstring, pEntryPoint: wstring, pTargetProfile: wstring, pArguments: [^]wstring, argCount: u32, pDefines: [^]Define, defineCount: u32, ppArgs: ^[^]ICompilerArgs) -> HRESULT, - GetPDBContents: proc "stdcall" (this: ^IUtils, pPDBBlob: ^IBlob, ppHash: ^^IBlob, ppContainer: ^^IBlob) -> HRESULT, -} - -DXC_OUT_KIND :: enum u32 { - NONE = 0, - OBJECT = 1, - ERRORS = 2, - PDB = 3, - SHADER_HASH = 4, - DISASSEMBLY = 5, - HLSL = 6, - TEXT = 7, - REFLECTION = 8, - ROOT_SIGNATURE = 9, - EXTRA_OUTPUTS = 10, - FORCE_DWORD = 0xFFFFFFFF, -} - -IResult_UUID_STRING :: "58346CDA-DDE7-4497-9461-6F87AF5E0659" -IResult_UUID := &IID{0x58346CDA, 0xDDE7, 0x4497, {0x94, 0x61, 0x6F, 0x87, 0xAF, 0x5E, 0x06, 0x59}} -IResult :: struct #raw_union { - #subtype idxcoperationresult: IOperationResult, - using idxcresult_vtable: ^IResult_VTable, -} -IResult_VTable :: struct { - using idxcoperationresult_vtable: IOperationResult_VTable, - HasOutput: proc "stdcall" (this: ^IResult, dxcOutKind: DXC_OUT_KIND) -> BOOL, - GetOutput: proc "stdcall" (this: ^IResult, dxcOutKind: DXC_OUT_KIND, iid: ^IID, ppvObject: rawptr, ppOutputName: ^^IBlobUtf16) -> HRESULT, - GetNumOutputs: proc "stdcall" (this: ^IResult) -> u32, - GetOutputByIndex: proc "stdcall" (this: ^IResult, Index: u32) -> DXC_OUT_KIND, - PrimaryOutput: proc "stdcall" (this: ^IResult) -> DXC_OUT_KIND, -} - -IExtraOutputs_UUID_STRING :: "319B37A2-A5C2-494A-A5DE-4801B2FAF989" -IExtraOutputs_UUID := &IID{0x319B37A2, 0xA5C2, 0x494A, {0xA5, 0xDE, 0x48, 0x01, 0xB2, 0xFA, 0xF9, 0x89}} -IExtraOutputs :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcextraoutputs_vtable: ^IExtraOutputs_VTable, -} -IExtraOutputs_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetOutputCount: proc "stdcall" (this: ^IExtraOutputs) -> u32, - GetOutput: proc "stdcall" (this: ^IExtraOutputs, uIndex: u32, iid: ^IID, ppvObject: rawptr, ppOutputType: ^^IBlobUtf16, ppOutputName: ^^IBlobUtf16) -> HRESULT, -} - -ICompiler3_UUID_STRING :: "228B4687-5A6A-4730-900C-9702B2203F54" -ICompiler3_UUID := &IID{0x228B4687, 0x5A6A, 0x4730, {0x90, 0x0C, 0x97, 0x02, 0xB2, 0x20, 0x3F, 0x54}} -ICompiler3 :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxccompiler3_vtable: ^ICompiler3_VTable, -} -ICompiler3_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Compile: proc "stdcall" (this: ^ICompiler3, pSource: ^Buffer, pArguments: [^]wstring, argCount: u32, pIncludeHandler: ^IIncludeHandler, riid: ^IID, ppResult: rawptr) -> HRESULT, - Disassemble: proc "stdcall" (this: ^ICompiler3, pObject: ^Buffer, riid: ^IID, ppResult: rawptr) -> HRESULT, -} - -IValidator_UUID_STRING :: "A6E82BD2-1FD7-4826-9811-2857E797F49A" -IValidator_UUID := &IID{0xA6E82BD2, 0x1FD7, 0x4826, {0x98, 0x11, 0x28, 0x57, 0xE7, 0x97, 0xF4, 0x9A}} -IValidator :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcvalidator_vtable: ^IValidator_VTable, -} -IValidator_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Validate: proc "stdcall" (this: ^IValidator, pShader: ^IBlob, Flags: u32, ppResult: ^^IOperationResult) -> HRESULT, -} - -IValidator2_UUID_STRING :: "458E1FD1-B1B2-4750-A6E1-9C10F03BED92" -IValidator2_UUID := &IID{0x458E1FD1, 0xB1B2, 0x4750, {0xA6, 0xE1, 0x9C, 0x10, 0xF0, 0x3B, 0xED, 0x92}} -IValidator2 :: struct #raw_union { - #subtype idxcvalidator: IValidator, - using idxcvalidator2_vtable: ^IValidator2_VTable, -} -IValidator2_VTable :: struct { - using idxcvalidator_vtable: IValidator_VTable, - ValidateWithDebug: proc "stdcall" (this: ^IValidator2, pShader: ^IBlob, Flags: u32, pOptDebugBitcode: ^Buffer, ppResult: ^^IOperationResult) -> HRESULT, -} - -IContainerBuilder_UUID_STRING :: "334B1F50-2292-4B35-99A1-25588D8C17FE" -IContainerBuilder_UUID := &IID{0x334B1F50, 0x2292, 0x4B35, {0x99, 0xA1, 0x25, 0x58, 0x8D, 0x8C, 0x17, 0xFE}} -IContainerBuilder :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxccontainerbuilder_vtable: ^IContainerBuilder_VTable, -} -IContainerBuilder_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Load: proc "stdcall" (this: ^IContainerBuilder, pDxilContainerHeader: ^IBlob) -> HRESULT, - AddPart: proc "stdcall" (this: ^IContainerBuilder, fourCC: u32, pSource: ^IBlob) -> HRESULT, - RemovePart: proc "stdcall" (this: ^IContainerBuilder, fourCC: u32) -> HRESULT, - SerializeContainer: proc "stdcall" (this: ^IContainerBuilder, ppResult: ^^IOperationResult) -> HRESULT, -} - -IAssembler_UUID_STRING :: "091F7A26-1C1F-4948-904B-E6E3A8A771D5" -IAssembler_UUID := &IID{0x091F7A26, 0x1C1F, 0x4948, {0x90, 0x4B, 0xE6, 0xE3, 0xA8, 0xA7, 0x71, 0xD5}} -IAssembler :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcassembler_vtable: ^IAssembler_VTable, -} -IAssembler_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - AssembleToContainer: proc "stdcall" (this: ^IAssembler, pShader: ^IBlob, ppResult: ^^IOperationResult) -> HRESULT, -} - -IContainerReflection_UUID_STRING :: "D2C21B26-8350-4BDC-976A-331CE6F4C54C" -IContainerReflection_UUID := &IID{0xD2C21B26, 0x8350, 0x4BDC, {0x97, 0x6A, 0x33, 0x1C, 0xE6, 0xF4, 0xC5, 0x4C}} -IContainerReflection :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxccontainerreflection_vtable: ^IContainerReflection_VTable, -} -IContainerReflection_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Load: proc "stdcall" (this: ^IContainerReflection, pContainer: ^IBlob) -> HRESULT, - GetPartCount: proc "stdcall" (this: ^IContainerReflection, pResult: ^u32) -> HRESULT, - GetPartKind: proc "stdcall" (this: ^IContainerReflection, idx: u32, pResult: ^u32) -> HRESULT, - GetPartContent: proc "stdcall" (this: ^IContainerReflection, idx: u32, ppResult: ^^IBlob) -> HRESULT, - FindFirstPartKind: proc "stdcall" (this: ^IContainerReflection, kind: u32, pResult: ^u32) -> HRESULT, - GetPartReflection: proc "stdcall" (this: ^IContainerReflection, idx: u32, iid: ^IID, ppvObject: rawptr) -> HRESULT, -} - -IOptimizerPass_UUID_STRING :: "AE2CD79F-CC22-453F-9B6B-B124E7A5204C" -IOptimizerPass_UUID := &IID{0xAE2CD79F, 0xCC22, 0x453F, {0x9B, 0x6B, 0xB1, 0x24, 0xE7, 0xA5, 0x20, 0x4C}} -IOptimizerPass :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcoptimizerpass_vtable: ^IOptimizerPass_VTable, -} -IOptimizerPass_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetOptionName: proc "stdcall" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, - GetDescription: proc "stdcall" (this: ^IOptimizerPass, ppResult: ^wstring) -> HRESULT, - GetOptionArgCount: proc "stdcall" (this: ^IOptimizerPass, pCount: ^u32) -> HRESULT, - GetOptionArgName: proc "stdcall" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, - GetOptionArgDescription: proc "stdcall" (this: ^IOptimizerPass, argIndex: u32, ppResult: ^wstring) -> HRESULT, -} - -IOptimizer_UUID_STRING :: "25740E2E-9CBA-401B-9119-4FB42F39F270" -IOptimizer_UUID := &IID{0x25740E2E, 0x9CBA, 0x401B, {0x91, 0x19, 0x4F, 0xB4, 0x2F, 0x39, 0xF2, 0x70}} -IOptimizer :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcoptimizer_vtable: ^IOptimizer_VTable, -} -IOptimizer_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetAvailablePassCount: proc "stdcall" (this: ^IOptimizer, pCount: ^u32) -> HRESULT, - GetAvailablePass: proc "stdcall" (this: ^IOptimizer, index: u32, ppResult: ^^IOptimizerPass) -> HRESULT, - RunOptimizer: proc "stdcall" (this: ^IOptimizer, pBlob: ^IBlob, ppOptions: [^]wstring, optionCount: u32, pOutputModule: ^^IBlob, ppOutputText: ^^IBlobEncoding) -> HRESULT, -} - -VersionInfoFlags :: enum u32 { - None = 0, - Debug = 1, - Internal = 2, -} - -IVersionInfo_UUID_STRING :: "B04F5B50-2059-4F12-A8FF-A1E0CDE1CC7E" -IVersionInfo_UUID := &IID{0xB04F5B50, 0x2059, 0x4F12, {0xA8, 0xFF, 0xA1, 0xE0, 0xCD, 0xE1, 0xCC, 0x7E}} -IVersionInfo :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcversioninfo_vtable: ^IVersionInfo_VTable, -} -IVersionInfo_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetVersion: proc "stdcall" (this: ^IVersionInfo, pMajor: ^u32, pMinor: ^u32) -> HRESULT, - GetFlags: proc "stdcall" (this: ^IVersionInfo, pFlags: ^VersionInfoFlags) -> HRESULT, -} - -IVersionInfo2_UUID_STRING :: "FB6904C4-42F0-4B62-9C46-983AF7DA7C83" -IVersionInfo2_UUID := &IID{0xFB6904C4, 0x42F0, 0x4B62, {0x9C, 0x46, 0x98, 0x3A, 0xF7, 0xDA, 0x7C, 0x83}} -IVersionInfo2 :: struct #raw_union { - #subtype idxcversioninfo: IVersionInfo, - using idxcversioninfo2_vtable: ^IVersionInfo2_VTable, -} -IVersionInfo2_VTable :: struct { - using idxcversioninfo_vtable: IVersionInfo_VTable, - GetCommitInfo: proc "stdcall" (this: ^IVersionInfo2, pCommitCount: ^u32, pCommitHash: ^[^]byte) -> HRESULT, -} - -IVersionInfo3_UUID_STRING :: "5E13E843-9D25-473C-9AD2-03B2D0B44B1E" -IVersionInfo3_UUID := &IID{0x5E13E843, 0x9D25, 0x473C, {0x9A, 0xD2, 0x03, 0xB2, 0xD0, 0xB4, 0x4B, 0x1E}} -IVersionInfo3 :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcversioninfo3_vtable: ^IVersionInfo3_VTable, -} -IVersionInfo3_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - GetCustomVersionString: proc "stdcall" (this: ^IVersionInfo3, pVersionString: ^cstring) -> HRESULT, -} - -ArgPair :: struct { - pName: wstring, - pValue: wstring, -} - -IPdbUtils_UUID_STRING :: "E6C9647E-9D6A-4C3B-B94C-524B5A6C343D" -IPdbUtils_UUID := &IID{0xE6C9647E, 0x9D6A, 0x4C3B, {0xB9, 0x4C, 0x52, 0x4B, 0x5A, 0x6C, 0x34, 0x3D}} -IPdbUtils :: struct #raw_union { - #subtype iunknown: IUnknown, - using idxcpdbutils_vtable: ^IPdbUtils_VTable, -} -IPdbUtils_VTable :: struct { - using iunknown_vtable: IUnknown_VTable, - Load: proc "stdcall" (this: ^IPdbUtils, pPdbOrDxil: ^IBlob) -> HRESULT, - GetSourceCount: proc "stdcall" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetSource: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, ppResult: ^^IBlobEncoding) -> HRESULT, - GetSourceName: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetFlagCount: proc "stdcall" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetFlag: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetArgCount: proc "stdcall" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetArg: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetArgPairCount: proc "stdcall" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetArgPair: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, pName: ^BSTR, pValue: ^BSTR) -> HRESULT, - GetDefineCount: proc "stdcall" (this: ^IPdbUtils, pCount: ^u32) -> HRESULT, - GetDefine: proc "stdcall" (this: ^IPdbUtils, uIndex: u32, pResult: ^BSTR) -> HRESULT, - GetTargetProfile: proc "stdcall" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetEntryPoint: proc "stdcall" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetMainFileName: proc "stdcall" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - GetHash: proc "stdcall" (this: ^IPdbUtils, ppResult: ^^IBlob) -> HRESULT, - GetName: proc "stdcall" (this: ^IPdbUtils, pResult: ^BSTR) -> HRESULT, - IsFullPDB: proc "stdcall" (this: ^IPdbUtils) -> BOOL, - GetFullPDB: proc "stdcall" (this: ^IPdbUtils, ppFullPDB: ^^IBlob) -> HRESULT, - GetVersionInfo: proc "stdcall" (this: ^IPdbUtils, ppVersionInfo: ^^IVersionInfo) -> HRESULT, - SetCompiler: proc "stdcall" (this: ^IPdbUtils, pCompiler: ^ICompiler3) -> HRESULT, - CompileForFullPDB: proc "stdcall" (this: ^IPdbUtils, ppResult: ^^IResult) -> HRESULT, - OverrideArgs: proc "stdcall" (this: ^IPdbUtils, pArgPairs: ^ArgPair, uNumArgPairs: u32) -> HRESULT, - OverrideRootSignature: proc "stdcall" (this: ^IPdbUtils, pRootSignature: wstring) -> HRESULT, -} - - -Compiler_CLSID_STRING :: "73E22D93-E6CE-47F3-B5BF-F0664F39C1B0" -Compiler_CLSID := &CLSID{0x73E22D93, 0xE6CE, 0x47F3, {0xB5, 0xBF, 0xF0, 0x66, 0x4F, 0x39, 0xC1, 0xB0}} - -Linker_CLSID_STRING :: "EF6A8087-B0EA-4D56-9E45-D07E1A8B7806" -Linker_CLSID := &CLSID{0xEF6A8087, 0xB0EA, 0x4D56, {0x9E, 0x45, 0xD0, 0x7E, 0x1A, 0x8B, 0x78, 0x6}} - -DiaDataSource_CLSID_STRING :: "CD1F6B73-2AB0-484D-8EDC-EBE7A43CA09F" -DiaDataSource_CLSID := &CLSID{0xCD1F6B73, 0x2AB0, 0x484D, {0x8E, 0xDC, 0xEB, 0xE7, 0xA4, 0x3C, 0xA0, 0x9F}} - -CompilerArgs_CLSID_STRING :: "3E56AE82-224D-470F-A1A1-FE3016EE9F9D" -CompilerArgs_CLSID := &CLSID{0x3E56AE82, 0x224D, 0x470F, {0xA1, 0xA1, 0xFE, 0x30, 0x16, 0xEE, 0x9F, 0x9D}} - -Library_CLSID_STRING :: "6245D6AF-66E0-48FD-80B4-4D271796748C" -Library_CLSID := &CLSID{0x6245D6AF, 0x66E0, 0x48FD, {0x80, 0xB4, 0x4D, 0x27, 0x17, 0x96, 0x74, 0x8C}} - -Utils_CLSID_STRING :: Library_CLSID_STRING -Utils_CLSID := Library_CLSID - -Validator_CLSID_STRING :: "8CA3E215-F728-4CF3-8CDD-88AF917587A1" -Validator_CLSID := &CLSID{0x8CA3E215, 0xF728, 0x4CF3, {0x8C, 0xDD, 0x88, 0xAF, 0x91, 0x75, 0x87, 0xA1}} - -Assembler_CLSID_STRING :: "D728DB68-F903-4F80-94CD-DCCF76EC7151" -Assembler_CLSID := &CLSID{0xD728DB68, 0xF903, 0x4F80, {0x94, 0xCD, 0xDC, 0xCF, 0x76, 0xEC, 0x71, 0x51}} - -ContainerReflection_CLSID_STRING :: "b9f54489-55b8-400c-ba3a-1675e4728b91" -ContainerReflection_CLSID := &CLSID{0xB9F54489, 0x55B8, 0x400C, {0xBA, 0x3A, 0x16, 0x75, 0xE4, 0x72, 0x8B, 0x91}} - -Optimizer_CLSID_STRING :: "AE2CD79F-CC22-453F-9B6B-B124E7A5204C" -Optimizer_CLSID := &CLSID{0xAE2CD79F, 0xCC22, 0x453F, {0x9B, 0x6B, 0xB1, 0x24, 0xE7, 0xA5, 0x20, 0x4C}} - -ContainerBuilder_CLSID_STRING :: "94134294-411f-4574-b4d0-8741e25240d2" -ContainerBuilder_CLSID := &CLSID{0x94134294, 0x411F, 0x4574, {0xB4, 0xD0, 0x87, 0x41, 0xE2, 0x52, 0x40, 0xD2}} - -PdbUtils_CLSID_STRING :: "54621dfb-f2ce-457e-ae8c-ec355faeec7c" -PdbUtils_CLSID := &CLSID{0x54621DFB, 0xF2CE, 0x457E, {0xAE, 0x8C, 0xEC, 0x35, 0x5F, 0xAE, 0xEC, 0x7C}} - -CP_UTF8 :: 65001 -CP_UTF16 :: 1200 -CP_ACP :: 0 - -make_fourcc :: proc "contextless" (ch0, ch1, ch2, ch3: u32) -> u32 { - return ch0 | (ch1 << 8) | (ch2 << 16) | (ch3 << 24) -} - -PART_PDB :: u32('I') | (u32('L')<<8) | (u32('D')<<16) | (u32('B')<<24) -PART_PDB_NAME :: u32('I') | (u32('L')<<8) | (u32('D')<<16) | (u32('N')<<24) -PART_PRIVATE_DATA :: u32('P') | (u32('R')<<8) | (u32('I')<<16) | (u32('V')<<24) -PART_ROOT_SIGNATURE :: u32('R') | (u32('T')<<8) | (u32('S')<<16) | (u32('0')<<24) -PART_DXIL :: u32('D') | (u32('X')<<8) | (u32('I')<<16) | (u32('L')<<24) -PART_REFLECTION_DATA :: u32('S') | (u32('T')<<8) | (u32('A')<<16) | (u32('T')<<24) -PART_SHADER_HASH :: u32('H') | (u32('A')<<8) | (u32('S')<<16) | (u32('H')<<24) -PART_INPUT_SIGNATURE :: u32('I') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) -PART_OUTPUT_SIGNATURE :: u32('O') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) -PART_PATCH_CONSTANT_SIGNATURE :: u32('P') | (u32('S')<<8) | (u32('G')<<16) | (u32('1')<<24) - -ARG_DEBUG :: "-Zi" -ARG_SKIP_VALIDATION :: "-Vd" -ARG_SKIP_OPTIMIZATIONS :: "-Od" -ARG_PACK_MATRIX_ROW_MAJOR :: "-Zpr" -ARG_PACK_MATRIX_COLUMN_MAJOR :: "-Zpc" -ARG_AVOID_FLOW_CONTROL :: "-Gfa" -ARG_PREFER_FLOW_CONTROL :: "-Gfp" -ARG_ENABLE_STRICTNESS :: "-Ges" -ARG_ENABLE_BACKWARDS_COMPATIBILITY :: "-Gec" -ARG_IEEE_STRICTNESS :: "-Gis" -ARG_OPTIMIZATION_LEVEL0 :: "-O0" -ARG_OPTIMIZATION_LEVEL1 :: "-O1" -ARG_OPTIMIZATION_LEVEL2 :: "-O2" -ARG_OPTIMIZATION_LEVEL3 :: "-O3" -ARG_WARNINGS_ARE_ERRORS :: "-WX" -ARG_RESOURCES_MAY_ALIAS :: "-res_may_alias" -ARG_ALL_RESOURCES_BOUND :: "-all_resources_bound" -ARG_DEBUG_NAME_FOR_SOURCE :: "-Zss" -ARG_DEBUG_NAME_FOR_BINARY :: "-Zsb" - -EXTRA_OUTPUT_NAME_STDOUT :: "*stdout*" -EXTRA_OUTPUT_NAME_STDERR :: "*stderr*" diff --git a/vendor/directx/dxc/dxcdef_unix.odin b/vendor/directx/dxc/dxcdef_unix.odin new file mode 100644 index 000000000..649bb8a13 --- /dev/null +++ b/vendor/directx/dxc/dxcdef_unix.odin @@ -0,0 +1,37 @@ +//+build linux, darwin +package directx_dxc +import "core:c" + +FILETIME :: struct { + dwLowDateTime: DWORD, + dwHighDateTime: DWORD, +} + +GUID :: struct { + Data1: DWORD, + Data2: WORD, + Data3: WORD, + Data4: [8]BYTE, +} + +BYTE :: distinct u8 +WORD :: u16 +DWORD :: u32 +BOOL :: distinct b32 +SIZE_T :: uint +ULONG :: c.ulong +CLSID :: GUID +IID :: GUID +LONG :: distinct c.long +HRESULT :: distinct LONG +wstring :: [^]c.wchar_t +BSTR :: wstring + +IUnknown :: struct { + using _iunknown_vtable: ^IUnknown_VTable, +} +IUnknown_VTable :: struct { + QueryInterface: proc "c" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT, + AddRef: proc "c" (this: ^IUnknown) -> ULONG, + Release: proc "c" (this: ^IUnknown) -> ULONG, +} diff --git a/vendor/directx/dxc/dxcdef_windows.odin b/vendor/directx/dxc/dxcdef_windows.odin new file mode 100644 index 000000000..16e6f6566 --- /dev/null +++ b/vendor/directx/dxc/dxcdef_windows.odin @@ -0,0 +1,16 @@ +//+build windows +package directx_dxc +import win32 "core:sys/windows" +import dxgi "vendor:directx/dxgi" + +BOOL :: dxgi.BOOL +SIZE_T :: dxgi.SIZE_T +ULONG :: dxgi.ULONG +CLSID :: dxgi.GUID +IID :: dxgi.IID +HRESULT :: dxgi.HRESULT +IUnknown :: dxgi.IUnknown +IUnknown_VTable :: dxgi.IUnknown_VTable +wstring :: win32.wstring +FILETIME :: win32.FILETIME +BSTR :: wstring