dxctools.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. struct __declspec(uuid("c012115b-8893-4eb9-9c5a-111456ea1c45"))
  22. 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. DECLARE_CROSS_PLATFORM_UUIDOF(IDxcRewriter)
  42. };
  43. #ifdef _MSC_VER
  44. #define EXTERN extern
  45. #else
  46. #define EXTERN
  47. #endif
  48. __declspec(selectany)
  49. EXTERN const CLSID CLSID_DxcRewriter = { /* b489b951-e07f-40b3-968d-93e124734da4 */
  50. 0xb489b951,
  51. 0xe07f,
  52. 0x40b3,
  53. { 0x96, 0x8d, 0x93, 0xe1, 0x24, 0x73, 0x4d, 0xa4 }
  54. };
  55. struct __declspec(uuid("261afca1-0609-4ec6-a77f-d98c7035194e"))
  56. IDxcRewriter2 : public IDxcRewriter {
  57. virtual HRESULT STDMETHODCALLTYPE RewriteWithOptions(_In_ IDxcBlobEncoding *pSource,
  58. // Optional file name for pSource. Used in errors and include handlers.
  59. _In_opt_ LPCWSTR pSourceName,
  60. // Compiler arguments
  61. _In_count_(argCount) LPCWSTR *pArguments, _In_ UINT32 argCount,
  62. // Defines
  63. _In_count_(defineCount) DxcDefine *pDefines, _In_ UINT32 defineCount,
  64. // user-provided interface to handle #include directives (optional)
  65. _In_opt_ IDxcIncludeHandler *pIncludeHandler,
  66. _COM_Outptr_ IDxcOperationResult **ppResult) = 0;
  67. DECLARE_CROSS_PLATFORM_UUIDOF(IDxcRewriter2)
  68. };
  69. #endif