diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs
index 8c0ff2578..17693d419 100644
--- a/bindings/cs/bgfx.cs
+++ b/bindings/cs/bgfx.cs
@@ -139,19 +139,74 @@ public static partial class bgfx
[Flags]
public enum ClearFlags : ushort
{
+ ///
+ /// No clear flags.
+ ///
None = 0x0000,
+
+ ///
+ /// Clear color.
+ ///
Color = 0x0001,
+
+ ///
+ /// Clear depth.
+ ///
Depth = 0x0002,
+
+ ///
+ /// Clear stencil.
+ ///
Stencil = 0x0004,
+
+ ///
+ /// Discard frame buffer attachment 0.
+ ///
DiscardColor0 = 0x0008,
+
+ ///
+ /// Discard frame buffer attachment 1.
+ ///
DiscardColor1 = 0x0010,
+
+ ///
+ /// Discard frame buffer attachment 2.
+ ///
DiscardColor2 = 0x0020,
+
+ ///
+ /// Discard frame buffer attachment 3.
+ ///
DiscardColor3 = 0x0040,
+
+ ///
+ /// Discard frame buffer attachment 4.
+ ///
DiscardColor4 = 0x0080,
+
+ ///
+ /// Discard frame buffer attachment 5.
+ ///
DiscardColor5 = 0x0100,
+
+ ///
+ /// Discard frame buffer attachment 6.
+ ///
DiscardColor6 = 0x0200,
+
+ ///
+ /// Discard frame buffer attachment 7.
+ ///
DiscardColor7 = 0x0400,
+
+ ///
+ /// Discard frame buffer depth attachment.
+ ///
DiscardDepth = 0x0800,
+
+ ///
+ /// Discard frame buffer stencil attachment.
+ ///
DiscardStencil = 0x1000,
DiscardColorMask = 0x07f8,
DiscardMask = 0x1ff8,
@@ -160,11 +215,34 @@ public static partial class bgfx
[Flags]
public enum DebugFlags : uint
{
+ ///
+ /// No debug.
+ ///
None = 0x00000000,
+
+ ///
+ /// Enable wireframe for all primitives.
+ ///
Wireframe = 0x00000001,
+
+ ///
+ /// Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.
+ ///
Ifh = 0x00000002,
+
+ ///
+ /// Enable statistics display.
+ ///
Stats = 0x00000004,
+
+ ///
+ /// Enable debug text display.
+ ///
Text = 0x00000008,
+
+ ///
+ /// Enable profiler.
+ ///
Profiler = 0x00000010,
}
@@ -299,83 +377,306 @@ public static partial class bgfx
[Flags]
public enum CapsFlags : ulong
{
+ ///
+ /// Alpha to coverage is supported.
+ ///
AlphaToCoverage = 0x0000000000000001,
+
+ ///
+ /// Blend independent is supported.
+ ///
BlendIndependent = 0x0000000000000002,
+
+ ///
+ /// Compute shaders are supported.
+ ///
Compute = 0x0000000000000004,
+
+ ///
+ /// Conservative rasterization is supported.
+ ///
ConservativeRaster = 0x0000000000000008,
+
+ ///
+ /// Draw indirect is supported.
+ ///
DrawIndirect = 0x0000000000000010,
+
+ ///
+ /// Fragment depth is accessible in fragment shader.
+ ///
FragmentDepth = 0x0000000000000020,
+
+ ///
+ /// Fragment ordering is available in fragment shader.
+ ///
FragmentOrdering = 0x0000000000000040,
+
+ ///
+ /// Read/Write frame buffer attachments are supported.
+ ///
FramebufferRw = 0x0000000000000080,
+
+ ///
+ /// Graphics debugger is present.
+ ///
GraphicsDebugger = 0x0000000000000100,
Reserved = 0x0000000000000200,
+
+ ///
+ /// HDR10 rendering is supported.
+ ///
Hdr10 = 0x0000000000000400,
+
+ ///
+ /// HiDPI rendering is supported.
+ ///
Hidpi = 0x0000000000000800,
+
+ ///
+ /// 32-bit indices are supported.
+ ///
Index32 = 0x0000000000001000,
+
+ ///
+ /// Instancing is supported.
+ ///
Instancing = 0x0000000000002000,
+
+ ///
+ /// Occlusion query is supported.
+ ///
OcclusionQuery = 0x0000000000004000,
+
+ ///
+ /// Renderer is on separate thread.
+ ///
RendererMultithreaded = 0x0000000000008000,
+
+ ///
+ /// Multiple windows are supported.
+ ///
SwapChain = 0x0000000000010000,
+
+ ///
+ /// 2D texture array is supported.
+ ///
Texture2dArray = 0x0000000000020000,
+
+ ///
+ /// 3D textures are supported.
+ ///
Texture3d = 0x0000000000040000,
+
+ ///
+ /// Texture blit is supported.
+ ///
TextureBlit = 0x0000000000080000,
+
+ ///
+ /// All texture compare modes are supported.
+ ///
TextureCompareReserved = 0x0000000000100000,
+
+ ///
+ /// Texture compare less equal mode is supported.
+ ///
TextureCompareLequal = 0x0000000000200000,
+
+ ///
+ /// Cubemap texture array is supported.
+ ///
TextureCubeArray = 0x0000000000400000,
+
+ ///
+ /// CPU direct access to GPU texture memory.
+ ///
TextureDirectAccess = 0x0000000000800000,
+
+ ///
+ /// Read-back texture is supported.
+ ///
TextureReadBack = 0x0000000001000000,
+
+ ///
+ /// Vertex attribute half-float is supported.
+ ///
VertexAttribHalf = 0x0000000002000000,
+
+ ///
+ /// Vertex attribute 10_10_10_2 is supported.
+ ///
VertexAttribUint10 = 0x0000000004000000,
+
+ ///
+ /// Rendering with VertexID only is supported.
+ ///
VertexId = 0x0000000008000000,
+
+ ///
+ /// All texture compare modes are supported.
+ ///
TextureCompareAll = 0x0000000000300000,
}
[Flags]
public enum CapsFormatFlags : ushort
{
+ ///
+ /// Texture format is not supported.
+ ///
TextureNone = 0x0000,
+
+ ///
+ /// Texture format is supported.
+ ///
Texture2d = 0x0001,
+
+ ///
+ /// Texture as sRGB format is supported.
+ ///
Texture2dSrgb = 0x0002,
+
+ ///
+ /// Texture format is emulated.
+ ///
Texture2dEmulated = 0x0004,
+
+ ///
+ /// Texture format is supported.
+ ///
Texture3d = 0x0008,
+
+ ///
+ /// Texture as sRGB format is supported.
+ ///
Texture3dSrgb = 0x0010,
+
+ ///
+ /// Texture format is emulated.
+ ///
Texture3dEmulated = 0x0020,
+
+ ///
+ /// Texture format is supported.
+ ///
TextureCube = 0x0040,
+
+ ///
+ /// Texture as sRGB format is supported.
+ ///
TextureCubeSrgb = 0x0080,
+
+ ///
+ /// Texture format is emulated.
+ ///
TextureCubeEmulated = 0x0100,
+
+ ///
+ /// Texture format can be used from vertex shader.
+ ///
TextureVertex = 0x0200,
+
+ ///
+ /// Texture format can be used as image from compute shader.
+ ///
TextureImage = 0x0400,
+
+ ///
+ /// Texture format can be used as frame buffer.
+ ///
TextureFramebuffer = 0x0800,
+
+ ///
+ /// Texture format can be used as MSAA frame buffer.
+ ///
TextureFramebufferMsaa = 0x1000,
+
+ ///
+ /// Texture can be sampled as MSAA.
+ ///
TextureMsaa = 0x2000,
+
+ ///
+ /// Texture format supports auto-generated mips.
+ ///
TextureMipAutogen = 0x4000,
}
[Flags]
public enum ResolveFlags : uint
{
+ ///
+ /// No resolve flags.
+ ///
None = 0x00000000,
+
+ ///
+ /// Auto-generate mip maps on resolve.
+ ///
AutoGenMips = 0x00000001,
}
[Flags]
public enum PciIdFlags : ushort
{
+ ///
+ /// Autoselect adapter.
+ ///
None = 0x0000,
+
+ ///
+ /// Software rasterizer.
+ ///
SoftwareRasterizer = 0x0001,
+
+ ///
+ /// AMD adapter.
+ ///
Amd = 0x1002,
+
+ ///
+ /// Intel adapter.
+ ///
Intel = 0x8086,
+
+ ///
+ /// nVidia adapter.
+ ///
Nvidia = 0x10de,
}
[Flags]
public enum CubeMapFlags : uint
{
+ ///
+ /// Cubemap +x.
+ ///
PositiveX = 0x00000000,
+
+ ///
+ /// Cubemap -x.
+ ///
NegativeX = 0x00000001,
+
+ ///
+ /// Cubemap +y.
+ ///
PositiveY = 0x00000002,
+
+ ///
+ /// Cubemap -y.
+ ///
NegativeY = 0x00000003,
+
+ ///
+ /// Cubemap +z.
+ ///
PositiveZ = 0x00000004,
+
+ ///
+ /// Cubemap -z.
+ ///
NegativeZ = 0x00000005,
}
diff --git a/scripts/bindings-cs.lua b/scripts/bindings-cs.lua
index 26ecd6846..60a2b385a 100644
--- a/scripts/bindings-cs.lua
+++ b/scripts/bindings-cs.lua
@@ -161,7 +161,18 @@ local function FlagBlock(typ)
yield("public enum " .. typ.name .. "Flags" .. enumType)
yield("{")
- for _, flag in ipairs(typ.flag) do
+ for idx, flag in ipairs(typ.flag) do
+
+ if flag.comment ~= nil then
+ if idx ~= 1 then
+ yield("")
+ end
+
+ yield("\t/// ")
+ yield("\t/// " .. flag.comment)
+ yield("\t/// ")
+ end
+
local flagName = flag.name:gsub("_", "")
yield("\t"
.. flagName