dxctools.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. };
  42. __declspec(selectany)
  43. extern const CLSID CLSID_DxcRewriter = { /* b489b951-e07f-40b3-968d-93e124734da4 */
  44. 0xb489b951,
  45. 0xe07f,
  46. 0x40b3,
  47. { 0x96, 0x8d, 0x93, 0xe1, 0x24, 0x73, 0x4d, 0xa4 }
  48. };
  49. #endif