types.d 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. /*
  2. *
  3. * AUTO GENERATED! DO NOT EDIT!
  4. *
  5. */
  6. module bindbc.bgfx.types;
  7. public import core.stdc.stdarg : va_list;
  8. extern(C) @nogc nothrow:
  9. enum uint BGFX_API_VERSION = 114;
  10. alias bgfx_view_id_t = ushort;
  11. /// Memory release callback.
  12. /// Color RGB/alpha/depth write. When it's not specified write will be disabled.
  13. enum ulong BGFX_STATE_WRITE_R = 0x0000000000000001; /// Enable R write.
  14. enum ulong BGFX_STATE_WRITE_G = 0x0000000000000002; /// Enable G write.
  15. enum ulong BGFX_STATE_WRITE_B = 0x0000000000000004; /// Enable B write.
  16. enum ulong BGFX_STATE_WRITE_A = 0x0000000000000008; /// Enable alpha write.
  17. enum ulong BGFX_STATE_WRITE_Z = 0x0000004000000000; /// Enable depth write.
  18. enum ulong BGFX_STATE_WRITE_RGB = 0x0000000000000007; /// Enable RGB write.
  19. enum ulong BGFX_STATE_WRITE_MASK = 0x000000400000000f; /// Write all channels mask.
  20. /// Depth test state. When `BGFX_STATE_DEPTH_` is not specified depth test will be disabled.
  21. enum ulong BGFX_STATE_DEPTH_TEST_LESS = 0x0000000000000010; /// Enable depth test, less.
  22. enum ulong BGFX_STATE_DEPTH_TEST_LEQUAL = 0x0000000000000020; /// Enable depth test, less or equal.
  23. enum ulong BGFX_STATE_DEPTH_TEST_EQUAL = 0x0000000000000030; /// Enable depth test, equal.
  24. enum ulong BGFX_STATE_DEPTH_TEST_GEQUAL = 0x0000000000000040; /// Enable depth test, greater or equal.
  25. enum ulong BGFX_STATE_DEPTH_TEST_GREATER = 0x0000000000000050; /// Enable depth test, greater.
  26. enum ulong BGFX_STATE_DEPTH_TEST_NOTEQUAL = 0x0000000000000060; /// Enable depth test, not equal.
  27. enum ulong BGFX_STATE_DEPTH_TEST_NEVER = 0x0000000000000070; /// Enable depth test, never.
  28. enum ulong BGFX_STATE_DEPTH_TEST_ALWAYS = 0x0000000000000080; /// Enable depth test, always.
  29. enum ulong BGFX_STATE_DEPTH_TEST_SHIFT = 4; /// Depth test state bit shift
  30. enum ulong BGFX_STATE_DEPTH_TEST_MASK = 0x00000000000000f0; /// Depth test state bit mask
  31. /**
  32. * Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)
  33. * helper macros.
  34. */
  35. enum ulong BGFX_STATE_BLEND_ZERO = 0x0000000000001000; /// 0, 0, 0, 0
  36. enum ulong BGFX_STATE_BLEND_ONE = 0x0000000000002000; /// 1, 1, 1, 1
  37. enum ulong BGFX_STATE_BLEND_SRC_COLOR = 0x0000000000003000; /// Rs, Gs, Bs, As
  38. enum ulong BGFX_STATE_BLEND_INV_SRC_COLOR = 0x0000000000004000; /// 1-Rs, 1-Gs, 1-Bs, 1-As
  39. enum ulong BGFX_STATE_BLEND_SRC_ALPHA = 0x0000000000005000; /// As, As, As, As
  40. enum ulong BGFX_STATE_BLEND_INV_SRC_ALPHA = 0x0000000000006000; /// 1-As, 1-As, 1-As, 1-As
  41. enum ulong BGFX_STATE_BLEND_DST_ALPHA = 0x0000000000007000; /// Ad, Ad, Ad, Ad
  42. enum ulong BGFX_STATE_BLEND_INV_DST_ALPHA = 0x0000000000008000; /// 1-Ad, 1-Ad, 1-Ad ,1-Ad
  43. enum ulong BGFX_STATE_BLEND_DST_COLOR = 0x0000000000009000; /// Rd, Gd, Bd, Ad
  44. enum ulong BGFX_STATE_BLEND_INV_DST_COLOR = 0x000000000000a000; /// 1-Rd, 1-Gd, 1-Bd, 1-Ad
  45. enum ulong BGFX_STATE_BLEND_SRC_ALPHA_SAT = 0x000000000000b000; /// f, f, f, 1; f = min(As, 1-Ad)
  46. enum ulong BGFX_STATE_BLEND_FACTOR = 0x000000000000c000; /// Blend factor
  47. enum ulong BGFX_STATE_BLEND_INV_FACTOR = 0x000000000000d000; /// 1-Blend factor
  48. enum ulong BGFX_STATE_BLEND_SHIFT = 12; /// Blend state bit shift
  49. enum ulong BGFX_STATE_BLEND_MASK = 0x000000000ffff000; /// Blend state bit mask
  50. /**
  51. * Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
  52. * helper macros.
  53. */
  54. enum ulong BGFX_STATE_BLEND_EQUATION_ADD = 0x0000000000000000; /// Blend add: src + dst.
  55. enum ulong BGFX_STATE_BLEND_EQUATION_SUB = 0x0000000010000000; /// Blend subtract: src - dst.
  56. enum ulong BGFX_STATE_BLEND_EQUATION_REVSUB = 0x0000000020000000; /// Blend reverse subtract: dst - src.
  57. enum ulong BGFX_STATE_BLEND_EQUATION_MIN = 0x0000000030000000; /// Blend min: min(src, dst).
  58. enum ulong BGFX_STATE_BLEND_EQUATION_MAX = 0x0000000040000000; /// Blend max: max(src, dst).
  59. enum ulong BGFX_STATE_BLEND_EQUATION_SHIFT = 28; /// Blend equation bit shift
  60. enum ulong BGFX_STATE_BLEND_EQUATION_MASK = 0x00000003f0000000; /// Blend equation bit mask
  61. /// Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
  62. enum ulong BGFX_STATE_CULL_CW = 0x0000001000000000; /// Cull clockwise triangles.
  63. enum ulong BGFX_STATE_CULL_CCW = 0x0000002000000000; /// Cull counter-clockwise triangles.
  64. enum ulong BGFX_STATE_CULL_SHIFT = 36; /// Culling mode bit shift
  65. enum ulong BGFX_STATE_CULL_MASK = 0x0000003000000000; /// Culling mode bit mask
  66. /// Alpha reference value.
  67. enum ulong BGFX_STATE_ALPHA_REF_SHIFT = 40; /// Alpha reference bit shift
  68. enum ulong BGFX_STATE_ALPHA_REF_MASK = 0x0000ff0000000000; /// Alpha reference bit mask
  69. ulong BGFX_STATE_ALPHA_REF (ulong v) { return (v << BGFX_STATE_ALPHA_REF_SHIFT) & BGFX_STATE_ALPHA_REF_MASK; }
  70. enum ulong BGFX_STATE_PT_TRISTRIP = 0x0001000000000000; /// Tristrip.
  71. enum ulong BGFX_STATE_PT_LINES = 0x0002000000000000; /// Lines.
  72. enum ulong BGFX_STATE_PT_LINESTRIP = 0x0003000000000000; /// Line strip.
  73. enum ulong BGFX_STATE_PT_POINTS = 0x0004000000000000; /// Points.
  74. enum ulong BGFX_STATE_PT_SHIFT = 48; /// Primitive type bit shift
  75. enum ulong BGFX_STATE_PT_MASK = 0x0007000000000000; /// Primitive type bit mask
  76. /// Point size value.
  77. enum ulong BGFX_STATE_POINT_SIZE_SHIFT = 52; /// Point size bit shift
  78. enum ulong BGFX_STATE_POINT_SIZE_MASK = 0x00f0000000000000; /// Point size bit mask
  79. ulong BGFX_STATE_POINT_SIZE (ulong v) { return (v << BGFX_STATE_POINT_SIZE_SHIFT) & BGFX_STATE_POINT_SIZE_MASK; }
  80. /**
  81. * Enable MSAA write when writing into MSAA frame buffer.
  82. * This flag is ignored when not writing into MSAA frame buffer.
  83. */
  84. enum ulong BGFX_STATE_MSAA = 0x0100000000000000; /// Enable MSAA rasterization.
  85. enum ulong BGFX_STATE_LINEAA = 0x0200000000000000; /// Enable line AA rasterization.
  86. enum ulong BGFX_STATE_CONSERVATIVE_RASTER = 0x0400000000000000; /// Enable conservative rasterization.
  87. enum ulong BGFX_STATE_NONE = 0x0000000000000000; /// No state.
  88. enum ulong BGFX_STATE_FRONT_CCW = 0x0000008000000000; /// Front counter-clockwise (default is clockwise).
  89. enum ulong BGFX_STATE_BLEND_INDEPENDENT = 0x0000000400000000; /// Enable blend independent.
  90. enum ulong BGFX_STATE_BLEND_ALPHA_TO_COVERAGE = 0x0000000800000000; /// Enable alpha to coverage.
  91. /**
  92. * Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
  93. * culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
  94. */
  95. enum ulong BGFX_STATE_DEFAULT = BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_Z | BGFX_STATE_DEPTH_TEST_LESS | BGFX_STATE_CULL_CW | BGFX_STATE_MSAA;
  96. enum ulong BGFX_STATE_MASK = 0xffffffffffffffff; /// State bit mask
  97. /// Do not use!
  98. enum ulong BGFX_STATE_RESERVED_SHIFT = 61;
  99. enum ulong BGFX_STATE_RESERVED_MASK = 0xe000000000000000;
  100. /// Set stencil ref value.
  101. enum uint BGFX_STENCIL_FUNC_REF_SHIFT = 0;
  102. enum uint BGFX_STENCIL_FUNC_REF_MASK = 0x000000ff;
  103. uint BGFX_STENCIL_FUNC_REF (uint v) { return (v << BGFX_STENCIL_FUNC_REF_SHIFT) & BGFX_STENCIL_FUNC_REF_MASK; }
  104. /// Set stencil rmask value.
  105. enum uint BGFX_STENCIL_FUNC_RMASK_SHIFT = 8;
  106. enum uint BGFX_STENCIL_FUNC_RMASK_MASK = 0x0000ff00;
  107. uint BGFX_STENCIL_FUNC_RMASK (uint v) { return (v << BGFX_STENCIL_FUNC_RMASK_SHIFT) & BGFX_STENCIL_FUNC_RMASK_MASK; }
  108. enum uint BGFX_STENCIL_NONE = 0x00000000;
  109. enum uint BGFX_STENCIL_MASK = 0xffffffff;
  110. enum uint BGFX_STENCIL_DEFAULT = 0x00000000;
  111. enum uint BGFX_STENCIL_TEST_LESS = 0x00010000; /// Enable stencil test, less.
  112. enum uint BGFX_STENCIL_TEST_LEQUAL = 0x00020000; /// Enable stencil test, less or equal.
  113. enum uint BGFX_STENCIL_TEST_EQUAL = 0x00030000; /// Enable stencil test, equal.
  114. enum uint BGFX_STENCIL_TEST_GEQUAL = 0x00040000; /// Enable stencil test, greater or equal.
  115. enum uint BGFX_STENCIL_TEST_GREATER = 0x00050000; /// Enable stencil test, greater.
  116. enum uint BGFX_STENCIL_TEST_NOTEQUAL = 0x00060000; /// Enable stencil test, not equal.
  117. enum uint BGFX_STENCIL_TEST_NEVER = 0x00070000; /// Enable stencil test, never.
  118. enum uint BGFX_STENCIL_TEST_ALWAYS = 0x00080000; /// Enable stencil test, always.
  119. enum uint BGFX_STENCIL_TEST_SHIFT = 16; /// Stencil test bit shift
  120. enum uint BGFX_STENCIL_TEST_MASK = 0x000f0000; /// Stencil test bit mask
  121. enum uint BGFX_STENCIL_OP_FAIL_S_ZERO = 0x00000000; /// Zero.
  122. enum uint BGFX_STENCIL_OP_FAIL_S_KEEP = 0x00100000; /// Keep.
  123. enum uint BGFX_STENCIL_OP_FAIL_S_REPLACE = 0x00200000; /// Replace.
  124. enum uint BGFX_STENCIL_OP_FAIL_S_INCR = 0x00300000; /// Increment and wrap.
  125. enum uint BGFX_STENCIL_OP_FAIL_S_INCRSAT = 0x00400000; /// Increment and clamp.
  126. enum uint BGFX_STENCIL_OP_FAIL_S_DECR = 0x00500000; /// Decrement and wrap.
  127. enum uint BGFX_STENCIL_OP_FAIL_S_DECRSAT = 0x00600000; /// Decrement and clamp.
  128. enum uint BGFX_STENCIL_OP_FAIL_S_INVERT = 0x00700000; /// Invert.
  129. enum uint BGFX_STENCIL_OP_FAIL_S_SHIFT = 20; /// Stencil operation fail bit shift
  130. enum uint BGFX_STENCIL_OP_FAIL_S_MASK = 0x00f00000; /// Stencil operation fail bit mask
  131. enum uint BGFX_STENCIL_OP_FAIL_Z_ZERO = 0x00000000; /// Zero.
  132. enum uint BGFX_STENCIL_OP_FAIL_Z_KEEP = 0x01000000; /// Keep.
  133. enum uint BGFX_STENCIL_OP_FAIL_Z_REPLACE = 0x02000000; /// Replace.
  134. enum uint BGFX_STENCIL_OP_FAIL_Z_INCR = 0x03000000; /// Increment and wrap.
  135. enum uint BGFX_STENCIL_OP_FAIL_Z_INCRSAT = 0x04000000; /// Increment and clamp.
  136. enum uint BGFX_STENCIL_OP_FAIL_Z_DECR = 0x05000000; /// Decrement and wrap.
  137. enum uint BGFX_STENCIL_OP_FAIL_Z_DECRSAT = 0x06000000; /// Decrement and clamp.
  138. enum uint BGFX_STENCIL_OP_FAIL_Z_INVERT = 0x07000000; /// Invert.
  139. enum uint BGFX_STENCIL_OP_FAIL_Z_SHIFT = 24; /// Stencil operation depth fail bit shift
  140. enum uint BGFX_STENCIL_OP_FAIL_Z_MASK = 0x0f000000; /// Stencil operation depth fail bit mask
  141. enum uint BGFX_STENCIL_OP_PASS_Z_ZERO = 0x00000000; /// Zero.
  142. enum uint BGFX_STENCIL_OP_PASS_Z_KEEP = 0x10000000; /// Keep.
  143. enum uint BGFX_STENCIL_OP_PASS_Z_REPLACE = 0x20000000; /// Replace.
  144. enum uint BGFX_STENCIL_OP_PASS_Z_INCR = 0x30000000; /// Increment and wrap.
  145. enum uint BGFX_STENCIL_OP_PASS_Z_INCRSAT = 0x40000000; /// Increment and clamp.
  146. enum uint BGFX_STENCIL_OP_PASS_Z_DECR = 0x50000000; /// Decrement and wrap.
  147. enum uint BGFX_STENCIL_OP_PASS_Z_DECRSAT = 0x60000000; /// Decrement and clamp.
  148. enum uint BGFX_STENCIL_OP_PASS_Z_INVERT = 0x70000000; /// Invert.
  149. enum uint BGFX_STENCIL_OP_PASS_Z_SHIFT = 28; /// Stencil operation depth pass bit shift
  150. enum uint BGFX_STENCIL_OP_PASS_Z_MASK = 0xf0000000; /// Stencil operation depth pass bit mask
  151. enum ushort BGFX_CLEAR_NONE = 0x0000; /// No clear flags.
  152. enum ushort BGFX_CLEAR_COLOR = 0x0001; /// Clear color.
  153. enum ushort BGFX_CLEAR_DEPTH = 0x0002; /// Clear depth.
  154. enum ushort BGFX_CLEAR_STENCIL = 0x0004; /// Clear stencil.
  155. enum ushort BGFX_CLEAR_DISCARD_COLOR_0 = 0x0008; /// Discard frame buffer attachment 0.
  156. enum ushort BGFX_CLEAR_DISCARD_COLOR_1 = 0x0010; /// Discard frame buffer attachment 1.
  157. enum ushort BGFX_CLEAR_DISCARD_COLOR_2 = 0x0020; /// Discard frame buffer attachment 2.
  158. enum ushort BGFX_CLEAR_DISCARD_COLOR_3 = 0x0040; /// Discard frame buffer attachment 3.
  159. enum ushort BGFX_CLEAR_DISCARD_COLOR_4 = 0x0080; /// Discard frame buffer attachment 4.
  160. enum ushort BGFX_CLEAR_DISCARD_COLOR_5 = 0x0100; /// Discard frame buffer attachment 5.
  161. enum ushort BGFX_CLEAR_DISCARD_COLOR_6 = 0x0200; /// Discard frame buffer attachment 6.
  162. enum ushort BGFX_CLEAR_DISCARD_COLOR_7 = 0x0400; /// Discard frame buffer attachment 7.
  163. enum ushort BGFX_CLEAR_DISCARD_DEPTH = 0x0800; /// Discard frame buffer depth attachment.
  164. enum ushort BGFX_CLEAR_DISCARD_STENCIL = 0x1000; /// Discard frame buffer stencil attachment.
  165. enum ushort BGFX_CLEAR_DISCARD_COLOR_MASK = 0x07f8;
  166. enum ushort BGFX_CLEAR_DISCARD_MASK = 0x1ff8;
  167. /**
  168. * Rendering state discard. When state is preserved in submit, rendering states can be discarded
  169. * on a finer grain.
  170. */
  171. enum ubyte BGFX_DISCARD_NONE = 0x00; /// Preserve everything.
  172. enum ubyte BGFX_DISCARD_BINDINGS = 0x01; /// Discard texture sampler and buffer bindings.
  173. enum ubyte BGFX_DISCARD_INDEX_BUFFER = 0x02; /// Discard index buffer.
  174. enum ubyte BGFX_DISCARD_INSTANCE_DATA = 0x04; /// Discard instance data.
  175. enum ubyte BGFX_DISCARD_STATE = 0x08; /// Discard state and uniform bindings.
  176. enum ubyte BGFX_DISCARD_TRANSFORM = 0x10; /// Discard transform.
  177. enum ubyte BGFX_DISCARD_VERTEX_STREAMS = 0x20; /// Discard vertex streams.
  178. enum ubyte BGFX_DISCARD_ALL = 0xff; /// Discard all states.
  179. enum uint BGFX_DEBUG_NONE = 0x00000000; /// No debug.
  180. enum uint BGFX_DEBUG_WIREFRAME = 0x00000001; /// Enable wireframe for all primitives.
  181. /**
  182. * Enable infinitely fast hardware test. No draw calls will be submitted to driver.
  183. * It's useful when profiling to quickly assess bottleneck between CPU and GPU.
  184. */
  185. enum uint BGFX_DEBUG_IFH = 0x00000002;
  186. enum uint BGFX_DEBUG_STATS = 0x00000004; /// Enable statistics display.
  187. enum uint BGFX_DEBUG_TEXT = 0x00000008; /// Enable debug text display.
  188. enum uint BGFX_DEBUG_PROFILER = 0x00000010; /// Enable profiler.
  189. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X1 = 0x0001; /// 1 8-bit value
  190. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X2 = 0x0002; /// 2 8-bit values
  191. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X4 = 0x0003; /// 4 8-bit values
  192. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X1 = 0x0004; /// 1 16-bit value
  193. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X2 = 0x0005; /// 2 16-bit values
  194. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X4 = 0x0006; /// 4 16-bit values
  195. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X1 = 0x0007; /// 1 32-bit value
  196. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X2 = 0x0008; /// 2 32-bit values
  197. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X4 = 0x0009; /// 4 32-bit values
  198. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_SHIFT = 0;
  199. enum ushort BGFX_BUFFER_COMPUTE_FORMAT_MASK = 0x000f;
  200. enum ushort BGFX_BUFFER_COMPUTE_TYPE_INT = 0x0010; /// Type `int`.
  201. enum ushort BGFX_BUFFER_COMPUTE_TYPE_UINT = 0x0020; /// Type `uint`.
  202. enum ushort BGFX_BUFFER_COMPUTE_TYPE_FLOAT = 0x0030; /// Type `float`.
  203. enum ushort BGFX_BUFFER_COMPUTE_TYPE_SHIFT = 4;
  204. enum ushort BGFX_BUFFER_COMPUTE_TYPE_MASK = 0x0030;
  205. enum ushort BGFX_BUFFER_NONE = 0x0000;
  206. enum ushort BGFX_BUFFER_COMPUTE_READ = 0x0100; /// Buffer will be read by shader.
  207. enum ushort BGFX_BUFFER_COMPUTE_WRITE = 0x0200; /// Buffer will be used for writing.
  208. enum ushort BGFX_BUFFER_DRAW_INDIRECT = 0x0400; /// Buffer will be used for storing draw indirect commands.
  209. enum ushort BGFX_BUFFER_ALLOW_RESIZE = 0x0800; /// Allow dynamic index/vertex buffer resize during update.
  210. enum ushort BGFX_BUFFER_INDEX32 = 0x1000; /// Index buffer contains 32-bit indices.
  211. enum ushort BGFX_BUFFER_COMPUTE_READ_WRITE = 0x0300;
  212. enum ulong BGFX_TEXTURE_NONE = 0x0000000000000000;
  213. enum ulong BGFX_TEXTURE_MSAA_SAMPLE = 0x0000000800000000; /// Texture will be used for MSAA sampling.
  214. enum ulong BGFX_TEXTURE_RT = 0x0000001000000000; /// Render target no MSAA.
  215. enum ulong BGFX_TEXTURE_COMPUTE_WRITE = 0x0000100000000000; /// Texture will be used for compute write.
  216. enum ulong BGFX_TEXTURE_SRGB = 0x0000200000000000; /// Sample texture as sRGB.
  217. enum ulong BGFX_TEXTURE_BLIT_DST = 0x0000400000000000; /// Texture will be used as blit destination.
  218. enum ulong BGFX_TEXTURE_READ_BACK = 0x0000800000000000; /// Texture will be used for read back from GPU.
  219. enum ulong BGFX_TEXTURE_RT_MSAA_X2 = 0x0000002000000000; /// Render target MSAAx2 mode.
  220. enum ulong BGFX_TEXTURE_RT_MSAA_X4 = 0x0000003000000000; /// Render target MSAAx4 mode.
  221. enum ulong BGFX_TEXTURE_RT_MSAA_X8 = 0x0000004000000000; /// Render target MSAAx8 mode.
  222. enum ulong BGFX_TEXTURE_RT_MSAA_X16 = 0x0000005000000000; /// Render target MSAAx16 mode.
  223. enum ulong BGFX_TEXTURE_RT_MSAA_SHIFT = 36;
  224. enum ulong BGFX_TEXTURE_RT_MSAA_MASK = 0x0000007000000000;
  225. enum ulong BGFX_TEXTURE_RT_WRITE_ONLY = 0x0000008000000000; /// Render target will be used for writing
  226. enum ulong BGFX_TEXTURE_RT_SHIFT = 36;
  227. enum ulong BGFX_TEXTURE_RT_MASK = 0x000000f000000000;
  228. /// Sampler flags.
  229. enum uint BGFX_SAMPLER_U_MIRROR = 0x00000001; /// Wrap U mode: Mirror
  230. enum uint BGFX_SAMPLER_U_CLAMP = 0x00000002; /// Wrap U mode: Clamp
  231. enum uint BGFX_SAMPLER_U_BORDER = 0x00000003; /// Wrap U mode: Border
  232. enum uint BGFX_SAMPLER_U_SHIFT = 0;
  233. enum uint BGFX_SAMPLER_U_MASK = 0x00000003;
  234. enum uint BGFX_SAMPLER_V_MIRROR = 0x00000004; /// Wrap V mode: Mirror
  235. enum uint BGFX_SAMPLER_V_CLAMP = 0x00000008; /// Wrap V mode: Clamp
  236. enum uint BGFX_SAMPLER_V_BORDER = 0x0000000c; /// Wrap V mode: Border
  237. enum uint BGFX_SAMPLER_V_SHIFT = 2;
  238. enum uint BGFX_SAMPLER_V_MASK = 0x0000000c;
  239. enum uint BGFX_SAMPLER_W_MIRROR = 0x00000010; /// Wrap W mode: Mirror
  240. enum uint BGFX_SAMPLER_W_CLAMP = 0x00000020; /// Wrap W mode: Clamp
  241. enum uint BGFX_SAMPLER_W_BORDER = 0x00000030; /// Wrap W mode: Border
  242. enum uint BGFX_SAMPLER_W_SHIFT = 4;
  243. enum uint BGFX_SAMPLER_W_MASK = 0x00000030;
  244. enum uint BGFX_SAMPLER_MIN_POINT = 0x00000040; /// Min sampling mode: Point
  245. enum uint BGFX_SAMPLER_MIN_ANISOTROPIC = 0x00000080; /// Min sampling mode: Anisotropic
  246. enum uint BGFX_SAMPLER_MIN_SHIFT = 6;
  247. enum uint BGFX_SAMPLER_MIN_MASK = 0x000000c0;
  248. enum uint BGFX_SAMPLER_MAG_POINT = 0x00000100; /// Mag sampling mode: Point
  249. enum uint BGFX_SAMPLER_MAG_ANISOTROPIC = 0x00000200; /// Mag sampling mode: Anisotropic
  250. enum uint BGFX_SAMPLER_MAG_SHIFT = 8;
  251. enum uint BGFX_SAMPLER_MAG_MASK = 0x00000300;
  252. enum uint BGFX_SAMPLER_MIP_POINT = 0x00000400; /// Mip sampling mode: Point
  253. enum uint BGFX_SAMPLER_MIP_SHIFT = 10;
  254. enum uint BGFX_SAMPLER_MIP_MASK = 0x00000400;
  255. enum uint BGFX_SAMPLER_COMPARE_LESS = 0x00010000; /// Compare when sampling depth texture: less.
  256. enum uint BGFX_SAMPLER_COMPARE_LEQUAL = 0x00020000; /// Compare when sampling depth texture: less or equal.
  257. enum uint BGFX_SAMPLER_COMPARE_EQUAL = 0x00030000; /// Compare when sampling depth texture: equal.
  258. enum uint BGFX_SAMPLER_COMPARE_GEQUAL = 0x00040000; /// Compare when sampling depth texture: greater or equal.
  259. enum uint BGFX_SAMPLER_COMPARE_GREATER = 0x00050000; /// Compare when sampling depth texture: greater.
  260. enum uint BGFX_SAMPLER_COMPARE_NOTEQUAL = 0x00060000; /// Compare when sampling depth texture: not equal.
  261. enum uint BGFX_SAMPLER_COMPARE_NEVER = 0x00070000; /// Compare when sampling depth texture: never.
  262. enum uint BGFX_SAMPLER_COMPARE_ALWAYS = 0x00080000; /// Compare when sampling depth texture: always.
  263. enum uint BGFX_SAMPLER_COMPARE_SHIFT = 16;
  264. enum uint BGFX_SAMPLER_COMPARE_MASK = 0x000f0000;
  265. enum uint BGFX_SAMPLER_BORDER_COLOR_SHIFT = 24;
  266. enum uint BGFX_SAMPLER_BORDER_COLOR_MASK = 0x0f000000;
  267. uint BGFX_SAMPLER_BORDER_COLOR (uint v) { return (v << BGFX_SAMPLER_BORDER_COLOR_SHIFT) & BGFX_SAMPLER_BORDER_COLOR_MASK; }
  268. enum uint BGFX_SAMPLER_RESERVED_SHIFT = 28;
  269. enum uint BGFX_SAMPLER_RESERVED_MASK = 0xf0000000;
  270. enum uint BGFX_SAMPLER_NONE = 0x00000000;
  271. enum uint BGFX_SAMPLER_SAMPLE_STENCIL = 0x00100000; /// Sample stencil instead of depth.
  272. enum uint BGFX_SAMPLER_POINT = BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT;
  273. enum uint BGFX_SAMPLER_UVW_MIRROR = BGFX_SAMPLER_U_MIRROR | BGFX_SAMPLER_V_MIRROR | BGFX_SAMPLER_W_MIRROR;
  274. enum uint BGFX_SAMPLER_UVW_CLAMP = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_W_CLAMP;
  275. enum uint BGFX_SAMPLER_UVW_BORDER = BGFX_SAMPLER_U_BORDER | BGFX_SAMPLER_V_BORDER | BGFX_SAMPLER_W_BORDER;
  276. enum uint BGFX_SAMPLER_BITS_MASK = BGFX_SAMPLER_U_MASK | BGFX_SAMPLER_V_MASK | BGFX_SAMPLER_W_MASK | BGFX_SAMPLER_MIN_MASK | BGFX_SAMPLER_MAG_MASK | BGFX_SAMPLER_MIP_MASK | BGFX_SAMPLER_COMPARE_MASK;
  277. enum uint BGFX_RESET_MSAA_X2 = 0x00000010; /// Enable 2x MSAA.
  278. enum uint BGFX_RESET_MSAA_X4 = 0x00000020; /// Enable 4x MSAA.
  279. enum uint BGFX_RESET_MSAA_X8 = 0x00000030; /// Enable 8x MSAA.
  280. enum uint BGFX_RESET_MSAA_X16 = 0x00000040; /// Enable 16x MSAA.
  281. enum uint BGFX_RESET_MSAA_SHIFT = 4;
  282. enum uint BGFX_RESET_MSAA_MASK = 0x00000070;
  283. enum uint BGFX_RESET_NONE = 0x00000000; /// No reset flags.
  284. enum uint BGFX_RESET_FULLSCREEN = 0x00000001; /// Not supported yet.
  285. enum uint BGFX_RESET_VSYNC = 0x00000080; /// Enable V-Sync.
  286. enum uint BGFX_RESET_MAXANISOTROPY = 0x00000100; /// Turn on/off max anisotropy.
  287. enum uint BGFX_RESET_CAPTURE = 0x00000200; /// Begin screen capture.
  288. enum uint BGFX_RESET_FLUSH_AFTER_RENDER = 0x00002000; /// Flush rendering after submitting to GPU.
  289. /**
  290. * This flag specifies where flip occurs. Default behaviour is that flip occurs
  291. * before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
  292. */
  293. enum uint BGFX_RESET_FLIP_AFTER_RENDER = 0x00004000;
  294. enum uint BGFX_RESET_SRGB_BACKBUFFER = 0x00008000; /// Enable sRGB backbuffer.
  295. enum uint BGFX_RESET_HDR10 = 0x00010000; /// Enable HDR10 rendering.
  296. enum uint BGFX_RESET_HIDPI = 0x00020000; /// Enable HiDPI rendering.
  297. enum uint BGFX_RESET_DEPTH_CLAMP = 0x00040000; /// Enable depth clamp.
  298. enum uint BGFX_RESET_SUSPEND = 0x00080000; /// Suspend rendering.
  299. enum uint BGFX_RESET_FULLSCREEN_SHIFT = 0;
  300. enum uint BGFX_RESET_FULLSCREEN_MASK = 0x00000001;
  301. enum uint BGFX_RESET_RESERVED_SHIFT = 31; /// Internal bit shift
  302. enum uint BGFX_RESET_RESERVED_MASK = 0x80000000; /// Internal bit mask
  303. enum ulong BGFX_CAPS_ALPHA_TO_COVERAGE = 0x0000000000000001; /// Alpha to coverage is supported.
  304. enum ulong BGFX_CAPS_BLEND_INDEPENDENT = 0x0000000000000002; /// Blend independent is supported.
  305. enum ulong BGFX_CAPS_COMPUTE = 0x0000000000000004; /// Compute shaders are supported.
  306. enum ulong BGFX_CAPS_CONSERVATIVE_RASTER = 0x0000000000000008; /// Conservative rasterization is supported.
  307. enum ulong BGFX_CAPS_DRAW_INDIRECT = 0x0000000000000010; /// Draw indirect is supported.
  308. enum ulong BGFX_CAPS_FRAGMENT_DEPTH = 0x0000000000000020; /// Fragment depth is available in fragment shader.
  309. enum ulong BGFX_CAPS_FRAGMENT_ORDERING = 0x0000000000000040; /// Fragment ordering is available in fragment shader.
  310. enum ulong BGFX_CAPS_GRAPHICS_DEBUGGER = 0x0000000000000080; /// Graphics debugger is present.
  311. enum ulong BGFX_CAPS_HDR10 = 0x0000000000000100; /// HDR10 rendering is supported.
  312. enum ulong BGFX_CAPS_HIDPI = 0x0000000000000200; /// HiDPI rendering is supported.
  313. enum ulong BGFX_CAPS_IMAGE_RW = 0x0000000000000400; /// Image Read/Write is supported.
  314. enum ulong BGFX_CAPS_INDEX32 = 0x0000000000000800; /// 32-bit indices are supported.
  315. enum ulong BGFX_CAPS_INSTANCING = 0x0000000000001000; /// Instancing is supported.
  316. enum ulong BGFX_CAPS_OCCLUSION_QUERY = 0x0000000000002000; /// Occlusion query is supported.
  317. enum ulong BGFX_CAPS_RENDERER_MULTITHREADED = 0x0000000000004000; /// Renderer is on separate thread.
  318. enum ulong BGFX_CAPS_SWAP_CHAIN = 0x0000000000008000; /// Multiple windows are supported.
  319. enum ulong BGFX_CAPS_TEXTURE_2D_ARRAY = 0x0000000000010000; /// 2D texture array is supported.
  320. enum ulong BGFX_CAPS_TEXTURE_3D = 0x0000000000020000; /// 3D textures are supported.
  321. enum ulong BGFX_CAPS_TEXTURE_BLIT = 0x0000000000040000; /// Texture blit is supported.
  322. enum ulong BGFX_CAPS_TEXTURE_COMPARE_RESERVED = 0x0000000000080000;
  323. enum ulong BGFX_CAPS_TEXTURE_COMPARE_LEQUAL = 0x0000000000100000; /// Texture compare less equal mode is supported.
  324. enum ulong BGFX_CAPS_TEXTURE_CUBE_ARRAY = 0x0000000000200000; /// Cubemap texture array is supported.
  325. enum ulong BGFX_CAPS_TEXTURE_DIRECT_ACCESS = 0x0000000000400000; /// CPU direct access to GPU texture memory.
  326. enum ulong BGFX_CAPS_TEXTURE_READ_BACK = 0x0000000000800000; /// Read-back texture is supported.
  327. enum ulong BGFX_CAPS_VERTEX_ATTRIB_HALF = 0x0000000001000000; /// Vertex attribute half-float is supported.
  328. enum ulong BGFX_CAPS_VERTEX_ATTRIB_UINT10 = 0x0000000002000000; /// Vertex attribute 10_10_10_2 is supported.
  329. enum ulong BGFX_CAPS_VERTEX_ID = 0x0000000004000000; /// Rendering with VertexID only is supported.
  330. enum ulong BGFX_CAPS_VIEWPORT_LAYER_ARRAY = 0x0000000008000000; /// Viewport layer is available in vertex shader.
  331. enum ulong BGFX_CAPS_TEXTURE_COMPARE_ALL = 0x0000000000180000; /// All texture compare modes are supported.
  332. enum uint BGFX_CAPS_FORMAT_TEXTURE_NONE = 0x00000000; /// Texture format is not supported.
  333. enum uint BGFX_CAPS_FORMAT_TEXTURE_2D = 0x00000001; /// Texture format is supported.
  334. enum uint BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB = 0x00000002; /// Texture as sRGB format is supported.
  335. enum uint BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED = 0x00000004; /// Texture format is emulated.
  336. enum uint BGFX_CAPS_FORMAT_TEXTURE_3D = 0x00000008; /// Texture format is supported.
  337. enum uint BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB = 0x00000010; /// Texture as sRGB format is supported.
  338. enum uint BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED = 0x00000020; /// Texture format is emulated.
  339. enum uint BGFX_CAPS_FORMAT_TEXTURE_CUBE = 0x00000040; /// Texture format is supported.
  340. enum uint BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB = 0x00000080; /// Texture as sRGB format is supported.
  341. enum uint BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED = 0x00000100; /// Texture format is emulated.
  342. enum uint BGFX_CAPS_FORMAT_TEXTURE_VERTEX = 0x00000200; /// Texture format can be used from vertex shader.
  343. enum uint BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ = 0x00000400; /// Texture format can be used as image and read from.
  344. enum uint BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE = 0x00000800; /// Texture format can be used as image and written to.
  345. enum uint BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER = 0x00001000; /// Texture format can be used as frame buffer.
  346. enum uint BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA = 0x00002000; /// Texture format can be used as MSAA frame buffer.
  347. enum uint BGFX_CAPS_FORMAT_TEXTURE_MSAA = 0x00004000; /// Texture can be sampled as MSAA.
  348. enum uint BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN = 0x00008000; /// Texture format supports auto-generated mips.
  349. enum ubyte BGFX_RESOLVE_NONE = 0x00; /// No resolve flags.
  350. enum ubyte BGFX_RESOLVE_AUTO_GEN_MIPS = 0x01; /// Auto-generate mip maps on resolve.
  351. enum ushort BGFX_PCI_ID_NONE = 0x0000; /// Autoselect adapter.
  352. enum ushort BGFX_PCI_ID_SOFTWARE_RASTERIZER = 0x0001; /// Software rasterizer.
  353. enum ushort BGFX_PCI_ID_AMD = 0x1002; /// AMD adapter.
  354. enum ushort BGFX_PCI_ID_INTEL = 0x8086; /// Intel adapter.
  355. enum ushort BGFX_PCI_ID_NVIDIA = 0x10de; /// nVidia adapter.
  356. enum ubyte BGFX_CUBE_MAP_POSITIVE_X = 0x00; /// Cubemap +x.
  357. enum ubyte BGFX_CUBE_MAP_NEGATIVE_X = 0x01; /// Cubemap -x.
  358. enum ubyte BGFX_CUBE_MAP_POSITIVE_Y = 0x02; /// Cubemap +y.
  359. enum ubyte BGFX_CUBE_MAP_NEGATIVE_Y = 0x03; /// Cubemap -y.
  360. enum ubyte BGFX_CUBE_MAP_POSITIVE_Z = 0x04; /// Cubemap +z.
  361. enum ubyte BGFX_CUBE_MAP_NEGATIVE_Z = 0x05; /// Cubemap -z.
  362. /// Fatal error enum.
  363. enum bgfx_fatal_t
  364. {
  365. BGFX_FATAL_DEBUGCHECK,
  366. BGFX_FATAL_INVALIDSHADER,
  367. BGFX_FATAL_UNABLETOINITIALIZE,
  368. BGFX_FATAL_UNABLETOCREATETEXTURE,
  369. BGFX_FATAL_DEVICELOST,
  370. BGFX_FATAL_COUNT
  371. }
  372. /// Renderer backend type enum.
  373. enum bgfx_renderer_type_t
  374. {
  375. BGFX_RENDERER_TYPE_NOOP, /// No rendering.
  376. BGFX_RENDERER_TYPE_DIRECT3D9, /// Direct3D 9.0
  377. BGFX_RENDERER_TYPE_DIRECT3D11, /// Direct3D 11.0
  378. BGFX_RENDERER_TYPE_DIRECT3D12, /// Direct3D 12.0
  379. BGFX_RENDERER_TYPE_GNM, /// GNM
  380. BGFX_RENDERER_TYPE_METAL, /// Metal
  381. BGFX_RENDERER_TYPE_NVN, /// NVN
  382. BGFX_RENDERER_TYPE_OPENGLES, /// OpenGL ES 2.0+
  383. BGFX_RENDERER_TYPE_OPENGL, /// OpenGL 2.1+
  384. BGFX_RENDERER_TYPE_VULKAN, /// Vulkan
  385. BGFX_RENDERER_TYPE_WEBGPU, /// WebGPU
  386. BGFX_RENDERER_TYPE_COUNT
  387. }
  388. /// Access mode enum.
  389. enum bgfx_access_t
  390. {
  391. BGFX_ACCESS_READ, /// Read.
  392. BGFX_ACCESS_WRITE, /// Write.
  393. BGFX_ACCESS_READWRITE, /// Read and write.
  394. BGFX_ACCESS_COUNT
  395. }
  396. /// Vertex attribute enum.
  397. enum bgfx_attrib_t
  398. {
  399. BGFX_ATTRIB_POSITION, /// a_position
  400. BGFX_ATTRIB_NORMAL, /// a_normal
  401. BGFX_ATTRIB_TANGENT, /// a_tangent
  402. BGFX_ATTRIB_BITANGENT, /// a_bitangent
  403. BGFX_ATTRIB_COLOR0, /// a_color0
  404. BGFX_ATTRIB_COLOR1, /// a_color1
  405. BGFX_ATTRIB_COLOR2, /// a_color2
  406. BGFX_ATTRIB_COLOR3, /// a_color3
  407. BGFX_ATTRIB_INDICES, /// a_indices
  408. BGFX_ATTRIB_WEIGHT, /// a_weight
  409. BGFX_ATTRIB_TEXCOORD0, /// a_texcoord0
  410. BGFX_ATTRIB_TEXCOORD1, /// a_texcoord1
  411. BGFX_ATTRIB_TEXCOORD2, /// a_texcoord2
  412. BGFX_ATTRIB_TEXCOORD3, /// a_texcoord3
  413. BGFX_ATTRIB_TEXCOORD4, /// a_texcoord4
  414. BGFX_ATTRIB_TEXCOORD5, /// a_texcoord5
  415. BGFX_ATTRIB_TEXCOORD6, /// a_texcoord6
  416. BGFX_ATTRIB_TEXCOORD7, /// a_texcoord7
  417. BGFX_ATTRIB_COUNT
  418. }
  419. /// Vertex attribute type enum.
  420. enum bgfx_attrib_type_t
  421. {
  422. BGFX_ATTRIB_TYPE_UINT8, /// Uint8
  423. BGFX_ATTRIB_TYPE_UINT10, /// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
  424. BGFX_ATTRIB_TYPE_INT16, /// Int16
  425. BGFX_ATTRIB_TYPE_HALF, /// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
  426. BGFX_ATTRIB_TYPE_FLOAT, /// Float
  427. BGFX_ATTRIB_TYPE_COUNT
  428. }
  429. /**
  430. * Texture format enum.
  431. * Notation:
  432. * RGBA16S
  433. * ^ ^ ^
  434. * | | +-- [ ]Unorm
  435. * | | [F]loat
  436. * | | [S]norm
  437. * | | [I]nt
  438. * | | [U]int
  439. * | +---- Number of bits per component
  440. * +-------- Components
  441. * @attention Availability depends on Caps (see: formats).
  442. */
  443. enum bgfx_texture_format_t
  444. {
  445. BGFX_TEXTURE_FORMAT_BC1, /// DXT1 R5G6B5A1
  446. BGFX_TEXTURE_FORMAT_BC2, /// DXT3 R5G6B5A4
  447. BGFX_TEXTURE_FORMAT_BC3, /// DXT5 R5G6B5A8
  448. BGFX_TEXTURE_FORMAT_BC4, /// LATC1/ATI1 R8
  449. BGFX_TEXTURE_FORMAT_BC5, /// LATC2/ATI2 RG8
  450. BGFX_TEXTURE_FORMAT_BC6H, /// BC6H RGB16F
  451. BGFX_TEXTURE_FORMAT_BC7, /// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
  452. BGFX_TEXTURE_FORMAT_ETC1, /// ETC1 RGB8
  453. BGFX_TEXTURE_FORMAT_ETC2, /// ETC2 RGB8
  454. BGFX_TEXTURE_FORMAT_ETC2A, /// ETC2 RGBA8
  455. BGFX_TEXTURE_FORMAT_ETC2A1, /// ETC2 RGB8A1
  456. BGFX_TEXTURE_FORMAT_PTC12, /// PVRTC1 RGB 2BPP
  457. BGFX_TEXTURE_FORMAT_PTC14, /// PVRTC1 RGB 4BPP
  458. BGFX_TEXTURE_FORMAT_PTC12A, /// PVRTC1 RGBA 2BPP
  459. BGFX_TEXTURE_FORMAT_PTC14A, /// PVRTC1 RGBA 4BPP
  460. BGFX_TEXTURE_FORMAT_PTC22, /// PVRTC2 RGBA 2BPP
  461. BGFX_TEXTURE_FORMAT_PTC24, /// PVRTC2 RGBA 4BPP
  462. BGFX_TEXTURE_FORMAT_ATC, /// ATC RGB 4BPP
  463. BGFX_TEXTURE_FORMAT_ATCE, /// ATCE RGBA 8 BPP explicit alpha
  464. BGFX_TEXTURE_FORMAT_ATCI, /// ATCI RGBA 8 BPP interpolated alpha
  465. BGFX_TEXTURE_FORMAT_ASTC4X4, /// ASTC 4x4 8.0 BPP
  466. BGFX_TEXTURE_FORMAT_ASTC5X5, /// ASTC 5x5 5.12 BPP
  467. BGFX_TEXTURE_FORMAT_ASTC6X6, /// ASTC 6x6 3.56 BPP
  468. BGFX_TEXTURE_FORMAT_ASTC8X5, /// ASTC 8x5 3.20 BPP
  469. BGFX_TEXTURE_FORMAT_ASTC8X6, /// ASTC 8x6 2.67 BPP
  470. BGFX_TEXTURE_FORMAT_ASTC10X5, /// ASTC 10x5 2.56 BPP
  471. BGFX_TEXTURE_FORMAT_UNKNOWN, /// Compressed formats above.
  472. BGFX_TEXTURE_FORMAT_R1,
  473. BGFX_TEXTURE_FORMAT_A8,
  474. BGFX_TEXTURE_FORMAT_R8,
  475. BGFX_TEXTURE_FORMAT_R8I,
  476. BGFX_TEXTURE_FORMAT_R8U,
  477. BGFX_TEXTURE_FORMAT_R8S,
  478. BGFX_TEXTURE_FORMAT_R16,
  479. BGFX_TEXTURE_FORMAT_R16I,
  480. BGFX_TEXTURE_FORMAT_R16U,
  481. BGFX_TEXTURE_FORMAT_R16F,
  482. BGFX_TEXTURE_FORMAT_R16S,
  483. BGFX_TEXTURE_FORMAT_R32I,
  484. BGFX_TEXTURE_FORMAT_R32U,
  485. BGFX_TEXTURE_FORMAT_R32F,
  486. BGFX_TEXTURE_FORMAT_RG8,
  487. BGFX_TEXTURE_FORMAT_RG8I,
  488. BGFX_TEXTURE_FORMAT_RG8U,
  489. BGFX_TEXTURE_FORMAT_RG8S,
  490. BGFX_TEXTURE_FORMAT_RG16,
  491. BGFX_TEXTURE_FORMAT_RG16I,
  492. BGFX_TEXTURE_FORMAT_RG16U,
  493. BGFX_TEXTURE_FORMAT_RG16F,
  494. BGFX_TEXTURE_FORMAT_RG16S,
  495. BGFX_TEXTURE_FORMAT_RG32I,
  496. BGFX_TEXTURE_FORMAT_RG32U,
  497. BGFX_TEXTURE_FORMAT_RG32F,
  498. BGFX_TEXTURE_FORMAT_RGB8,
  499. BGFX_TEXTURE_FORMAT_RGB8I,
  500. BGFX_TEXTURE_FORMAT_RGB8U,
  501. BGFX_TEXTURE_FORMAT_RGB8S,
  502. BGFX_TEXTURE_FORMAT_RGB9E5F,
  503. BGFX_TEXTURE_FORMAT_BGRA8,
  504. BGFX_TEXTURE_FORMAT_RGBA8,
  505. BGFX_TEXTURE_FORMAT_RGBA8I,
  506. BGFX_TEXTURE_FORMAT_RGBA8U,
  507. BGFX_TEXTURE_FORMAT_RGBA8S,
  508. BGFX_TEXTURE_FORMAT_RGBA16,
  509. BGFX_TEXTURE_FORMAT_RGBA16I,
  510. BGFX_TEXTURE_FORMAT_RGBA16U,
  511. BGFX_TEXTURE_FORMAT_RGBA16F,
  512. BGFX_TEXTURE_FORMAT_RGBA16S,
  513. BGFX_TEXTURE_FORMAT_RGBA32I,
  514. BGFX_TEXTURE_FORMAT_RGBA32U,
  515. BGFX_TEXTURE_FORMAT_RGBA32F,
  516. BGFX_TEXTURE_FORMAT_R5G6B5,
  517. BGFX_TEXTURE_FORMAT_RGBA4,
  518. BGFX_TEXTURE_FORMAT_RGB5A1,
  519. BGFX_TEXTURE_FORMAT_RGB10A2,
  520. BGFX_TEXTURE_FORMAT_RG11B10F,
  521. BGFX_TEXTURE_FORMAT_UNKNOWNDEPTH, /// Depth formats below.
  522. BGFX_TEXTURE_FORMAT_D16,
  523. BGFX_TEXTURE_FORMAT_D24,
  524. BGFX_TEXTURE_FORMAT_D24S8,
  525. BGFX_TEXTURE_FORMAT_D32,
  526. BGFX_TEXTURE_FORMAT_D16F,
  527. BGFX_TEXTURE_FORMAT_D24F,
  528. BGFX_TEXTURE_FORMAT_D32F,
  529. BGFX_TEXTURE_FORMAT_D0S8,
  530. BGFX_TEXTURE_FORMAT_COUNT
  531. }
  532. /// Uniform type enum.
  533. enum bgfx_uniform_type_t
  534. {
  535. BGFX_UNIFORM_TYPE_SAMPLER, /// Sampler.
  536. BGFX_UNIFORM_TYPE_END, /// Reserved, do not use.
  537. BGFX_UNIFORM_TYPE_VEC4, /// 4 floats vector.
  538. BGFX_UNIFORM_TYPE_MAT3, /// 3x3 matrix.
  539. BGFX_UNIFORM_TYPE_MAT4, /// 4x4 matrix.
  540. BGFX_UNIFORM_TYPE_COUNT
  541. }
  542. /// Backbuffer ratio enum.
  543. enum bgfx_backbuffer_ratio_t
  544. {
  545. BGFX_BACKBUFFER_RATIO_EQUAL, /// Equal to backbuffer.
  546. BGFX_BACKBUFFER_RATIO_HALF, /// One half size of backbuffer.
  547. BGFX_BACKBUFFER_RATIO_QUARTER, /// One quarter size of backbuffer.
  548. BGFX_BACKBUFFER_RATIO_EIGHTH, /// One eighth size of backbuffer.
  549. BGFX_BACKBUFFER_RATIO_SIXTEENTH, /// One sixteenth size of backbuffer.
  550. BGFX_BACKBUFFER_RATIO_DOUBLE, /// Double size of backbuffer.
  551. BGFX_BACKBUFFER_RATIO_COUNT
  552. }
  553. /// Occlusion query result.
  554. enum bgfx_occlusion_query_result_t
  555. {
  556. BGFX_OCCLUSION_QUERY_RESULT_INVISIBLE, /// Query failed test.
  557. BGFX_OCCLUSION_QUERY_RESULT_VISIBLE, /// Query passed test.
  558. BGFX_OCCLUSION_QUERY_RESULT_NORESULT, /// Query result is not available yet.
  559. BGFX_OCCLUSION_QUERY_RESULT_COUNT
  560. }
  561. /// Primitive topology.
  562. enum bgfx_topology_t
  563. {
  564. BGFX_TOPOLOGY_TRILIST, /// Triangle list.
  565. BGFX_TOPOLOGY_TRISTRIP, /// Triangle strip.
  566. BGFX_TOPOLOGY_LINELIST, /// Line list.
  567. BGFX_TOPOLOGY_LINESTRIP, /// Line strip.
  568. BGFX_TOPOLOGY_POINTLIST, /// Point list.
  569. BGFX_TOPOLOGY_COUNT
  570. }
  571. /// Topology conversion function.
  572. enum bgfx_topology_convert_t
  573. {
  574. BGFX_TOPOLOGY_CONVERT_TRILISTFLIPWINDING, /// Flip winding order of triangle list.
  575. BGFX_TOPOLOGY_CONVERT_TRISTRIPFLIPWINDING, /// Flip winding order of triangle strip.
  576. BGFX_TOPOLOGY_CONVERT_TRILISTTOLINELIST, /// Convert triangle list to line list.
  577. BGFX_TOPOLOGY_CONVERT_TRISTRIPTOTRILIST, /// Convert triangle strip to triangle list.
  578. BGFX_TOPOLOGY_CONVERT_LINESTRIPTOLINELIST, /// Convert line strip to line list.
  579. BGFX_TOPOLOGY_CONVERT_COUNT
  580. }
  581. /// Topology sort order.
  582. enum bgfx_topology_sort_t
  583. {
  584. BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKMIN,
  585. BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKAVG,
  586. BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKMAX,
  587. BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTMIN,
  588. BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTAVG,
  589. BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTMAX,
  590. BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKMIN,
  591. BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKAVG,
  592. BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKMAX,
  593. BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTMIN,
  594. BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTAVG,
  595. BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTMAX,
  596. BGFX_TOPOLOGY_SORT_COUNT
  597. }
  598. /// View mode sets draw call sort order.
  599. enum bgfx_view_mode_t
  600. {
  601. BGFX_VIEW_MODE_DEFAULT, /// Default sort order.
  602. BGFX_VIEW_MODE_SEQUENTIAL, /// Sort in the same order in which submit calls were called.
  603. BGFX_VIEW_MODE_DEPTHASCENDING, /// Sort draw call depth in ascending order.
  604. BGFX_VIEW_MODE_DEPTHDESCENDING, /// Sort draw call depth in descending order.
  605. BGFX_VIEW_MODE_COUNT
  606. }
  607. /// Render frame enum.
  608. enum bgfx_render_frame_t
  609. {
  610. BGFX_RENDER_FRAME_NOCONTEXT, /// Renderer context is not created yet.
  611. BGFX_RENDER_FRAME_RENDER, /// Renderer context is created and rendering.
  612. BGFX_RENDER_FRAME_TIMEOUT, /// Renderer context wait for main thread signal timed out without rendering.
  613. BGFX_RENDER_FRAME_EXITING, /// Renderer context is getting destroyed.
  614. BGFX_RENDER_FRAME_COUNT
  615. }
  616. /// GPU info.
  617. struct bgfx_caps_gpu_t
  618. {
  619. ushort vendorId; /// Vendor PCI id. See `BGFX_PCI_ID_*`.
  620. ushort deviceId; /// Device id.
  621. }
  622. /// Renderer runtime limits.
  623. struct bgfx_caps_limits_t
  624. {
  625. uint maxDrawCalls; /// Maximum number of draw calls.
  626. uint maxBlits; /// Maximum number of blit calls.
  627. uint maxTextureSize; /// Maximum texture size.
  628. uint maxTextureLayers; /// Maximum texture layers.
  629. uint maxViews; /// Maximum number of views.
  630. uint maxFrameBuffers; /// Maximum number of frame buffer handles.
  631. uint maxFBAttachments; /// Maximum number of frame buffer attachments.
  632. uint maxPrograms; /// Maximum number of program handles.
  633. uint maxShaders; /// Maximum number of shader handles.
  634. uint maxTextures; /// Maximum number of texture handles.
  635. uint maxTextureSamplers; /// Maximum number of texture samplers.
  636. uint maxComputeBindings; /// Maximum number of compute bindings.
  637. uint maxVertexLayouts; /// Maximum number of vertex format layouts.
  638. uint maxVertexStreams; /// Maximum number of vertex streams.
  639. uint maxIndexBuffers; /// Maximum number of index buffer handles.
  640. uint maxVertexBuffers; /// Maximum number of vertex buffer handles.
  641. uint maxDynamicIndexBuffers; /// Maximum number of dynamic index buffer handles.
  642. uint maxDynamicVertexBuffers; /// Maximum number of dynamic vertex buffer handles.
  643. uint maxUniforms; /// Maximum number of uniform handles.
  644. uint maxOcclusionQueries; /// Maximum number of occlusion query handles.
  645. uint maxEncoders; /// Maximum number of encoder threads.
  646. uint minResourceCbSize; /// Minimum resource command buffer size.
  647. uint transientVbSize; /// Maximum transient vertex buffer size.
  648. uint transientIbSize; /// Maximum transient index buffer size.
  649. }
  650. /// Renderer capabilities.
  651. struct bgfx_caps_t
  652. {
  653. bgfx_renderer_type_t rendererType; /// Renderer backend type. See: `bgfx::RendererType`
  654. /**
  655. * Supported functionality.
  656. * @attention See BGFX_CAPS_* flags at https://bkaradzic.github.io/bgfx/bgfx.html#available-caps
  657. */
  658. ulong supported;
  659. ushort vendorId; /// Selected GPU vendor PCI id.
  660. ushort deviceId; /// Selected GPU device id.
  661. bool homogeneousDepth; /// True when NDC depth is in [-1, 1] range, otherwise its [0, 1].
  662. bool originBottomLeft; /// True when NDC origin is at bottom left.
  663. byte numGPUs; /// Number of enumerated GPUs.
  664. bgfx_caps_gpu_t[4] gpu; /// Enumerated GPUs.
  665. bgfx_caps_limits_t limits; /// Renderer runtime limits.
  666. /**
  667. * Supported texture format capabilities flags:
  668. * - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - Texture format is not supported.
  669. * - `BGFX_CAPS_FORMAT_TEXTURE_2D` - Texture format is supported.
  670. * - `BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB` - Texture as sRGB format is supported.
  671. * - `BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED` - Texture format is emulated.
  672. * - `BGFX_CAPS_FORMAT_TEXTURE_3D` - Texture format is supported.
  673. * - `BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB` - Texture as sRGB format is supported.
  674. * - `BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED` - Texture format is emulated.
  675. * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE` - Texture format is supported.
  676. * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB` - Texture as sRGB format is supported.
  677. * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED` - Texture format is emulated.
  678. * - `BGFX_CAPS_FORMAT_TEXTURE_VERTEX` - Texture format can be used from vertex shader.
  679. * - `BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ` - Texture format can be used as image
  680. * and read from.
  681. * - `BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE` - Texture format can be used as image
  682. * and written to.
  683. * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
  684. * buffer.
  685. * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
  686. * frame buffer.
  687. * - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
  688. * - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
  689. * mips.
  690. */
  691. ushort[bgfx_texture_format_t.BGFX_TEXTURE_FORMAT_COUNT] formats;
  692. }
  693. /// Internal data.
  694. struct bgfx_internal_data_t
  695. {
  696. const(bgfx_caps_t)* caps; /// Renderer capabilities.
  697. void* context; /// GL context, or D3D device.
  698. }
  699. /// Platform data.
  700. struct bgfx_platform_data_t
  701. {
  702. void* ndt; /// Native display type (*nix specific).
  703. /**
  704. * Native window handle. If `NULL` bgfx will create headless
  705. * context/device if renderer API supports it.
  706. */
  707. void* nwh;
  708. void* context; /// GL context, or D3D device. If `NULL`, bgfx will create context/device.
  709. /**
  710. * GL back-buffer, or D3D render target view. If `NULL` bgfx will
  711. * create back-buffer color surface.
  712. */
  713. void* backBuffer;
  714. /**
  715. * Backbuffer depth/stencil. If `NULL` bgfx will create back-buffer
  716. * depth/stencil surface.
  717. */
  718. void* backBufferDS;
  719. }
  720. /// Backbuffer resolution and reset parameters.
  721. struct bgfx_resolution_t
  722. {
  723. bgfx_texture_format_t format; /// Backbuffer format.
  724. uint width; /// Backbuffer width.
  725. uint height; /// Backbuffer height.
  726. uint reset; /// Reset parameters.
  727. byte numBackBuffers; /// Number of back buffers.
  728. byte maxFrameLatency; /// Maximum frame latency.
  729. }
  730. /// Configurable runtime limits parameters.
  731. struct bgfx_init_limits_t
  732. {
  733. ushort maxEncoders; /// Maximum number of encoder threads.
  734. uint minResourceCbSize; /// Minimum resource command buffer size.
  735. uint transientVbSize; /// Maximum transient vertex buffer size.
  736. uint transientIbSize; /// Maximum transient index buffer size.
  737. }
  738. /// Initialization parameters used by `bgfx::init`.
  739. struct bgfx_init_t
  740. {
  741. /**
  742. * Select rendering backend. When set to RendererType::Count
  743. * a default rendering backend will be selected appropriate to the platform.
  744. * See: `bgfx::RendererType`
  745. */
  746. bgfx_renderer_type_t type;
  747. /**
  748. * Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
  749. * device.
  750. * - `BGFX_PCI_ID_NONE` - Autoselect adapter.
  751. * - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
  752. * - `BGFX_PCI_ID_AMD` - AMD adapter.
  753. * - `BGFX_PCI_ID_INTEL` - Intel adapter.
  754. * - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
  755. */
  756. ushort vendorId;
  757. /**
  758. * Device id. If set to 0 it will select first device, or device with
  759. * matching id.
  760. */
  761. ushort deviceId;
  762. ulong capabilities; /// Capabilities initialization mask.
  763. bool debug_; /// Enable device for debuging.
  764. bool profile; /// Enable device for profiling.
  765. bgfx_platform_data_t platformData; /// Platform data.
  766. bgfx_resolution_t resolution; /// Backbuffer resolution and reset parameters. See: `bgfx::Resolution`.
  767. bgfx_init_limits_t limits; /// Configurable runtime limits parameters.
  768. /**
  769. * Provide application specific callback interface.
  770. * See: `bgfx::CallbackI`
  771. */
  772. void* callback;
  773. /**
  774. * Custom allocator. When a custom allocator is not
  775. * specified, bgfx uses the CRT allocator. Bgfx assumes
  776. * custom allocator is thread safe.
  777. */
  778. void* allocator;
  779. }
  780. /**
  781. * Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
  782. * @attention It is illegal to create this structure on stack and pass it to any bgfx API.
  783. */
  784. struct bgfx_memory_t
  785. {
  786. byte* data; /// Pointer to data.
  787. uint size; /// Data size.
  788. }
  789. /// Transient index buffer.
  790. struct bgfx_transient_index_buffer_t
  791. {
  792. byte* data; /// Pointer to data.
  793. uint size; /// Data size.
  794. uint startIndex; /// First index.
  795. bgfx_index_buffer_handle_t handle; /// Index buffer handle.
  796. bool isIndex16; /// Index buffer format is 16-bits if true, otherwise it is 32-bit.
  797. }
  798. /// Transient vertex buffer.
  799. struct bgfx_transient_vertex_buffer_t
  800. {
  801. byte* data; /// Pointer to data.
  802. uint size; /// Data size.
  803. uint startVertex; /// First vertex.
  804. ushort stride; /// Vertex stride.
  805. bgfx_vertex_buffer_handle_t handle; /// Vertex buffer handle.
  806. bgfx_vertex_layout_handle_t layoutHandle; /// Vertex layout handle.
  807. }
  808. /// Instance data buffer info.
  809. struct bgfx_instance_data_buffer_t
  810. {
  811. byte* data; /// Pointer to data.
  812. uint size; /// Data size.
  813. uint offset; /// Offset in vertex buffer.
  814. uint num; /// Number of instances.
  815. ushort stride; /// Vertex buffer stride.
  816. bgfx_vertex_buffer_handle_t handle; /// Vertex buffer object handle.
  817. }
  818. /// Texture info.
  819. struct bgfx_texture_info_t
  820. {
  821. bgfx_texture_format_t format; /// Texture format.
  822. uint storageSize; /// Total amount of bytes required to store texture.
  823. ushort width; /// Texture width.
  824. ushort height; /// Texture height.
  825. ushort depth; /// Texture depth.
  826. ushort numLayers; /// Number of layers in texture array.
  827. byte numMips; /// Number of MIP maps.
  828. byte bitsPerPixel; /// Format bits per pixel.
  829. bool cubeMap; /// Texture is cubemap.
  830. }
  831. /// Uniform info.
  832. struct bgfx_uniform_info_t
  833. {
  834. char[256] name; /// Uniform name.
  835. bgfx_uniform_type_t type; /// Uniform type.
  836. ushort num; /// Number of elements in array.
  837. }
  838. /// Frame buffer texture attachment info.
  839. struct bgfx_attachment_t
  840. {
  841. bgfx_access_t access; /// Attachment access. See `Access::Enum`.
  842. bgfx_texture_handle_t handle; /// Render target texture handle.
  843. ushort mip; /// Mip level.
  844. ushort layer; /// Cubemap side or depth layer/slice to use.
  845. ushort numLayers; /// Number of texture layer/slice(s) in array to use.
  846. byte resolve; /// Resolve flags. See: `BGFX_RESOLVE_*`
  847. }
  848. /// Transform data.
  849. struct bgfx_transform_t
  850. {
  851. float* data; /// Pointer to first 4x4 matrix.
  852. ushort num; /// Number of matrices.
  853. }
  854. /// View stats.
  855. struct bgfx_view_stats_t
  856. {
  857. char[256] name; /// View name.
  858. bgfx_view_id_t view; /// View id.
  859. long cpuTimeBegin; /// CPU (submit) begin time.
  860. long cpuTimeEnd; /// CPU (submit) end time.
  861. long gpuTimeBegin; /// GPU begin time.
  862. long gpuTimeEnd; /// GPU end time.
  863. }
  864. /// Encoder stats.
  865. struct bgfx_encoder_stats_t
  866. {
  867. long cpuTimeBegin; /// Encoder thread CPU submit begin time.
  868. long cpuTimeEnd; /// Encoder thread CPU submit end time.
  869. }
  870. /**
  871. * Renderer statistics data.
  872. * @remarks All time values are high-resolution timestamps, while
  873. * time frequencies define timestamps-per-second for that hardware.
  874. */
  875. struct bgfx_stats_t
  876. {
  877. long cpuTimeFrame; /// CPU time between two `bgfx::frame` calls.
  878. long cpuTimeBegin; /// Render thread CPU submit begin time.
  879. long cpuTimeEnd; /// Render thread CPU submit end time.
  880. long cpuTimerFreq; /// CPU timer frequency. Timestamps-per-second
  881. long gpuTimeBegin; /// GPU frame begin time.
  882. long gpuTimeEnd; /// GPU frame end time.
  883. long gpuTimerFreq; /// GPU timer frequency.
  884. long waitRender; /// Time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API.
  885. long waitSubmit; /// Time spent waiting for submit thread to advance to next frame.
  886. uint numDraw; /// Number of draw calls submitted.
  887. uint numCompute; /// Number of compute calls submitted.
  888. uint numBlit; /// Number of blit calls submitted.
  889. uint maxGpuLatency; /// GPU driver latency.
  890. ushort numDynamicIndexBuffers; /// Number of used dynamic index buffers.
  891. ushort numDynamicVertexBuffers; /// Number of used dynamic vertex buffers.
  892. ushort numFrameBuffers; /// Number of used frame buffers.
  893. ushort numIndexBuffers; /// Number of used index buffers.
  894. ushort numOcclusionQueries; /// Number of used occlusion queries.
  895. ushort numPrograms; /// Number of used programs.
  896. ushort numShaders; /// Number of used shaders.
  897. ushort numTextures; /// Number of used textures.
  898. ushort numUniforms; /// Number of used uniforms.
  899. ushort numVertexBuffers; /// Number of used vertex buffers.
  900. ushort numVertexLayouts; /// Number of used vertex layouts.
  901. long textureMemoryUsed; /// Estimate of texture memory used.
  902. long rtMemoryUsed; /// Estimate of render target memory used.
  903. int transientVbUsed; /// Amount of transient vertex buffer used.
  904. int transientIbUsed; /// Amount of transient index buffer used.
  905. uint[bgfx_topology_t.BGFX_TOPOLOGY_COUNT] numPrims; /// Number of primitives rendered.
  906. long gpuMemoryMax; /// Maximum available GPU memory for application.
  907. long gpuMemoryUsed; /// Amount of GPU memory used by the application.
  908. ushort width; /// Backbuffer width in pixels.
  909. ushort height; /// Backbuffer height in pixels.
  910. ushort textWidth; /// Debug text width in characters.
  911. ushort textHeight; /// Debug text height in characters.
  912. ushort numViews; /// Number of view stats.
  913. bgfx_view_stats_t* viewStats; /// Array of View stats.
  914. byte numEncoders; /// Number of encoders used during frame.
  915. bgfx_encoder_stats_t* encoderStats; /// Array of encoder stats.
  916. }
  917. /// Vertex layout.
  918. struct bgfx_vertex_layout_t
  919. {
  920. uint hash; /// Hash.
  921. ushort stride; /// Stride.
  922. ushort[bgfx_attrib_t.BGFX_ATTRIB_COUNT] offset; /// Attribute offsets.
  923. ushort[bgfx_attrib_t.BGFX_ATTRIB_COUNT] attributes; /// Used attributes.
  924. }
  925. /**
  926. * Encoders are used for submitting draw calls from multiple threads. Only one encoder
  927. * per thread should be used. Use `bgfx::begin()` to obtain an encoder for a thread.
  928. */
  929. struct bgfx_encoder_t
  930. {
  931. }
  932. struct bgfx_dynamic_index_buffer_handle_t { ushort idx; }
  933. struct bgfx_dynamic_vertex_buffer_handle_t { ushort idx; }
  934. struct bgfx_frame_buffer_handle_t { ushort idx; }
  935. struct bgfx_index_buffer_handle_t { ushort idx; }
  936. struct bgfx_indirect_buffer_handle_t { ushort idx; }
  937. struct bgfx_occlusion_query_handle_t { ushort idx; }
  938. struct bgfx_program_handle_t { ushort idx; }
  939. struct bgfx_shader_handle_t { ushort idx; }
  940. struct bgfx_texture_handle_t { ushort idx; }
  941. struct bgfx_uniform_handle_t { ushort idx; }
  942. struct bgfx_vertex_buffer_handle_t { ushort idx; }
  943. struct bgfx_vertex_layout_handle_t { ushort idx; }