Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
4.6 KiB

  1. //========== Copyright � Valve Corporation, All rights reserved. ========
  2. #ifndef IMAGEFORMAT_DECLARATIONS_HDR
  3. #define IMAGEFORMAT_DECLARATIONS_HDR
  4. enum NormalDecodeMode_t
  5. {
  6. NORMAL_DECODE_NONE = 0,
  7. NORMAL_DECODE_ATI2N = 1,
  8. NORMAL_DECODE_ATI2N_ALPHA = 2
  9. };
  10. // Forward declaration
  11. #ifdef _WIN32
  12. typedef enum _D3DFORMAT D3DFORMAT;
  13. typedef enum DXGI_FORMAT;
  14. #endif
  15. //-----------------------------------------------------------------------------
  16. // The various image format types
  17. //-----------------------------------------------------------------------------
  18. // don't bitch that inline functions aren't used!!!!
  19. #ifndef SPU
  20. #pragma warning(disable : 4514)
  21. #endif
  22. enum ImageFormat
  23. {
  24. IMAGE_FORMAT_DEFAULT = -2, // Use this image format if you want to perform tool operations on the texture
  25. IMAGE_FORMAT_UNKNOWN = -1,
  26. IMAGE_FORMAT_RGBA8888 = 0,
  27. IMAGE_FORMAT_ABGR8888,
  28. IMAGE_FORMAT_RGB888,
  29. IMAGE_FORMAT_BGR888,
  30. IMAGE_FORMAT_RGB565,
  31. IMAGE_FORMAT_I8,
  32. IMAGE_FORMAT_IA88,
  33. IMAGE_FORMAT_P8,
  34. IMAGE_FORMAT_A8,
  35. IMAGE_FORMAT_RGB888_BLUESCREEN,
  36. IMAGE_FORMAT_BGR888_BLUESCREEN,
  37. IMAGE_FORMAT_ARGB8888,
  38. IMAGE_FORMAT_BGRA8888,
  39. IMAGE_FORMAT_DXT1,
  40. IMAGE_FORMAT_DXT3,
  41. IMAGE_FORMAT_DXT5,
  42. IMAGE_FORMAT_BGRX8888,
  43. IMAGE_FORMAT_BGR565,
  44. IMAGE_FORMAT_BGRX5551,
  45. IMAGE_FORMAT_BGRA4444,
  46. IMAGE_FORMAT_DXT1_ONEBITALPHA,
  47. IMAGE_FORMAT_BGRA5551,
  48. IMAGE_FORMAT_UV88,
  49. IMAGE_FORMAT_UVWQ8888,
  50. IMAGE_FORMAT_RGBA16161616F,
  51. IMAGE_FORMAT_RGBA16161616,
  52. IMAGE_FORMAT_UVLX8888,
  53. IMAGE_FORMAT_R32F, // Single-channel 32-bit floating point
  54. IMAGE_FORMAT_RGB323232F, // NOTE: D3D9 does not have this format
  55. IMAGE_FORMAT_RGBA32323232F,
  56. IMAGE_FORMAT_RG1616F,
  57. IMAGE_FORMAT_RG3232F,
  58. IMAGE_FORMAT_RGBX8888,
  59. IMAGE_FORMAT_NULL, // Dummy format which takes no video memory
  60. // Compressed normal map formats
  61. IMAGE_FORMAT_ATI2N, // One-surface ATI2N / DXN format
  62. IMAGE_FORMAT_ATI1N, // Two-surface ATI1N format
  63. IMAGE_FORMAT_RGBA1010102, // 10 bit-per component render targets
  64. IMAGE_FORMAT_BGRA1010102,
  65. IMAGE_FORMAT_R16F, // 16 bit FP format
  66. // Depth-stencil texture formats
  67. IMAGE_FORMAT_D16,
  68. IMAGE_FORMAT_D15S1,
  69. IMAGE_FORMAT_D32,
  70. IMAGE_FORMAT_D24S8,
  71. IMAGE_FORMAT_LINEAR_D24S8,
  72. IMAGE_FORMAT_D24X8,
  73. IMAGE_FORMAT_D24X4S4,
  74. IMAGE_FORMAT_D24FS8,
  75. IMAGE_FORMAT_D16_SHADOW, // Specific formats for shadow mapping
  76. IMAGE_FORMAT_D24X8_SHADOW, // Specific formats for shadow mapping
  77. // supporting these specific formats as non-tiled for procedural cpu access (360-specific)
  78. IMAGE_FORMAT_LINEAR_BGRX8888,
  79. IMAGE_FORMAT_LINEAR_RGBA8888,
  80. IMAGE_FORMAT_LINEAR_ABGR8888,
  81. IMAGE_FORMAT_LINEAR_ARGB8888,
  82. IMAGE_FORMAT_LINEAR_BGRA8888,
  83. IMAGE_FORMAT_LINEAR_RGB888,
  84. IMAGE_FORMAT_LINEAR_BGR888,
  85. IMAGE_FORMAT_LINEAR_BGRX5551,
  86. IMAGE_FORMAT_LINEAR_I8,
  87. IMAGE_FORMAT_LINEAR_RGBA16161616,
  88. IMAGE_FORMAT_LINEAR_A8,
  89. IMAGE_FORMAT_LINEAR_DXT1,
  90. IMAGE_FORMAT_LINEAR_DXT3,
  91. IMAGE_FORMAT_LINEAR_DXT5,
  92. IMAGE_FORMAT_LE_BGRX8888,
  93. IMAGE_FORMAT_LE_BGRA8888,
  94. // these are used for runtime conversion to DXT1/5
  95. IMAGE_FORMAT_DXT1_RUNTIME,
  96. IMAGE_FORMAT_DXT5_RUNTIME,
  97. // special depth format
  98. IMAGE_FORMAT_INTZ,
  99. NUM_IMAGE_FORMATS
  100. };
  101. #if defined( DX_TO_GL_ABSTRACTION ) || defined( _PS3 )
  102. typedef enum _D3DFORMAT
  103. {
  104. D3DFMT_INDEX16,
  105. D3DFMT_D16,
  106. D3DFMT_D24S8,
  107. D3DFMT_A8R8G8B8,
  108. D3DFMT_A4R4G4B4,
  109. D3DFMT_X8R8G8B8,
  110. D3DFMT_R5G6R5,
  111. D3DFMT_X1R5G5B5,
  112. D3DFMT_A1R5G5B5,
  113. D3DFMT_L8,
  114. D3DFMT_A8L8,
  115. D3DFMT_A,
  116. D3DFMT_DXT1,
  117. D3DFMT_DXT3,
  118. D3DFMT_DXT5,
  119. D3DFMT_V8U8,
  120. D3DFMT_Q8W8V8U8,
  121. D3DFMT_X8L8V8U8,
  122. D3DFMT_A16B16G16R16F,
  123. D3DFMT_A16B16G16R16,
  124. D3DFMT_R32F,
  125. D3DFMT_A32B32G32R32F,
  126. D3DFMT_R8G8B8,
  127. D3DFMT_D24X4S4,
  128. D3DFMT_A8,
  129. D3DFMT_R5G6B5,
  130. D3DFMT_D15S1,
  131. D3DFMT_D24X8,
  132. D3DFMT_VERTEXDATA,
  133. D3DFMT_INDEX32,
  134. // new d3d format enums for Source main engine (i.e Portal2, AS, Dota)
  135. D3DFMT_D24FS8,
  136. D3DFMT_A8B8G8R8,
  137. D3DFMT_P8,
  138. D3DFMT_G16R16F,
  139. D3DFMT_G32R32F,
  140. D3DFMT_X8B8G8R8,
  141. D3DFMT_A2B10G10R10,
  142. D3DFMT_A2R10G10B10,
  143. D3DFMT_R16F,
  144. D3DFMT_D32,
  145. // adding fake D3D format names for the vendor specific ones (eases debugging/logging)
  146. // NV shadow depth tex
  147. D3DFMT_NV_INTZ = 0x5a544e49, // MAKEFOURCC('I','N','T','Z')
  148. D3DFMT_NV_RAWZ = 0x5a574152, // MAKEFOURCC('R','A','W','Z')
  149. // NV null tex
  150. D3DFMT_NV_NULL = 0x4c4c554e, // MAKEFOURCC('N','U','L','L')
  151. // ATI shadow depth tex
  152. D3DFMT_ATI_D16 = 0x36314644, // MAKEFOURCC('D','F','1','6')
  153. D3DFMT_ATI_D24S8 = 0x34324644, // MAKEFOURCC('D','F','2','4')
  154. // ATI 1N and 2N compressed tex
  155. D3DFMT_ATI_2N = 0x32495441, // MAKEFOURCC('A', 'T', 'I', '2')
  156. D3DFMT_ATI_1N = 0x31495441, // MAKEFOURCC('A', 'T', 'I', '1')
  157. D3DFMT_UNKNOWN
  158. } D3DFORMAT;
  159. #endif
  160. #endif