dxctools.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // dxctools.h //
  4. // Copyright (C) Microsoft Corporation. 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 Compiler tooling components. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #ifndef __DXC_TOOLS__
  12. #define __DXC_TOOLS__
  13. #include <dxc/dxcapi.h>
  14. enum RewriterOptionMask {
  15. Default = 0,
  16. SkipFunctionBody = 1,
  17. SkipStatic = 2,
  18. GlobalExternByDefault = 4,
  19. KeepUserMacro = 8,
  20. };
  21. CROSS_PLATFORM_UUIDOF(IDxcRewriter, "c012115b-8893-4eb9-9c5a-111456ea1c45")
  22. struct IDxcRewriter : public IUnknown {
  23. virtual HRESULT STDMETHODCALLTYPE RemoveUnusedGlobals(_In_ IDxcBlobEncoding *pSource,
  24. _In_z_ LPCWSTR entryPoint,
  25. _In_count_(defineCount) DxcDefine *pDefines,
  26. _In_ UINT32 defineCount,
  27. _COM_Outptr_ IDxcOperationResult **ppResult) = 0;
  28. virtual HRESULT STDMETHODCALLTYPE RewriteUnchanged(_In_ IDxcBlobEncoding *pSource,
  29. _In_count_(defineCount) DxcDefine *pDefines,
  30. _In_ UINT32 defineCount,
  31. _COM_Outptr_ IDxcOperationResult **ppResult) = 0;
  32. virtual HRESULT STDMETHODCALLTYPE RewriteUnchangedWithInclude(_In_ IDxcBlobEncoding *pSource,
  33. // Optional file name for pSource. Used in errors and include handlers.
  34. _In_opt_ LPCWSTR pSourceName,
  35. _In_count_(defineCount) DxcDefine *pDefines,
  36. _In_ UINT32 defineCount,
  37. // user-provided interface to handle #include directives (optional)
  38. _In_opt_ IDxcIncludeHandler *pIncludeHandler,
  39. _In_ UINT32 rewriteOption,
  40. _COM_Outptr_ IDxcOperationResult **ppResult) = 0;
  41. };
  42. #ifdef _MSC_VER
  43. #define CLSID_SCOPE __declspec(selectany) extern
  44. #else
  45. #define CLSID_SCOPE
  46. #endif
  47. CLSID_SCOPE const CLSID
  48. CLSID_DxcRewriter = {/* b489b951-e07f-40b3-968d-93e124734da4 */
  49. 0xb489b951,
  50. 0xe07f,
  51. 0x40b3,
  52. {0x96, 0x8d, 0x93, 0xe1, 0x24, 0x73, 0x4d, 0xa4}};
  53. CROSS_PLATFORM_UUIDOF(IDxcRewriter2, "261afca1-0609-4ec6-a77f-d98c7035194e")
  54. struct IDxcRewriter2 : public IDxcRewriter {
  55. virtual HRESULT STDMETHODCALLTYPE RewriteWithOptions(_In_ IDxcBlobEncoding *pSource,
  56. // Optional file name for pSource. Used in errors and include handlers.
  57. _In_opt_ LPCWSTR pSourceName,
  58. // Compiler arguments
  59. _In_count_(argCount) LPCWSTR *pArguments, _In_ UINT32 argCount,
  60. // Defines
  61. _In_count_(defineCount) DxcDefine *pDefines, _In_ UINT32 defineCount,
  62. // user-provided interface to handle #include directives (optional)
  63. _In_opt_ IDxcIncludeHandler *pIncludeHandler,
  64. _COM_Outptr_ IDxcOperationResult **ppResult) = 0;
  65. };
  66. #endif