DxbcConverter.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxbcConverter.h //
  4. // Copyright (C) Microsoft. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // Provides declarations for the DirectX DXBC to DXIL converter component. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #ifndef __DXBC_CONVERTER__H__
  12. #define __DXBC_CONVERTER__H__
  13. #ifndef _MSC_VER
  14. extern "C"
  15. #endif
  16. DXC_API_IMPORT HRESULT __stdcall DxcCreateInstance(
  17. _In_ REFCLSID rclsid,
  18. _In_ REFIID riid,
  19. _Out_ LPVOID* ppv
  20. );
  21. #ifndef _MSC_VER
  22. extern "C"
  23. #endif
  24. DXC_API_IMPORT HRESULT __stdcall DxcCreateInstance2(
  25. _In_ IMalloc *pMalloc,
  26. _In_ REFCLSID rclsid,
  27. _In_ REFIID riid,
  28. _Out_ LPVOID* ppv
  29. );
  30. struct __declspec(uuid("5F956ED5-78D1-4B15-8247-F7187614A041"))
  31. IDxbcConverter : public IUnknown {
  32. /// Create DXIL container out of DXBC shader blob.
  33. virtual HRESULT STDMETHODCALLTYPE Convert(
  34. _In_reads_bytes_(DxbcSize) LPCVOID pDxbc,
  35. _In_ UINT32 DxbcSize,
  36. _In_opt_z_ LPCWSTR pExtraOptions,
  37. _Outptr_result_bytebuffer_maybenull_(*pDxilSize) LPVOID *ppDxil,
  38. _Out_ UINT32 *pDxilSize,
  39. _Outptr_result_maybenull_z_ LPWSTR *ppDiag) = 0;
  40. /// Create DXIL LLVM module out of DXBC bytecode and DDI I/O signatures.
  41. /// This is for driver consumption only.
  42. virtual HRESULT STDMETHODCALLTYPE ConvertInDriver(
  43. _In_reads_bytes_(pBytecode[1]) const UINT32 *pBytecode,
  44. _In_opt_z_ LPCVOID pInputSignature,
  45. _In_ UINT32 NumInputSignatureElements,
  46. _In_opt_z_ LPCVOID pOutputSignature,
  47. _In_ UINT32 NumOutputSignatureElements,
  48. _In_opt_z_ LPCVOID pPatchConstantSignature,
  49. _In_ UINT32 NumPatchConstantSignatureElements,
  50. _In_opt_z_ LPCWSTR pExtraOptions,
  51. _Out_ IDxcBlob **ppDxilModule,
  52. _Outptr_result_maybenull_z_ LPWSTR *ppDiag) = 0;
  53. };
  54. __declspec(selectany)
  55. extern const CLSID CLSID_DxbcConverter = { /* 4900391E-B752-4EDD-A885-6FB76E25ADDB */
  56. 0x4900391e,
  57. 0xb752,
  58. 0x4edd,
  59. { 0xa8, 0x85, 0x6f, 0xb7, 0x6e, 0x25, 0xad, 0xdb }
  60. };
  61. #endif