ErrorCodes.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // ErrorCodes.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 error code values for the DirectX compiler and tools. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. // Redeclare some macros to not depend on winerror.h
  13. #define DXC_SEVERITY_ERROR 1
  14. #define DXC_MAKE_HRESULT(sev, fac, code) \
  15. ((HRESULT)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | \
  16. ((unsigned long)(code))))
  17. #define HRESULT_IS_WIN32ERR(hr) \
  18. ((HRESULT)(hr & 0xFFFF0000) == \
  19. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, 0))
  20. #define HRESULT_AS_WIN32ERR(hr) (HRESULT_CODE(hr))
  21. // Error codes from C libraries (0n150) - 0x8096xxxx
  22. #define FACILITY_ERRNO (0x96)
  23. #define HRESULT_FROM_ERRNO(x) \
  24. MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_ERRNO, (x))
  25. // Error codes from DXC libraries (0n170) - 0x8013xxxx
  26. #define FACILITY_DXC (0xAA)
  27. // 0x00000000 - The operation succeeded.
  28. #define DXC_S_OK 0 // _HRESULT_TYPEDEF_(0x00000000L)
  29. // 0x80AA0001 - The operation failed because overlapping semantics were found.
  30. #define DXC_E_OVERLAPPING_SEMANTICS \
  31. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0001))
  32. // 0x80AA0002 - The operation failed because multiple depth semantics were
  33. // found.
  34. #define DXC_E_MULTIPLE_DEPTH_SEMANTICS \
  35. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0002))
  36. // 0x80AA0003 - Input file is too large.
  37. #define DXC_E_INPUT_FILE_TOO_LARGE \
  38. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0003))
  39. // 0x80AA0004 - Error parsing DXBC container.
  40. #define DXC_E_INCORRECT_DXBC \
  41. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0004))
  42. // 0x80AA0005 - Error parsing DXBC bytecode.
  43. #define DXC_E_ERROR_PARSING_DXBC_BYTECODE \
  44. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0005))
  45. // 0x80AA0006 - Data is too large.
  46. #define DXC_E_DATA_TOO_LARGE \
  47. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0006))
  48. // 0x80AA0007 - Incompatible converter options.
  49. #define DXC_E_INCOMPATIBLE_CONVERTER_OPTIONS \
  50. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0007))
  51. // 0x80AA0008 - Irreducible control flow graph.
  52. #define DXC_E_IRREDUCIBLE_CFG \
  53. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0008))
  54. // 0x80AA0009 - IR verification error.
  55. #define DXC_E_IR_VERIFICATION_FAILED \
  56. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0009))
  57. // 0x80AA000A - Scope-nested control flow recovery failed.
  58. #define DXC_E_SCOPE_NESTED_FAILED \
  59. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000A))
  60. // 0x80AA000B - Operation is not supported.
  61. #define DXC_E_NOT_SUPPORTED \
  62. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000B))
  63. // 0x80AA000C - Unable to encode string.
  64. #define DXC_E_STRING_ENCODING_FAILED \
  65. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000C))
  66. // 0x80AA000D - DXIL container is invalid.
  67. #define DXC_E_CONTAINER_INVALID \
  68. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000D))
  69. // 0x80AA000E - DXIL container is missing the DXIL part.
  70. #define DXC_E_CONTAINER_MISSING_DXIL \
  71. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000E))
  72. // 0x80AA000F - Unable to parse DxilModule metadata.
  73. #define DXC_E_INCORRECT_DXIL_METADATA \
  74. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x000F))
  75. // 0x80AA0010 - Error parsing DDI signature.
  76. #define DXC_E_INCORRECT_DDI_SIGNATURE \
  77. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0010))
  78. // 0x80AA0011 - Duplicate part exists in dxil container.
  79. #define DXC_E_DUPLICATE_PART \
  80. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0011))
  81. // 0x80AA0012 - Error finding part in dxil container.
  82. #define DXC_E_MISSING_PART \
  83. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0012))
  84. // 0x80AA0013 - Malformed DXIL Container.
  85. #define DXC_E_MALFORMED_CONTAINER \
  86. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0013))
  87. // 0x80AA0014 - Incorrect Root Signature for shader.
  88. #define DXC_E_INCORRECT_ROOT_SIGNATURE \
  89. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0014))
  90. // 0X80AA0015 - DXIL container is missing DebugInfo part.
  91. #define DXC_E_CONTAINER_MISSING_DEBUG \
  92. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0015))
  93. // 0X80AA0016 - Unexpected failure in macro expansion.
  94. #define DXC_E_MACRO_EXPANSION_FAILURE \
  95. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0016))
  96. // 0X80AA0017 - DXIL optimization pass failed.
  97. #define DXC_E_OPTIMIZATION_FAILED \
  98. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0017))
  99. // 0X80AA0018 - General internal error.
  100. #define DXC_E_GENERAL_INTERNAL_ERROR \
  101. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0018))
  102. // 0X80AA0019 - Abort compilation error.
  103. #define DXC_E_ABORT_COMPILATION_ERROR \
  104. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x0019))
  105. // 0X80AA001A - Error in extension mechanism.
  106. #define DXC_E_EXTENSION_ERROR \
  107. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x001A))
  108. // 0X80AA001B - LLVM Fatal Error
  109. #define DXC_E_LLVM_FATAL_ERROR \
  110. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x001B))
  111. // 0X80AA001C - LLVM Unreachable code
  112. #define DXC_E_LLVM_UNREACHABLE \
  113. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x001C))
  114. // 0X80AA001D - LLVM Cast Failure
  115. #define DXC_E_LLVM_CAST_ERROR \
  116. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x001D))
  117. // 0X80AA001E - External validator (DXIL.dll) required, and missing.
  118. #define DXC_E_VALIDATOR_MISSING \
  119. DXC_MAKE_HRESULT(DXC_SEVERITY_ERROR, FACILITY_DXC, (0x001E))