/*
* Copyright 2011-2024 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
*
* AUTO GENERATED! DO NOT EDIT!
*
*/
using System;
namespace Bgfx
{
public static class bgfx
{
public typealias ViewId = uint16;
[AllowDuplicates]
public enum StateFlags : uint64
{
///
/// Enable R write.
///
WriteR = 0x0000000000000001,
///
/// Enable G write.
///
WriteG = 0x0000000000000002,
///
/// Enable B write.
///
WriteB = 0x0000000000000004,
///
/// Enable alpha write.
///
WriteA = 0x0000000000000008,
///
/// Enable depth write.
///
WriteZ = 0x0000004000000000,
///
/// Enable RGB write.
///
WriteRgb = 0x0000000000000007,
///
/// Write all channels mask.
///
WriteMask = 0x000000400000000f,
///
/// Enable depth test, less.
///
DepthTestLess = 0x0000000000000010,
///
/// Enable depth test, less or equal.
///
DepthTestLequal = 0x0000000000000020,
///
/// Enable depth test, equal.
///
DepthTestEqual = 0x0000000000000030,
///
/// Enable depth test, greater or equal.
///
DepthTestGequal = 0x0000000000000040,
///
/// Enable depth test, greater.
///
DepthTestGreater = 0x0000000000000050,
///
/// Enable depth test, not equal.
///
DepthTestNotequal = 0x0000000000000060,
///
/// Enable depth test, never.
///
DepthTestNever = 0x0000000000000070,
///
/// Enable depth test, always.
///
DepthTestAlways = 0x0000000000000080,
DepthTestShift = 4,
DepthTestMask = 0x00000000000000f0,
///
/// 0, 0, 0, 0
///
BlendZero = 0x0000000000001000,
///
/// 1, 1, 1, 1
///
BlendOne = 0x0000000000002000,
///
/// Rs, Gs, Bs, As
///
BlendSrcColor = 0x0000000000003000,
///
/// 1-Rs, 1-Gs, 1-Bs, 1-As
///
BlendInvSrcColor = 0x0000000000004000,
///
/// As, As, As, As
///
BlendSrcAlpha = 0x0000000000005000,
///
/// 1-As, 1-As, 1-As, 1-As
///
BlendInvSrcAlpha = 0x0000000000006000,
///
/// Ad, Ad, Ad, Ad
///
BlendDstAlpha = 0x0000000000007000,
///
/// 1-Ad, 1-Ad, 1-Ad ,1-Ad
///
BlendInvDstAlpha = 0x0000000000008000,
///
/// Rd, Gd, Bd, Ad
///
BlendDstColor = 0x0000000000009000,
///
/// 1-Rd, 1-Gd, 1-Bd, 1-Ad
///
BlendInvDstColor = 0x000000000000a000,
///
/// f, f, f, 1; f = min(As, 1-Ad)
///
BlendSrcAlphaSat = 0x000000000000b000,
///
/// Blend factor
///
BlendFactor = 0x000000000000c000,
///
/// 1-Blend factor
///
BlendInvFactor = 0x000000000000d000,
BlendShift = 12,
BlendMask = 0x000000000ffff000,
///
/// Blend add: src + dst.
///
BlendEquationAdd = 0x0000000000000000,
///
/// Blend subtract: src - dst.
///
BlendEquationSub = 0x0000000010000000,
///
/// Blend reverse subtract: dst - src.
///
BlendEquationRevsub = 0x0000000020000000,
///
/// Blend min: min(src, dst).
///
BlendEquationMin = 0x0000000030000000,
///
/// Blend max: max(src, dst).
///
BlendEquationMax = 0x0000000040000000,
BlendEquationShift = 28,
BlendEquationMask = 0x00000003f0000000,
///
/// Cull clockwise triangles.
///
CullCw = 0x0000001000000000,
///
/// Cull counter-clockwise triangles.
///
CullCcw = 0x0000002000000000,
CullShift = 36,
CullMask = 0x0000003000000000,
AlphaRefShift = 40,
AlphaRefMask = 0x0000ff0000000000,
///
/// Tristrip.
///
PtTristrip = 0x0001000000000000,
///
/// Lines.
///
PtLines = 0x0002000000000000,
///
/// Line strip.
///
PtLinestrip = 0x0003000000000000,
///
/// Points.
///
PtPoints = 0x0004000000000000,
PtShift = 48,
PtMask = 0x0007000000000000,
PointSizeShift = 52,
PointSizeMask = 0x00f0000000000000,
///
/// Enable MSAA rasterization.
///
Msaa = 0x0100000000000000,
///
/// Enable line AA rasterization.
///
Lineaa = 0x0200000000000000,
///
/// Enable conservative rasterization.
///
ConservativeRaster = 0x0400000000000000,
///
/// No state.
///
None = 0x0000000000000000,
///
/// Front counter-clockwise (default is clockwise).
///
FrontCcw = 0x0000008000000000,
///
/// Enable blend independent.
///
BlendIndependent = 0x0000000400000000,
///
/// Enable alpha to coverage.
///
BlendAlphaToCoverage = 0x0000000800000000,
///
/// Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
/// culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
///
Default = 0x010000500000001f,
Mask = 0xffffffffffffffff,
ReservedShift = 61,
ReservedMask = 0xe000000000000000,
}
[AllowDuplicates]
public enum StencilFlags : uint32
{
FuncRefShift = 0,
FuncRefMask = 0x000000ff,
FuncRmaskShift = 8,
FuncRmaskMask = 0x0000ff00,
None = 0x00000000,
Mask = 0xffffffff,
Default = 0x00000000,
///
/// Enable stencil test, less.
///
TestLess = 0x00010000,
///
/// Enable stencil test, less or equal.
///
TestLequal = 0x00020000,
///
/// Enable stencil test, equal.
///
TestEqual = 0x00030000,
///
/// Enable stencil test, greater or equal.
///
TestGequal = 0x00040000,
///
/// Enable stencil test, greater.
///
TestGreater = 0x00050000,
///
/// Enable stencil test, not equal.
///
TestNotequal = 0x00060000,
///
/// Enable stencil test, never.
///
TestNever = 0x00070000,
///
/// Enable stencil test, always.
///
TestAlways = 0x00080000,
TestShift = 16,
TestMask = 0x000f0000,
///
/// Zero.
///
OpFailSZero = 0x00000000,
///
/// Keep.
///
OpFailSKeep = 0x00100000,
///
/// Replace.
///
OpFailSReplace = 0x00200000,
///
/// Increment and wrap.
///
OpFailSIncr = 0x00300000,
///
/// Increment and clamp.
///
OpFailSIncrsat = 0x00400000,
///
/// Decrement and wrap.
///
OpFailSDecr = 0x00500000,
///
/// Decrement and clamp.
///
OpFailSDecrsat = 0x00600000,
///
/// Invert.
///
OpFailSInvert = 0x00700000,
OpFailSShift = 20,
OpFailSMask = 0x00f00000,
///
/// Zero.
///
OpFailZZero = 0x00000000,
///
/// Keep.
///
OpFailZKeep = 0x01000000,
///
/// Replace.
///
OpFailZReplace = 0x02000000,
///
/// Increment and wrap.
///
OpFailZIncr = 0x03000000,
///
/// Increment and clamp.
///
OpFailZIncrsat = 0x04000000,
///
/// Decrement and wrap.
///
OpFailZDecr = 0x05000000,
///
/// Decrement and clamp.
///
OpFailZDecrsat = 0x06000000,
///
/// Invert.
///
OpFailZInvert = 0x07000000,
OpFailZShift = 24,
OpFailZMask = 0x0f000000,
///
/// Zero.
///
OpPassZZero = 0x00000000,
///
/// Keep.
///
OpPassZKeep = 0x10000000,
///
/// Replace.
///
OpPassZReplace = 0x20000000,
///
/// Increment and wrap.
///
OpPassZIncr = 0x30000000,
///
/// Increment and clamp.
///
OpPassZIncrsat = 0x40000000,
///
/// Decrement and wrap.
///
OpPassZDecr = 0x50000000,
///
/// Decrement and clamp.
///
OpPassZDecrsat = 0x60000000,
///
/// Invert.
///
OpPassZInvert = 0x70000000,
OpPassZShift = 28,
OpPassZMask = 0xf0000000,
}
[AllowDuplicates]
public enum ClearFlags : uint16
{
///
/// 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,
}
[AllowDuplicates]
public enum DiscardFlags : uint32
{
///
/// Preserve everything.
///
None = 0x00000000,
///
/// Discard texture sampler and buffer bindings.
///
Bindings = 0x00000001,
///
/// Discard index buffer.
///
IndexBuffer = 0x00000002,
///
/// Discard instance data.
///
InstanceData = 0x00000004,
///
/// Discard state and uniform bindings.
///
State = 0x00000008,
///
/// Discard transform.
///
Transform = 0x00000010,
///
/// Discard vertex streams.
///
VertexStreams = 0x00000020,
///
/// Discard all states.
///
All = 0x000000ff,
}
[AllowDuplicates]
public enum DebugFlags : uint32
{
///
/// 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. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
///
Profiler = 0x00000010,
}
[AllowDuplicates]
public enum BufferFlags : uint16
{
///
/// 1 8-bit value
///
ComputeFormat8x1 = 0x0001,
///
/// 2 8-bit values
///
ComputeFormat8x2 = 0x0002,
///
/// 4 8-bit values
///
ComputeFormat8x4 = 0x0003,
///
/// 1 16-bit value
///
ComputeFormat16x1 = 0x0004,
///
/// 2 16-bit values
///
ComputeFormat16x2 = 0x0005,
///
/// 4 16-bit values
///
ComputeFormat16x4 = 0x0006,
///
/// 1 32-bit value
///
ComputeFormat32x1 = 0x0007,
///
/// 2 32-bit values
///
ComputeFormat32x2 = 0x0008,
///
/// 4 32-bit values
///
ComputeFormat32x4 = 0x0009,
ComputeFormatShift = 0,
ComputeFormatMask = 0x000f,
///
/// Type `int`.
///
ComputeTypeInt = 0x0010,
///
/// Type `uint`.
///
ComputeTypeUint = 0x0020,
///
/// Type `float`.
///
ComputeTypeFloat = 0x0030,
ComputeTypeShift = 4,
ComputeTypeMask = 0x0030,
None = 0x0000,
///
/// Buffer will be read by shader.
///
ComputeRead = 0x0100,
///
/// Buffer will be used for writing.
///
ComputeWrite = 0x0200,
///
/// Buffer will be used for storing draw indirect commands.
///
DrawIndirect = 0x0400,
///
/// Allow dynamic index/vertex buffer resize during update.
///
AllowResize = 0x0800,
///
/// Index buffer contains 32-bit indices.
///
Index32 = 0x1000,
ComputeReadWrite = 0x0300,
}
[AllowDuplicates]
public enum TextureFlags : uint64
{
None = 0x0000000000000000,
///
/// Texture will be used for MSAA sampling.
///
MsaaSample = 0x0000000800000000,
///
/// Render target no MSAA.
///
Rt = 0x0000001000000000,
///
/// Texture will be used for compute write.
///
ComputeWrite = 0x0000100000000000,
///
/// Sample texture as sRGB.
///
Srgb = 0x0000200000000000,
///
/// Texture will be used as blit destination.
///
BlitDst = 0x0000400000000000,
///
/// Texture will be used for read back from GPU.
///
ReadBack = 0x0000800000000000,
///
/// Render target MSAAx2 mode.
///
RtMsaaX2 = 0x0000002000000000,
///
/// Render target MSAAx4 mode.
///
RtMsaaX4 = 0x0000003000000000,
///
/// Render target MSAAx8 mode.
///
RtMsaaX8 = 0x0000004000000000,
///
/// Render target MSAAx16 mode.
///
RtMsaaX16 = 0x0000005000000000,
RtMsaaShift = 36,
RtMsaaMask = 0x0000007000000000,
///
/// Render target will be used for writing
///
RtWriteOnly = 0x0000008000000000,
RtShift = 36,
RtMask = 0x000000f000000000,
}
[AllowDuplicates]
public enum SamplerFlags : uint32
{
///
/// Wrap U mode: Mirror
///
UMirror = 0x00000001,
///
/// Wrap U mode: Clamp
///
UClamp = 0x00000002,
///
/// Wrap U mode: Border
///
UBorder = 0x00000003,
UShift = 0,
UMask = 0x00000003,
///
/// Wrap V mode: Mirror
///
VMirror = 0x00000004,
///
/// Wrap V mode: Clamp
///
VClamp = 0x00000008,
///
/// Wrap V mode: Border
///
VBorder = 0x0000000c,
VShift = 2,
VMask = 0x0000000c,
///
/// Wrap W mode: Mirror
///
WMirror = 0x00000010,
///
/// Wrap W mode: Clamp
///
WClamp = 0x00000020,
///
/// Wrap W mode: Border
///
WBorder = 0x00000030,
WShift = 4,
WMask = 0x00000030,
///
/// Min sampling mode: Point
///
MinPoint = 0x00000040,
///
/// Min sampling mode: Anisotropic
///
MinAnisotropic = 0x00000080,
MinShift = 6,
MinMask = 0x000000c0,
///
/// Mag sampling mode: Point
///
MagPoint = 0x00000100,
///
/// Mag sampling mode: Anisotropic
///
MagAnisotropic = 0x00000200,
MagShift = 8,
MagMask = 0x00000300,
///
/// Mip sampling mode: Point
///
MipPoint = 0x00000400,
MipShift = 10,
MipMask = 0x00000400,
///
/// Compare when sampling depth texture: less.
///
CompareLess = 0x00010000,
///
/// Compare when sampling depth texture: less or equal.
///
CompareLequal = 0x00020000,
///
/// Compare when sampling depth texture: equal.
///
CompareEqual = 0x00030000,
///
/// Compare when sampling depth texture: greater or equal.
///
CompareGequal = 0x00040000,
///
/// Compare when sampling depth texture: greater.
///
CompareGreater = 0x00050000,
///
/// Compare when sampling depth texture: not equal.
///
CompareNotequal = 0x00060000,
///
/// Compare when sampling depth texture: never.
///
CompareNever = 0x00070000,
///
/// Compare when sampling depth texture: always.
///
CompareAlways = 0x00080000,
CompareShift = 16,
CompareMask = 0x000f0000,
BorderColorShift = 24,
BorderColorMask = 0x0f000000,
ReservedShift = 28,
ReservedMask = 0xf0000000,
None = 0x00000000,
///
/// Sample stencil instead of depth.
///
SampleStencil = 0x00100000,
Point = 0x00000540,
UvwMirror = 0x00000015,
UvwClamp = 0x0000002a,
UvwBorder = 0x0000003f,
BitsMask = 0x000f07ff,
}
[AllowDuplicates]
public enum ResetFlags : uint32
{
///
/// Enable 2x MSAA.
///
MsaaX2 = 0x00000010,
///
/// Enable 4x MSAA.
///
MsaaX4 = 0x00000020,
///
/// Enable 8x MSAA.
///
MsaaX8 = 0x00000030,
///
/// Enable 16x MSAA.
///
MsaaX16 = 0x00000040,
MsaaShift = 4,
MsaaMask = 0x00000070,
///
/// No reset flags.
///
None = 0x00000000,
///
/// Not supported yet.
///
Fullscreen = 0x00000001,
///
/// Enable V-Sync.
///
Vsync = 0x00000080,
///
/// Turn on/off max anisotropy.
///
Maxanisotropy = 0x00000100,
///
/// Begin screen capture.
///
Capture = 0x00000200,
///
/// Flush rendering after submitting to GPU.
///
FlushAfterRender = 0x00002000,
///
/// This flag specifies where flip occurs. Default behaviour is that flip occurs
/// before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
///
FlipAfterRender = 0x00004000,
///
/// Enable sRGB backbuffer.
///
SrgbBackbuffer = 0x00008000,
///
/// Enable HDR10 rendering.
///
Hdr10 = 0x00010000,
///
/// Enable HiDPI rendering.
///
Hidpi = 0x00020000,
///
/// Enable depth clamp.
///
DepthClamp = 0x00040000,
///
/// Suspend rendering.
///
Suspend = 0x00080000,
///
/// Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
///
TransparentBackbuffer = 0x00100000,
FullscreenShift = 0,
FullscreenMask = 0x00000001,
ReservedShift = 31,
ReservedMask = 0x80000000,
}
[AllowDuplicates]
public enum CapsFlags : uint64
{
///
/// 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,
///
/// Draw indirect with indirect count is supported.
///
DrawIndirectCount = 0x0000000000000020,
///
/// Fragment depth is available in fragment shader.
///
FragmentDepth = 0x0000000000000040,
///
/// Fragment ordering is available in fragment shader.
///
FragmentOrdering = 0x0000000000000080,
///
/// Graphics debugger is present.
///
GraphicsDebugger = 0x0000000000000100,
///
/// HDR10 rendering is supported.
///
Hdr10 = 0x0000000000000200,
///
/// HiDPI rendering is supported.
///
Hidpi = 0x0000000000000400,
///
/// Image Read/Write is supported.
///
ImageRw = 0x0000000000000800,
///
/// 32-bit indices are supported.
///
Index32 = 0x0000000000001000,
///
/// Instancing is supported.
///
Instancing = 0x0000000000002000,
///
/// Occlusion query is supported.
///
OcclusionQuery = 0x0000000000004000,
///
/// PrimitiveID is available in fragment shader.
///
PrimitiveId = 0x0000000000008000,
///
/// Renderer is on separate thread.
///
RendererMultithreaded = 0x0000000000010000,
///
/// Multiple windows are supported.
///
SwapChain = 0x0000000000020000,
///
/// Texture blit is supported.
///
TextureBlit = 0x0000000000040000,
///
/// Texture compare less equal mode is supported.
///
TextureCompareLequal = 0x0000000000080000,
TextureCompareReserved = 0x0000000000100000,
///
/// Cubemap texture array is supported.
///
TextureCubeArray = 0x0000000000200000,
///
/// CPU direct access to GPU texture memory.
///
TextureDirectAccess = 0x0000000000400000,
///
/// Read-back texture is supported.
///
TextureReadBack = 0x0000000000800000,
///
/// 2D texture array is supported.
///
Texture2dArray = 0x0000000001000000,
///
/// 3D textures are supported.
///
Texture3d = 0x0000000002000000,
///
/// Transparent back buffer supported.
///
TransparentBackbuffer = 0x0000000004000000,
///
/// Vertex attribute half-float is supported.
///
VertexAttribHalf = 0x0000000008000000,
///
/// Vertex attribute 10_10_10_2 is supported.
///
VertexAttribUint10 = 0x0000000010000000,
///
/// Rendering with VertexID only is supported.
///
VertexId = 0x0000000020000000,
///
/// Viewport layer is available in vertex shader.
///
ViewportLayerArray = 0x0000000040000000,
///
/// All texture compare modes are supported.
///
TextureCompareAll = 0x0000000000180000,
}
[AllowDuplicates]
public enum CapsFormatFlags : uint32
{
///
/// Texture format is not supported.
///
TextureNone = 0x00000000,
///
/// Texture format is supported.
///
Texture2d = 0x00000001,
///
/// Texture as sRGB format is supported.
///
Texture2dSrgb = 0x00000002,
///
/// Texture format is emulated.
///
Texture2dEmulated = 0x00000004,
///
/// Texture format is supported.
///
Texture3d = 0x00000008,
///
/// Texture as sRGB format is supported.
///
Texture3dSrgb = 0x00000010,
///
/// Texture format is emulated.
///
Texture3dEmulated = 0x00000020,
///
/// Texture format is supported.
///
TextureCube = 0x00000040,
///
/// Texture as sRGB format is supported.
///
TextureCubeSrgb = 0x00000080,
///
/// Texture format is emulated.
///
TextureCubeEmulated = 0x00000100,
///
/// Texture format can be used from vertex shader.
///
TextureVertex = 0x00000200,
///
/// Texture format can be used as image and read from.
///
TextureImageRead = 0x00000400,
///
/// Texture format can be used as image and written to.
///
TextureImageWrite = 0x00000800,
///
/// Texture format can be used as frame buffer.
///
TextureFramebuffer = 0x00001000,
///
/// Texture format can be used as MSAA frame buffer.
///
TextureFramebufferMsaa = 0x00002000,
///
/// Texture can be sampled as MSAA.
///
TextureMsaa = 0x00004000,
///
/// Texture format supports auto-generated mips.
///
TextureMipAutogen = 0x00008000,
}
[AllowDuplicates]
public enum ResolveFlags : uint32
{
///
/// No resolve flags.
///
None = 0x00000000,
///
/// Auto-generate mip maps on resolve.
///
AutoGenMips = 0x00000001,
}
[AllowDuplicates]
public enum PciIdFlags : uint16
{
///
/// Autoselect adapter.
///
None = 0x0000,
///
/// Software rasterizer.
///
SoftwareRasterizer = 0x0001,
///
/// AMD adapter.
///
Amd = 0x1002,
///
/// Apple adapter.
///
Apple = 0x106b,
///
/// Intel adapter.
///
Intel = 0x8086,
///
/// nVidia adapter.
///
Nvidia = 0x10de,
///
/// Microsoft adapter.
///
Microsoft = 0x1414,
///
/// ARM adapter.
///
Arm = 0x13b5,
}
[AllowDuplicates]
public enum CubeMapFlags : uint32
{
///
/// Cubemap +x.
///
PositiveX = 0x00000000,
///
/// Cubemap -x.
///
NegativeX = 0x00000001,
///
/// Cubemap +y.
///
PositiveY = 0x00000002,
///
/// Cubemap -y.
///
NegativeY = 0x00000003,
///
/// Cubemap +z.
///
PositiveZ = 0x00000004,
///
/// Cubemap -z.
///
NegativeZ = 0x00000005,
}
[AllowDuplicates]
public enum Fatal : uint32
{
DebugCheck,
InvalidShader,
UnableToInitialize,
UnableToCreateTexture,
DeviceLost,
Count
}
[AllowDuplicates]
public enum RendererType : uint32
{
///
/// No rendering.
///
Noop,
///
/// AGC
///
Agc,
///
/// Direct3D 11.0
///
Direct3D11,
///
/// Direct3D 12.0
///
Direct3D12,
///
/// GNM
///
Gnm,
///
/// Metal
///
Metal,
///
/// NVN
///
Nvn,
///
/// OpenGL ES 2.0+
///
OpenGLES,
///
/// OpenGL 2.1+
///
OpenGL,
///
/// Vulkan
///
Vulkan,
Count
}
[AllowDuplicates]
public enum Access : uint32
{
///
/// Read.
///
Read,
///
/// Write.
///
Write,
///
/// Read and write.
///
ReadWrite,
Count
}
[AllowDuplicates]
public enum Attrib : uint32
{
///
/// a_position
///
Position,
///
/// a_normal
///
Normal,
///
/// a_tangent
///
Tangent,
///
/// a_bitangent
///
Bitangent,
///
/// a_color0
///
Color0,
///
/// a_color1
///
Color1,
///
/// a_color2
///
Color2,
///
/// a_color3
///
Color3,
///
/// a_indices
///
Indices,
///
/// a_weight
///
Weight,
///
/// a_texcoord0
///
TexCoord0,
///
/// a_texcoord1
///
TexCoord1,
///
/// a_texcoord2
///
TexCoord2,
///
/// a_texcoord3
///
TexCoord3,
///
/// a_texcoord4
///
TexCoord4,
///
/// a_texcoord5
///
TexCoord5,
///
/// a_texcoord6
///
TexCoord6,
///
/// a_texcoord7
///
TexCoord7,
Count
}
[AllowDuplicates]
public enum AttribType : uint32
{
///
/// Uint8
///
Uint8,
///
/// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
///
Uint10,
///
/// Int16
///
Int16,
///
/// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
///
Half,
///
/// Float
///
Float,
Count
}
[AllowDuplicates]
public enum TextureFormat : uint32
{
///
/// DXT1 R5G6B5A1
///
BC1,
///
/// DXT3 R5G6B5A4
///
BC2,
///
/// DXT5 R5G6B5A8
///
BC3,
///
/// LATC1/ATI1 R8
///
BC4,
///
/// LATC2/ATI2 RG8
///
BC5,
///
/// BC6H RGB16F
///
BC6H,
///
/// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
///
BC7,
///
/// ETC1 RGB8
///
ETC1,
///
/// ETC2 RGB8
///
ETC2,
///
/// ETC2 RGBA8
///
ETC2A,
///
/// ETC2 RGB8A1
///
ETC2A1,
///
/// PVRTC1 RGB 2BPP
///
PTC12,
///
/// PVRTC1 RGB 4BPP
///
PTC14,
///
/// PVRTC1 RGBA 2BPP
///
PTC12A,
///
/// PVRTC1 RGBA 4BPP
///
PTC14A,
///
/// PVRTC2 RGBA 2BPP
///
PTC22,
///
/// PVRTC2 RGBA 4BPP
///
PTC24,
///
/// ATC RGB 4BPP
///
ATC,
///
/// ATCE RGBA 8 BPP explicit alpha
///
ATCE,
///
/// ATCI RGBA 8 BPP interpolated alpha
///
ATCI,
///
/// ASTC 4x4 8.0 BPP
///
ASTC4x4,
///
/// ASTC 5x4 6.40 BPP
///
ASTC5x4,
///
/// ASTC 5x5 5.12 BPP
///
ASTC5x5,
///
/// ASTC 6x5 4.27 BPP
///
ASTC6x5,
///
/// ASTC 6x6 3.56 BPP
///
ASTC6x6,
///
/// ASTC 8x5 3.20 BPP
///
ASTC8x5,
///
/// ASTC 8x6 2.67 BPP
///
ASTC8x6,
///
/// ASTC 8x8 2.00 BPP
///
ASTC8x8,
///
/// ASTC 10x5 2.56 BPP
///
ASTC10x5,
///
/// ASTC 10x6 2.13 BPP
///
ASTC10x6,
///
/// ASTC 10x8 1.60 BPP
///
ASTC10x8,
///
/// ASTC 10x10 1.28 BPP
///
ASTC10x10,
///
/// ASTC 12x10 1.07 BPP
///
ASTC12x10,
///
/// ASTC 12x12 0.89 BPP
///
ASTC12x12,
///
/// Compressed formats above.
///
Unknown,
R1,
A8,
R8,
R8I,
R8U,
R8S,
R16,
R16I,
R16U,
R16F,
R16S,
R32I,
R32U,
R32F,
RG8,
RG8I,
RG8U,
RG8S,
RG16,
RG16I,
RG16U,
RG16F,
RG16S,
RG32I,
RG32U,
RG32F,
RGB8,
RGB8I,
RGB8U,
RGB8S,
RGB9E5F,
BGRA8,
RGBA8,
RGBA8I,
RGBA8U,
RGBA8S,
RGBA16,
RGBA16I,
RGBA16U,
RGBA16F,
RGBA16S,
RGBA32I,
RGBA32U,
RGBA32F,
B5G6R5,
R5G6B5,
BGRA4,
RGBA4,
BGR5A1,
RGB5A1,
RGB10A2,
RG11B10F,
///
/// Depth formats below.
///
UnknownDepth,
D16,
D24,
D24S8,
D32,
D16F,
D24F,
D32F,
D0S8,
Count
}
[AllowDuplicates]
public enum UniformType : uint32
{
///
/// Sampler.
///
Sampler,
///
/// Reserved, do not use.
///
End,
///
/// 4 floats vector.
///
Vec4,
///
/// 3x3 matrix.
///
Mat3,
///
/// 4x4 matrix.
///
Mat4,
Count
}
[AllowDuplicates]
public enum BackbufferRatio : uint32
{
///
/// Equal to backbuffer.
///
Equal,
///
/// One half size of backbuffer.
///
Half,
///
/// One quarter size of backbuffer.
///
Quarter,
///
/// One eighth size of backbuffer.
///
Eighth,
///
/// One sixteenth size of backbuffer.
///
Sixteenth,
///
/// Double size of backbuffer.
///
Double,
Count
}
[AllowDuplicates]
public enum OcclusionQueryResult : uint32
{
///
/// Query failed test.
///
Invisible,
///
/// Query passed test.
///
Visible,
///
/// Query result is not available yet.
///
NoResult,
Count
}
[AllowDuplicates]
public enum Topology : uint32
{
///
/// Triangle list.
///
TriList,
///
/// Triangle strip.
///
TriStrip,
///
/// Line list.
///
LineList,
///
/// Line strip.
///
LineStrip,
///
/// Point list.
///
PointList,
Count
}
[AllowDuplicates]
public enum TopologyConvert : uint32
{
///
/// Flip winding order of triangle list.
///
TriListFlipWinding,
///
/// Flip winding order of triangle strip.
///
TriStripFlipWinding,
///
/// Convert triangle list to line list.
///
TriListToLineList,
///
/// Convert triangle strip to triangle list.
///
TriStripToTriList,
///
/// Convert line strip to line list.
///
LineStripToLineList,
Count
}
[AllowDuplicates]
public enum TopologySort : uint32
{
DirectionFrontToBackMin,
DirectionFrontToBackAvg,
DirectionFrontToBackMax,
DirectionBackToFrontMin,
DirectionBackToFrontAvg,
DirectionBackToFrontMax,
DistanceFrontToBackMin,
DistanceFrontToBackAvg,
DistanceFrontToBackMax,
DistanceBackToFrontMin,
DistanceBackToFrontAvg,
DistanceBackToFrontMax,
Count
}
[AllowDuplicates]
public enum ViewMode : uint32
{
///
/// Default sort order.
///
Default,
///
/// Sort in the same order in which submit calls were called.
///
Sequential,
///
/// Sort draw call depth in ascending order.
///
DepthAscending,
///
/// Sort draw call depth in descending order.
///
DepthDescending,
Count
}
[AllowDuplicates]
public enum NativeWindowHandleType : uint32
{
///
/// Platform default handle type (X11 on Linux).
///
Default,
///
/// Wayland.
///
Wayland,
Count
}
[AllowDuplicates]
public enum RenderFrame : uint32
{
///
/// Renderer context is not created yet.
///
NoContext,
///
/// Renderer context is created and rendering.
///
Render,
///
/// Renderer context wait for main thread signal timed out without rendering.
///
Timeout,
///
/// Renderer context is getting destroyed.
///
Exiting,
Count
}
[CRepr]
public struct Caps
{
[CRepr]
public struct GPU
{
public uint16 vendorId;
public uint16 deviceId;
}
[CRepr]
public struct Limits
{
public uint32 maxDrawCalls;
public uint32 maxBlits;
public uint32 maxTextureSize;
public uint32 maxTextureLayers;
public uint32 maxViews;
public uint32 maxFrameBuffers;
public uint32 maxFBAttachments;
public uint32 maxPrograms;
public uint32 maxShaders;
public uint32 maxTextures;
public uint32 maxTextureSamplers;
public uint32 maxComputeBindings;
public uint32 maxVertexLayouts;
public uint32 maxVertexStreams;
public uint32 maxIndexBuffers;
public uint32 maxVertexBuffers;
public uint32 maxDynamicIndexBuffers;
public uint32 maxDynamicVertexBuffers;
public uint32 maxUniforms;
public uint32 maxOcclusionQueries;
public uint32 maxEncoders;
public uint32 minResourceCbSize;
public uint32 transientVbSize;
public uint32 transientIbSize;
}
public RendererType rendererType;
public uint64 supported;
public uint16 vendorId;
public uint16 deviceId;
public uint8 homogeneousDepth;
public uint8 originBottomLeft;
public uint8 numGPUs;
public GPU[4] gpu;
public Limits limits;
public uint16[96] formats;
}
[CRepr]
public struct InternalData
{
public Caps* caps;
public void* context;
}
[CRepr]
public struct PlatformData
{
public void* ndt;
public void* nwh;
public void* context;
public void* backBuffer;
public void* backBufferDS;
public NativeWindowHandleType type;
}
[CRepr]
public struct Resolution
{
public TextureFormat format;
public uint32 width;
public uint32 height;
public uint32 reset;
public uint8 numBackBuffers;
public uint8 maxFrameLatency;
public uint8 debugTextScale;
}
[CRepr]
public struct Init
{
[CRepr]
public struct Limits
{
public uint16 maxEncoders;
public uint32 minResourceCbSize;
public uint32 transientVbSize;
public uint32 transientIbSize;
}
public RendererType type;
public uint16 vendorId;
public uint16 deviceId;
public uint64 capabilities;
public uint8 debug;
public uint8 profile;
public PlatformData platformData;
public Resolution resolution;
public Limits limits;
public void* callback;
public void* allocator;
}
[CRepr]
public struct Memory
{
public uint8* data;
public uint32 size;
}
[CRepr]
public struct TransientIndexBuffer
{
public uint8* data;
public uint32 size;
public uint32 startIndex;
public IndexBufferHandle handle;
public uint8 isIndex16;
}
[CRepr]
public struct TransientVertexBuffer
{
public uint8* data;
public uint32 size;
public uint32 startVertex;
public uint16 stride;
public VertexBufferHandle handle;
public VertexLayoutHandle layoutHandle;
}
[CRepr]
public struct InstanceDataBuffer
{
public uint8* data;
public uint32 size;
public uint32 offset;
public uint32 num;
public uint16 stride;
public VertexBufferHandle handle;
}
[CRepr]
public struct TextureInfo
{
public TextureFormat format;
public uint32 storageSize;
public uint16 width;
public uint16 height;
public uint16 depth;
public uint16 numLayers;
public uint8 numMips;
public uint8 bitsPerPixel;
public uint8 cubeMap;
}
[CRepr]
public struct UniformInfo
{
public char8[256] name;
public UniformType type;
public uint16 num;
}
[CRepr]
public struct Attachment
{
public Access access;
public TextureHandle handle;
public uint16 mip;
public uint16 layer;
public uint16 numLayers;
public uint8 resolve;
}
[CRepr]
public struct Transform
{
public float* data;
public uint16 num;
}
[CRepr]
public struct ViewStats
{
public char8[256] name;
public ViewId view;
public int64 cpuTimeBegin;
public int64 cpuTimeEnd;
public int64 gpuTimeBegin;
public int64 gpuTimeEnd;
public uint32 gpuFrameNum;
}
[CRepr]
public struct EncoderStats
{
public int64 cpuTimeBegin;
public int64 cpuTimeEnd;
}
[CRepr]
public struct Stats
{
public int64 cpuTimeFrame;
public int64 cpuTimeBegin;
public int64 cpuTimeEnd;
public int64 cpuTimerFreq;
public int64 gpuTimeBegin;
public int64 gpuTimeEnd;
public int64 gpuTimerFreq;
public int64 waitRender;
public int64 waitSubmit;
public uint32 numDraw;
public uint32 numCompute;
public uint32 numBlit;
public uint32 maxGpuLatency;
public uint32 gpuFrameNum;
public uint16 numDynamicIndexBuffers;
public uint16 numDynamicVertexBuffers;
public uint16 numFrameBuffers;
public uint16 numIndexBuffers;
public uint16 numOcclusionQueries;
public uint16 numPrograms;
public uint16 numShaders;
public uint16 numTextures;
public uint16 numUniforms;
public uint16 numVertexBuffers;
public uint16 numVertexLayouts;
public int64 textureMemoryUsed;
public int64 rtMemoryUsed;
public int transientVbUsed;
public int transientIbUsed;
public uint32[5] numPrims;
public int64 gpuMemoryMax;
public int64 gpuMemoryUsed;
public uint16 width;
public uint16 height;
public uint16 textWidth;
public uint16 textHeight;
public uint16 numViews;
public ViewStats* viewStats;
public uint8 numEncoders;
public EncoderStats* encoderStats;
}
[CRepr]
public struct VertexLayout
{
public uint32 hash;
public uint16 stride;
public uint16[18] offset;
public uint16[18] attributes;
}
[CRepr]
public struct Encoder
{
}
[CRepr]
public struct DynamicIndexBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct DynamicVertexBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct FrameBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct IndexBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct IndirectBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct OcclusionQueryHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct ProgramHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct ShaderHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct TextureHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct UniformHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct VertexBufferHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
[CRepr]
public struct VertexLayoutHandle {
public uint16 idx;
public bool Valid => idx != uint16.MaxValue;
}
///
/// Init attachment.
///
///
/// Render target texture handle.
/// Access. See `Access::Enum`.
/// Cubemap side or depth layer/slice to use.
/// Number of texture layer/slice(s) in array to use.
/// Mip level.
/// Resolve flags. See: `BGFX_RESOLVE_*`
///
[LinkName("bgfx_attachment_init")]
public static extern void attachment_init(Attachment* _this, TextureHandle _handle, Access _access, uint16 _layer, uint16 _numLayers, uint16 _mip, uint8 _resolve);
///
/// Start VertexLayout.
///
///
/// Renderer backend type. See: `bgfx::RendererType`
///
[LinkName("bgfx_vertex_layout_begin")]
public static extern VertexLayout* vertex_layout_begin(VertexLayout* _this, RendererType _rendererType);
///
/// Add attribute to VertexLayout.
/// @remarks Must be called between begin/end.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
/// Number of elements 1, 2, 3 or 4.
/// Element type.
/// When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.
/// Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.
///
[LinkName("bgfx_vertex_layout_add")]
public static extern VertexLayout* vertex_layout_add(VertexLayout* _this, Attrib _attrib, uint8 _num, AttribType _type, bool _normalized, bool _asInt);
///
/// Decode attribute.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
/// Number of elements.
/// Element type.
/// Attribute is normalized.
/// Attribute is packed as int.
///
[LinkName("bgfx_vertex_layout_decode")]
public static extern void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, uint8 * _num, AttribType* _type, bool* _normalized, bool* _asInt);
///
/// Returns `true` if VertexLayout contains attribute.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
///
[LinkName("bgfx_vertex_layout_has")]
public static extern bool vertex_layout_has(VertexLayout* _this, Attrib _attrib);
///
/// Skip `_num` bytes in vertex stream.
///
///
/// Number of bytes to skip.
///
[LinkName("bgfx_vertex_layout_skip")]
public static extern VertexLayout* vertex_layout_skip(VertexLayout* _this, uint8 _num);
///
/// End VertexLayout.
///
///
[LinkName("bgfx_vertex_layout_end")]
public static extern void vertex_layout_end(VertexLayout* _this);
///
/// Pack vertex attribute into vertex stream format.
///
///
/// Value to be packed into vertex stream.
/// `true` if input value is already normalized.
/// Attribute to pack.
/// Vertex stream layout.
/// Destination vertex stream where data will be packed.
/// Vertex index that will be modified.
///
[LinkName("bgfx_vertex_pack")]
public static extern void vertex_pack(float _input, bool _inputNormalized, Attrib _attr, VertexLayout* _layout, void* _data, uint32 _index);
///
/// Unpack vertex attribute from vertex stream format.
///
///
/// Result of unpacking.
/// Attribute to unpack.
/// Vertex stream layout.
/// Source vertex stream from where data will be unpacked.
/// Vertex index that will be unpacked.
///
[LinkName("bgfx_vertex_unpack")]
public static extern void vertex_unpack(float _output, Attrib _attr, VertexLayout* _layout, void* _data, uint32 _index);
///
/// Converts vertex stream data from one vertex stream format to another.
///
///
/// Destination vertex stream layout.
/// Destination vertex stream.
/// Source vertex stream layout.
/// Source vertex stream data.
/// Number of vertices to convert from source to destination.
///
[LinkName("bgfx_vertex_convert")]
public static extern void vertex_convert(VertexLayout* _dstLayout, void* _dstData, VertexLayout* _srcLayout, void* _srcData, uint32 _num);
///
/// Weld vertices.
///
///
/// Welded vertices remapping table. The size of buffer must be the same as number of vertices.
/// Vertex stream layout.
/// Vertex stream.
/// Number of vertices in vertex stream.
/// Set to `true` if input indices are 32-bit.
/// Error tolerance for vertex position comparison.
///
[LinkName("bgfx_weld_vertices")]
public static extern uint32 weld_vertices(void* _output, VertexLayout* _layout, void* _data, uint32 _num, bool _index32, float _epsilon);
///
/// Convert index buffer for use with different primitive topologies.
///
///
/// Conversion type, see `TopologyConvert::Enum`.
/// Destination index buffer. If this argument is NULL function will return number of indices after conversion.
/// Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.
/// Source indices.
/// Number of input indices.
/// Set to `true` if input indices are 32-bit.
///
[LinkName("bgfx_topology_convert")]
public static extern uint32 topology_convert(TopologyConvert _conversion, void* _dst, uint32 _dstSize, void* _indices, uint32 _numIndices, bool _index32);
///
/// Sort indices.
///
///
/// Sort order, see `TopologySort::Enum`.
/// Destination index buffer.
/// Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.
/// Direction (vector must be normalized).
/// Position.
/// Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer.
/// Vertex stride.
/// Source indices.
/// Number of input indices.
/// Set to `true` if input indices are 32-bit.
///
[LinkName("bgfx_topology_sort_tri_list")]
public static extern void topology_sort_tri_list(TopologySort _sort, void* _dst, uint32 _dstSize, float _dir, float _pos, void* _vertices, uint32 _stride, void* _indices, uint32 _numIndices, bool _index32);
///
/// Returns supported backend API renderers.
///
///
/// Maximum number of elements in _enum array.
/// Array where supported renderers will be written.
///
[LinkName("bgfx_get_supported_renderers")]
public static extern uint8 get_supported_renderers(uint8 _max, RendererType* _enum);
///
/// Returns name of renderer.
///
///
/// Renderer backend type. See: `bgfx::RendererType`
///
[LinkName("bgfx_get_renderer_name")]
public static extern char8* get_renderer_name(RendererType _type);
///
/// Fill bgfx::Init struct with default values, before using it to initialize the library.
///
///
/// Pointer to structure to be initialized. See: `bgfx::Init` for more info.
///
[LinkName("bgfx_init_ctor")]
public static extern void init_ctor(Init* _init);
///
/// Initialize the bgfx library.
///
///
/// Initialization parameters. See: `bgfx::Init` for more info.
///
[LinkName("bgfx_init")]
public static extern bool init(Init* _init);
///
/// Shutdown bgfx library.
///
///
[LinkName("bgfx_shutdown")]
public static extern void shutdown();
///
/// Reset graphic settings and back-buffer size.
/// @attention This call doesn’t change the window size, it just resizes
/// the back-buffer. Your windowing code controls the window size.
///
///
/// Back-buffer width.
/// Back-buffer height.
/// See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
/// Texture format. See: `TextureFormat::Enum`.
///
[LinkName("bgfx_reset")]
public static extern void reset(uint32 _width, uint32 _height, uint32 _flags, TextureFormat _format);
///
/// Advance to next frame. When using multithreaded renderer, this call
/// just swaps internal buffers, kicks render thread, and returns. In
/// singlethreaded renderer this call does frame rendering.
///
///
/// Capture frame with graphics debugger.
///
[LinkName("bgfx_frame")]
public static extern uint32 frame(bool _capture);
///
/// Returns current renderer backend API type.
/// @remarks
/// Library must be initialized.
///
///
[LinkName("bgfx_get_renderer_type")]
public static extern RendererType get_renderer_type();
///
/// Returns renderer capabilities.
/// @remarks
/// Library must be initialized.
///
///
[LinkName("bgfx_get_caps")]
public static extern Caps* get_caps();
///
/// Returns performance counters.
/// @attention Pointer returned is valid until `bgfx::frame` is called.
///
///
[LinkName("bgfx_get_stats")]
public static extern Stats* get_stats();
///
/// Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
///
///
/// Size to allocate.
///
[LinkName("bgfx_alloc")]
public static extern Memory* alloc(uint32 _size);
///
/// Allocate buffer and copy data into it. Data will be freed inside bgfx.
///
///
/// Pointer to data to be copied.
/// Size of data to be copied.
///
[LinkName("bgfx_copy")]
public static extern Memory* copy(void* _data, uint32 _size);
///
/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
/// doesn't allocate memory for data. It just copies the _data pointer. You
/// can pass `ReleaseFn` function pointer to release this memory after it's
/// consumed, otherwise you must make sure _data is available for at least 2
/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
/// from any thread.
/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
///
///
/// Pointer to data.
/// Size of data.
///
[LinkName("bgfx_make_ref")]
public static extern Memory* make_ref(void* _data, uint32 _size);
///
/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
/// doesn't allocate memory for data. It just copies the _data pointer. You
/// can pass `ReleaseFn` function pointer to release this memory after it's
/// consumed, otherwise you must make sure _data is available for at least 2
/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
/// from any thread.
/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
///
///
/// Pointer to data.
/// Size of data.
/// Callback function to release memory after use.
/// User data to be passed to callback function.
///
[LinkName("bgfx_make_ref_release")]
public static extern Memory* make_ref_release(void* _data, uint32 _size, void* _releaseFn, void* _userData);
///
/// Set debug flags.
///
///
/// Available flags: - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set all rendering calls will be skipped. This is useful when profiling to quickly assess potential bottlenecks between CPU and GPU. - `BGFX_DEBUG_PROFILER` - Enable profiler. - `BGFX_DEBUG_STATS` - Display internal statistics. - `BGFX_DEBUG_TEXT` - Display debug text. - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering primitives will be rendered as lines.
///
[LinkName("bgfx_set_debug")]
public static extern void set_debug(uint32 _debug);
///
/// Clear internal debug text buffer.
///
///
/// Background color.
/// Default 8x16 or 8x8 font.
///
[LinkName("bgfx_dbg_text_clear")]
public static extern void dbg_text_clear(uint8 _attr, bool _small);
///
/// Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
/// `printf` style format.
///
[LinkName("bgfx_dbg_text_printf")]
public static extern void dbg_text_printf(uint16 _x, uint16 _y, uint8 _attr, char8* _format, ... );
///
/// Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
/// `printf` style format.
/// Variable arguments list for format string.
///
[LinkName("bgfx_dbg_text_vprintf")]
public static extern void dbg_text_vprintf(uint16 _x, uint16 _y, uint8 _attr, char8* _format, void* _argList);
///
/// Draw image into internal debug text buffer.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Image width.
/// Image height.
/// Raw image data (character/attribute raw encoding).
/// Image pitch in bytes.
///
[LinkName("bgfx_dbg_text_image")]
public static extern void dbg_text_image(uint16 _x, uint16 _y, uint16 _width, uint16 _height, void* _data, uint16 _pitch);
///
/// Create static index buffer.
///
///
/// Index buffer data.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_index_buffer")]
public static extern IndexBufferHandle create_index_buffer(Memory* _mem, uint16 _flags);
///
/// Set static index buffer debug name.
///
///
/// Static index buffer handle.
/// Static index buffer name.
/// Static index buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_index_buffer_name")]
public static extern void set_index_buffer_name(IndexBufferHandle _handle, char8* _name, int _len);
///
/// Destroy static index buffer.
///
///
/// Static index buffer handle.
///
[LinkName("bgfx_destroy_index_buffer")]
public static extern void destroy_index_buffer(IndexBufferHandle _handle);
///
/// Create vertex layout.
///
///
/// Vertex layout.
///
[LinkName("bgfx_create_vertex_layout")]
public static extern VertexLayoutHandle create_vertex_layout(VertexLayout* _layout);
///
/// Destroy vertex layout.
///
///
/// Vertex layout handle.
///
[LinkName("bgfx_destroy_vertex_layout")]
public static extern void destroy_vertex_layout(VertexLayoutHandle _layoutHandle);
///
/// Create static vertex buffer.
///
///
/// Vertex buffer data.
/// Vertex layout.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_vertex_buffer")]
public static extern VertexBufferHandle create_vertex_buffer(Memory* _mem, VertexLayout* _layout, uint16 _flags);
///
/// Set static vertex buffer debug name.
///
///
/// Static vertex buffer handle.
/// Static vertex buffer name.
/// Static vertex buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_vertex_buffer_name")]
public static extern void set_vertex_buffer_name(VertexBufferHandle _handle, char8* _name, int _len);
///
/// Destroy static vertex buffer.
///
///
/// Static vertex buffer handle.
///
[LinkName("bgfx_destroy_vertex_buffer")]
public static extern void destroy_vertex_buffer(VertexBufferHandle _handle);
///
/// Create empty dynamic index buffer.
///
///
/// Number of indices.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_dynamic_index_buffer")]
public static extern DynamicIndexBufferHandle create_dynamic_index_buffer(uint32 _num, uint16 _flags);
///
/// Create a dynamic index buffer and initialize it.
///
///
/// Index buffer data.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_dynamic_index_buffer_mem")]
public static extern DynamicIndexBufferHandle create_dynamic_index_buffer_mem(Memory* _mem, uint16 _flags);
///
/// Update dynamic index buffer.
///
///
/// Dynamic index buffer handle.
/// Start index.
/// Index buffer data.
///
[LinkName("bgfx_update_dynamic_index_buffer")]
public static extern void update_dynamic_index_buffer(DynamicIndexBufferHandle _handle, uint32 _startIndex, Memory* _mem);
///
/// Destroy dynamic index buffer.
///
///
/// Dynamic index buffer handle.
///
[LinkName("bgfx_destroy_dynamic_index_buffer")]
public static extern void destroy_dynamic_index_buffer(DynamicIndexBufferHandle _handle);
///
/// Create empty dynamic vertex buffer.
///
///
/// Number of vertices.
/// Vertex layout.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_dynamic_vertex_buffer")]
public static extern DynamicVertexBufferHandle create_dynamic_vertex_buffer(uint32 _num, VertexLayout* _layout, uint16 _flags);
///
/// Create dynamic vertex buffer and initialize it.
///
///
/// Vertex buffer data.
/// Vertex layout.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[LinkName("bgfx_create_dynamic_vertex_buffer_mem")]
public static extern DynamicVertexBufferHandle create_dynamic_vertex_buffer_mem(Memory* _mem, VertexLayout* _layout, uint16 _flags);
///
/// Update dynamic vertex buffer.
///
///
/// Dynamic vertex buffer handle.
/// Start vertex.
/// Vertex buffer data.
///
[LinkName("bgfx_update_dynamic_vertex_buffer")]
public static extern void update_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint32 _startVertex, Memory* _mem);
///
/// Destroy dynamic vertex buffer.
///
///
/// Dynamic vertex buffer handle.
///
[LinkName("bgfx_destroy_dynamic_vertex_buffer")]
public static extern void destroy_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle);
///
/// Returns number of requested or maximum available indices.
///
///
/// Number of required indices.
/// Set to `true` if input indices will be 32-bit.
///
[LinkName("bgfx_get_avail_transient_index_buffer")]
public static extern uint32 get_avail_transient_index_buffer(uint32 _num, bool _index32);
///
/// Returns number of requested or maximum available vertices.
///
///
/// Number of required vertices.
/// Vertex layout.
///
[LinkName("bgfx_get_avail_transient_vertex_buffer")]
public static extern uint32 get_avail_transient_vertex_buffer(uint32 _num, VertexLayout* _layout);
///
/// Returns number of requested or maximum available instance buffer slots.
///
///
/// Number of required instances.
/// Stride per instance.
///
[LinkName("bgfx_get_avail_instance_data_buffer")]
public static extern uint32 get_avail_instance_data_buffer(uint32 _num, uint16 _stride);
///
/// Allocate transient index buffer.
///
///
/// TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.
/// Number of indices to allocate.
/// Set to `true` if input indices will be 32-bit.
///
[LinkName("bgfx_alloc_transient_index_buffer")]
public static extern void alloc_transient_index_buffer(TransientIndexBuffer* _tib, uint32 _num, bool _index32);
///
/// Allocate transient vertex buffer.
///
///
/// TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.
/// Number of vertices to allocate.
/// Vertex layout.
///
[LinkName("bgfx_alloc_transient_vertex_buffer")]
public static extern void alloc_transient_vertex_buffer(TransientVertexBuffer* _tvb, uint32 _num, VertexLayout* _layout);
///
/// Check for required space and allocate transient vertex and index
/// buffers. If both space requirements are satisfied function returns
/// true.
///
///
/// TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.
/// Vertex layout.
/// Number of vertices to allocate.
/// TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.
/// Number of indices to allocate.
/// Set to `true` if input indices will be 32-bit.
///
[LinkName("bgfx_alloc_transient_buffers")]
public static extern bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _layout, uint32 _numVertices, TransientIndexBuffer* _tib, uint32 _numIndices, bool _index32);
///
/// Allocate instance data buffer.
///
///
/// InstanceDataBuffer structure will be filled, and will be valid for duration of frame, and can be reused for multiple draw calls.
/// Number of instances.
/// Instance stride. Must be multiple of 16.
///
[LinkName("bgfx_alloc_instance_data_buffer")]
public static extern void alloc_instance_data_buffer(InstanceDataBuffer* _idb, uint32 _num, uint16 _stride);
///
/// Create draw indirect buffer.
///
///
/// Number of indirect calls.
///
[LinkName("bgfx_create_indirect_buffer")]
public static extern IndirectBufferHandle create_indirect_buffer(uint32 _num);
///
/// Destroy draw indirect buffer.
///
///
/// Indirect buffer handle.
///
[LinkName("bgfx_destroy_indirect_buffer")]
public static extern void destroy_indirect_buffer(IndirectBufferHandle _handle);
///
/// Create shader from memory buffer.
/// @remarks
/// Shader binary is obtained by compiling shader offline with shaderc command line tool.
///
///
/// Shader binary.
///
[LinkName("bgfx_create_shader")]
public static extern ShaderHandle create_shader(Memory* _mem);
///
/// Returns the number of uniforms and uniform handles used inside a shader.
/// @remarks
/// Only non-predefined uniforms are returned.
///
///
/// Shader handle.
/// UniformHandle array where data will be stored.
/// Maximum capacity of array.
///
[LinkName("bgfx_get_shader_uniforms")]
public static extern uint16 get_shader_uniforms(ShaderHandle _handle, UniformHandle* _uniforms, uint16 _max);
///
/// Set shader debug name.
///
///
/// Shader handle.
/// Shader name.
/// Shader name length (if length is INT32_MAX, it's expected that _name is zero terminated string).
///
[LinkName("bgfx_set_shader_name")]
public static extern void set_shader_name(ShaderHandle _handle, char8* _name, int _len);
///
/// Destroy shader.
/// @remark Once a shader program is created with _handle,
/// it is safe to destroy that shader.
///
///
/// Shader handle.
///
[LinkName("bgfx_destroy_shader")]
public static extern void destroy_shader(ShaderHandle _handle);
///
/// Create program with vertex and fragment shaders.
///
///
/// Vertex shader.
/// Fragment shader.
/// If true, shaders will be destroyed when program is destroyed.
///
[LinkName("bgfx_create_program")]
public static extern ProgramHandle create_program(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders);
///
/// Create program with compute shader.
///
///
/// Compute shader.
/// If true, shaders will be destroyed when program is destroyed.
///
[LinkName("bgfx_create_compute_program")]
public static extern ProgramHandle create_compute_program(ShaderHandle _csh, bool _destroyShaders);
///
/// Destroy program.
///
///
/// Program handle.
///
[LinkName("bgfx_destroy_program")]
public static extern void destroy_program(ProgramHandle _handle);
///
/// Validate texture parameters.
///
///
/// Depth dimension of volume texture.
/// Indicates that texture contains cubemap.
/// Number of layers in texture array.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture flags. See `BGFX_TEXTURE_*`.
///
[LinkName("bgfx_is_texture_valid")]
public static extern bool is_texture_valid(uint16 _depth, bool _cubeMap, uint16 _numLayers, TextureFormat _format, uint64 _flags);
///
/// Validate frame buffer parameters.
///
///
/// Number of attachments.
/// Attachment texture info. See: `bgfx::Attachment`.
///
[LinkName("bgfx_is_frame_buffer_valid")]
public static extern bool is_frame_buffer_valid(uint8 _num, Attachment* _attachment);
///
/// Calculate amount of memory required for texture.
///
///
/// Resulting texture info structure. See: `TextureInfo`.
/// Width.
/// Height.
/// Depth dimension of volume texture.
/// Indicates that texture contains cubemap.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array.
/// Texture format. See: `TextureFormat::Enum`.
///
[LinkName("bgfx_calc_texture_size")]
public static extern void calc_texture_size(TextureInfo* _info, uint16 _width, uint16 _height, uint16 _depth, bool _cubeMap, bool _hasMips, uint16 _numLayers, TextureFormat _format);
///
/// Create texture from memory buffer.
///
///
/// DDS, KTX or PVR texture binary data.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Skip top level mips when parsing texture.
/// When non-`NULL` is specified it returns parsed texture information.
///
[LinkName("bgfx_create_texture")]
public static extern TextureHandle create_texture(Memory* _mem, uint64 _flags, uint8 _skip, TextureInfo* _info);
///
/// Create 2D texture.
///
///
/// Width.
/// Height.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[LinkName("bgfx_create_texture_2d")]
public static extern TextureHandle create_texture_2d(uint16 _width, uint16 _height, bool _hasMips, uint16 _numLayers, TextureFormat _format, uint64 _flags, Memory* _mem);
///
/// Create texture with size based on back-buffer ratio. Texture will maintain ratio
/// if back buffer resolution changes.
///
///
/// Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_create_texture_2d_scaled")]
public static extern TextureHandle create_texture_2d_scaled(BackbufferRatio _ratio, bool _hasMips, uint16 _numLayers, TextureFormat _format, uint64 _flags);
///
/// Create 3D texture.
///
///
/// Width.
/// Height.
/// Depth.
/// Indicates that texture contains full mip-map chain.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[LinkName("bgfx_create_texture_3d")]
public static extern TextureHandle create_texture_3d(uint16 _width, uint16 _height, uint16 _depth, bool _hasMips, TextureFormat _format, uint64 _flags, Memory* _mem);
///
/// Create Cube texture.
///
///
/// Cube side size.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[LinkName("bgfx_create_texture_cube")]
public static extern TextureHandle create_texture_cube(uint16 _size, bool _hasMips, uint16 _numLayers, TextureFormat _format, uint64 _flags, Memory* _mem);
///
/// Update 2D texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
///
///
/// Texture handle.
/// Layer in texture array.
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Texture update data.
/// Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.
///
[LinkName("bgfx_update_texture_2d")]
public static extern void update_texture_2d(TextureHandle _handle, uint16 _layer, uint8 _mip, uint16 _x, uint16 _y, uint16 _width, uint16 _height, Memory* _mem, uint16 _pitch);
///
/// Update 3D texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
///
///
/// Texture handle.
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Z offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Depth of texture block.
/// Texture update data.
///
[LinkName("bgfx_update_texture_3d")]
public static extern void update_texture_3d(TextureHandle _handle, uint8 _mip, uint16 _x, uint16 _y, uint16 _z, uint16 _width, uint16 _height, uint16 _depth, Memory* _mem);
///
/// Update Cube texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
///
///
/// Texture handle.
/// Layer in texture array.
/// Cubemap side `BGFX_CUBE_MAP__`, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z. +----------+ |-z 2| | ^ +y | | | | Unfolded cube: | +---->+x | +----------+----------+----------+----------+ |+y 1|+y 4|+y 0|+y 5| | ^ -x | ^ +z | ^ +x | ^ -z | | | | | | | | | | | +---->+z | +---->+x | +---->-z | +---->-x | +----------+----------+----------+----------+ |+z 3| | ^ -y | | | | | +---->+x | +----------+
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Texture update data.
/// Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.
///
[LinkName("bgfx_update_texture_cube")]
public static extern void update_texture_cube(TextureHandle _handle, uint16 _layer, uint8 _side, uint8 _mip, uint16 _x, uint16 _y, uint16 _width, uint16 _height, Memory* _mem, uint16 _pitch);
///
/// Read back texture content.
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
///
///
/// Texture handle.
/// Destination buffer.
/// Mip level.
///
[LinkName("bgfx_read_texture")]
public static extern uint32 read_texture(TextureHandle _handle, void* _data, uint8 _mip);
///
/// Set texture debug name.
///
///
/// Texture handle.
/// Texture name.
/// Texture name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_texture_name")]
public static extern void set_texture_name(TextureHandle _handle, char8* _name, int _len);
///
/// Returns texture direct access pointer.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
/// is available on GPUs that have unified memory architecture (UMA) support.
///
///
/// Texture handle.
///
[LinkName("bgfx_get_direct_access_ptr")]
public static extern void* get_direct_access_ptr(TextureHandle _handle);
///
/// Destroy texture.
///
///
/// Texture handle.
///
[LinkName("bgfx_destroy_texture")]
public static extern void destroy_texture(TextureHandle _handle);
///
/// Create frame buffer (simple).
///
///
/// Texture width.
/// Texture height.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_create_frame_buffer")]
public static extern FrameBufferHandle create_frame_buffer(uint16 _width, uint16 _height, TextureFormat _format, uint64 _textureFlags);
///
/// Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
/// if back buffer resolution changes.
///
///
/// Frame buffer size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_create_frame_buffer_scaled")]
public static extern FrameBufferHandle create_frame_buffer_scaled(BackbufferRatio _ratio, TextureFormat _format, uint64 _textureFlags);
///
/// Create MRT frame buffer from texture handles (simple).
///
///
/// Number of texture handles.
/// Texture attachments.
/// If true, textures will be destroyed when frame buffer is destroyed.
///
[LinkName("bgfx_create_frame_buffer_from_handles")]
public static extern FrameBufferHandle create_frame_buffer_from_handles(uint8 _num, TextureHandle* _handles, bool _destroyTexture);
///
/// Create MRT frame buffer from texture handles with specific layer and
/// mip level.
///
///
/// Number of attachments.
/// Attachment texture info. See: `bgfx::Attachment`.
/// If true, textures will be destroyed when frame buffer is destroyed.
///
[LinkName("bgfx_create_frame_buffer_from_attachment")]
public static extern FrameBufferHandle create_frame_buffer_from_attachment(uint8 _num, Attachment* _attachment, bool _destroyTexture);
///
/// Create frame buffer for multiple window rendering.
/// @remarks
/// Frame buffer cannot be used for sampling.
/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
///
///
/// OS' target native window handle.
/// Window back buffer width.
/// Window back buffer height.
/// Window back buffer color format.
/// Window back buffer depth format.
///
[LinkName("bgfx_create_frame_buffer_from_nwh")]
public static extern FrameBufferHandle create_frame_buffer_from_nwh(void* _nwh, uint16 _width, uint16 _height, TextureFormat _format, TextureFormat _depthFormat);
///
/// Set frame buffer debug name.
///
///
/// Frame buffer handle.
/// Frame buffer name.
/// Frame buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_frame_buffer_name")]
public static extern void set_frame_buffer_name(FrameBufferHandle _handle, char8* _name, int _len);
///
/// Obtain texture handle of frame buffer attachment.
///
///
/// Frame buffer handle.
///
[LinkName("bgfx_get_texture")]
public static extern TextureHandle get_texture(FrameBufferHandle _handle, uint8 _attachment);
///
/// Destroy frame buffer.
///
///
/// Frame buffer handle.
///
[LinkName("bgfx_destroy_frame_buffer")]
public static extern void destroy_frame_buffer(FrameBufferHandle _handle);
///
/// Create shader uniform parameter.
/// @remarks
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
/// multiple times with the same uniform name. The library will always
/// return the same handle, but the handle reference count will be
/// incremented. This means that the same number of `bgfx::destroyUniform`
/// must be called to properly destroy the uniform.
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
/// view, in pixels.
/// - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
/// width and height
/// - `u_view mat4` - view matrix
/// - `u_invView mat4` - inverted view matrix
/// - `u_proj mat4` - projection matrix
/// - `u_invProj mat4` - inverted projection matrix
/// - `u_viewProj mat4` - concatenated view projection matrix
/// - `u_invViewProj mat4` - concatenated inverted view projection matrix
/// - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
/// - `u_modelView mat4` - concatenated model view matrix, only first
/// model matrix from array is used.
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
/// - `u_alphaRef float` - alpha reference value for alpha test.
///
///
/// Uniform name in shader.
/// Type of uniform (See: `bgfx::UniformType`).
/// Number of elements in array.
///
[LinkName("bgfx_create_uniform")]
public static extern UniformHandle create_uniform(char8* _name, UniformType _type, uint16 _num);
///
/// Retrieve uniform info.
///
///
/// Handle to uniform object.
/// Uniform info.
///
[LinkName("bgfx_get_uniform_info")]
public static extern void get_uniform_info(UniformHandle _handle, UniformInfo* _info);
///
/// Destroy shader uniform parameter.
///
///
/// Handle to uniform object.
///
[LinkName("bgfx_destroy_uniform")]
public static extern void destroy_uniform(UniformHandle _handle);
///
/// Create occlusion query.
///
///
[LinkName("bgfx_create_occlusion_query")]
public static extern OcclusionQueryHandle create_occlusion_query();
///
/// Retrieve occlusion query result from previous frame.
///
///
/// Handle to occlusion query object.
/// Number of pixels that passed test. This argument can be `NULL` if result of occlusion query is not needed.
///
[LinkName("bgfx_get_result")]
public static extern OcclusionQueryResult get_result(OcclusionQueryHandle _handle, int* _result);
///
/// Destroy occlusion query.
///
///
/// Handle to occlusion query object.
///
[LinkName("bgfx_destroy_occlusion_query")]
public static extern void destroy_occlusion_query(OcclusionQueryHandle _handle);
///
/// Set palette color value.
///
///
/// Index into palette.
/// RGBA floating point values.
///
[LinkName("bgfx_set_palette_color")]
public static extern void set_palette_color(uint8 _index, float _rgba);
///
/// Set palette color value.
///
///
/// Index into palette.
/// Packed 32-bit RGBA value.
///
[LinkName("bgfx_set_palette_color_rgba8")]
public static extern void set_palette_color_rgba8(uint8 _index, uint32 _rgba);
///
/// Set view name.
/// @remarks
/// This is debug only feature.
/// In graphics debugger view name will appear as:
/// "nnnc "
/// ^ ^ ^
/// | +--- compute (C)
/// +------ view id
///
///
/// View id.
/// View name.
/// View name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_view_name")]
public static extern void set_view_name(ViewId _id, char8* _name, int _len);
///
/// Set view rectangle. Draw primitive outside view will be clipped.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view port region.
/// Height of view port region.
///
[LinkName("bgfx_set_view_rect")]
public static extern void set_view_rect(ViewId _id, uint16 _x, uint16 _y, uint16 _width, uint16 _height);
///
/// Set view rectangle. Draw primitive outside view will be clipped.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width and height will be set in respect to back-buffer size. See: `BackbufferRatio::Enum`.
///
[LinkName("bgfx_set_view_rect_ratio")]
public static extern void set_view_rect_ratio(ViewId _id, uint16 _x, uint16 _y, BackbufferRatio _ratio);
///
/// Set view scissor. Draw primitive outside view will be clipped. When
/// _x, _y, _width and _height are set to 0, scissor will be disabled.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[LinkName("bgfx_set_view_scissor")]
public static extern void set_view_scissor(ViewId _id, uint16 _x, uint16 _y, uint16 _width, uint16 _height);
///
/// Set view clear flags.
///
///
/// View id.
/// Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.
/// Color clear value.
/// Depth clear value.
/// Stencil clear value.
///
[LinkName("bgfx_set_view_clear")]
public static extern void set_view_clear(ViewId _id, uint16 _flags, uint32 _rgba, float _depth, uint8 _stencil);
///
/// Set view clear flags with different clear color for each
/// frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
/// clear color palette.
///
///
/// View id.
/// Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.
/// Depth clear value.
/// Stencil clear value.
/// Palette index for frame buffer attachment 0.
/// Palette index for frame buffer attachment 1.
/// Palette index for frame buffer attachment 2.
/// Palette index for frame buffer attachment 3.
/// Palette index for frame buffer attachment 4.
/// Palette index for frame buffer attachment 5.
/// Palette index for frame buffer attachment 6.
/// Palette index for frame buffer attachment 7.
///
[LinkName("bgfx_set_view_clear_mrt")]
public static extern void set_view_clear_mrt(ViewId _id, uint16 _flags, float _depth, uint8 _stencil, uint8 _c0, uint8 _c1, uint8 _c2, uint8 _c3, uint8 _c4, uint8 _c5, uint8 _c6, uint8 _c7);
///
/// Set view sorting mode.
/// @remarks
/// View mode must be set prior calling `bgfx::submit` for the view.
///
///
/// View id.
/// View sort mode. See `ViewMode::Enum`.
///
[LinkName("bgfx_set_view_mode")]
public static extern void set_view_mode(ViewId _id, ViewMode _mode);
///
/// Set view frame buffer.
/// @remarks
/// Not persistent after `bgfx::reset` call.
///
///
/// View id.
/// Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as frame buffer handle will draw primitives from this view into default back buffer.
///
[LinkName("bgfx_set_view_frame_buffer")]
public static extern void set_view_frame_buffer(ViewId _id, FrameBufferHandle _handle);
///
/// Set view's view matrix and projection matrix,
/// all draw primitives in this view will use these two matrices.
///
///
/// View id.
/// View matrix.
/// Projection matrix.
///
[LinkName("bgfx_set_view_transform")]
public static extern void set_view_transform(ViewId _id, void* _view, void* _proj);
///
/// Post submit view reordering.
///
///
/// First view id.
/// Number of views to remap.
/// View remap id table. Passing `NULL` will reset view ids to default state.
///
[LinkName("bgfx_set_view_order")]
public static extern void set_view_order(ViewId _id, uint16 _num, ViewId* _order);
///
/// Reset all view settings to default.
///
///
[LinkName("bgfx_reset_view")]
public static extern void reset_view(ViewId _id);
///
/// Begin submitting draw calls from thread.
///
///
/// Explicitly request an encoder for a worker thread.
///
[LinkName("bgfx_encoder_begin")]
public static extern Encoder* encoder_begin(bool _forThread);
///
/// End submitting draw calls from thread.
///
///
/// Encoder.
///
[LinkName("bgfx_encoder_end")]
public static extern void encoder_end(Encoder* _encoder);
///
/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
/// graphics debugging tools.
///
///
/// Marker name.
/// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_encoder_set_marker")]
public static extern void encoder_set_marker(Encoder* _this, char8* _name, int _len);
///
/// Set render states for draw primitive.
/// @remarks
/// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
///
/// State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
/// Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
[LinkName("bgfx_encoder_set_state")]
public static extern void encoder_set_state(Encoder* _this, uint64 _state, uint32 _rgba);
///
/// Set condition for rendering.
///
///
/// Occlusion query handle.
/// Render if occlusion query is visible.
///
[LinkName("bgfx_encoder_set_condition")]
public static extern void encoder_set_condition(Encoder* _this, OcclusionQueryHandle _handle, bool _visible);
///
/// Set stencil test state.
///
///
/// Front stencil state.
/// Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.
///
[LinkName("bgfx_encoder_set_stencil")]
public static extern void encoder_set_stencil(Encoder* _this, uint32 _fstencil, uint32 _bstencil);
///
/// Set scissor for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[LinkName("bgfx_encoder_set_scissor")]
public static extern uint16 encoder_set_scissor(Encoder* _this, uint16 _x, uint16 _y, uint16 _width, uint16 _height);
///
/// Set scissor from cache for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Index in scissor cache.
///
[LinkName("bgfx_encoder_set_scissor_cached")]
public static extern void encoder_set_scissor_cached(Encoder* _this, uint16 _cache);
///
/// Set model matrix for draw primitive. If it is not called,
/// the model will be rendered with an identity model matrix.
///
///
/// Pointer to first matrix in array.
/// Number of matrices in array.
///
[LinkName("bgfx_encoder_set_transform")]
public static extern uint32 encoder_set_transform(Encoder* _this, void* _mtx, uint16 _num);
///
/// Set model matrix from matrix cache for draw primitive.
///
///
/// Index in matrix cache.
/// Number of matrices from cache.
///
[LinkName("bgfx_encoder_set_transform_cached")]
public static extern void encoder_set_transform_cached(Encoder* _this, uint32 _cache, uint16 _num);
///
/// Reserve matrices in internal matrix cache.
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
///
///
/// Pointer to `Transform` structure.
/// Number of matrices.
///
[LinkName("bgfx_encoder_alloc_transform")]
public static extern uint32 encoder_alloc_transform(Encoder* _this, Transform* _transform, uint16 _num);
///
/// Set shader uniform parameter for draw primitive.
///
///
/// Uniform.
/// Pointer to uniform data.
/// Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.
///
[LinkName("bgfx_encoder_set_uniform")]
public static extern void encoder_set_uniform(Encoder* _this, UniformHandle _handle, void* _value, uint16 _num);
///
/// Set index buffer for draw primitive.
///
///
/// Index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_encoder_set_index_buffer")]
public static extern void encoder_set_index_buffer(Encoder* _this, IndexBufferHandle _handle, uint32 _firstIndex, uint32 _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Dynamic index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_encoder_set_dynamic_index_buffer")]
public static extern void encoder_set_dynamic_index_buffer(Encoder* _this, DynamicIndexBufferHandle _handle, uint32 _firstIndex, uint32 _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Transient index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_encoder_set_transient_index_buffer")]
public static extern void encoder_set_transient_index_buffer(Encoder* _this, TransientIndexBuffer* _tib, uint32 _firstIndex, uint32 _numIndices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_encoder_set_vertex_buffer")]
public static extern void encoder_set_vertex_buffer(Encoder* _this, uint8 _stream, VertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
///
[LinkName("bgfx_encoder_set_vertex_buffer_with_layout")]
public static extern void encoder_set_vertex_buffer_with_layout(Encoder* _this, uint8 _stream, VertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Dynamic vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_encoder_set_dynamic_vertex_buffer")]
public static extern void encoder_set_dynamic_vertex_buffer(Encoder* _this, uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices);
[LinkName("bgfx_encoder_set_dynamic_vertex_buffer_with_layout")]
public static extern void encoder_set_dynamic_vertex_buffer_with_layout(Encoder* _this, uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_encoder_set_transient_vertex_buffer")]
public static extern void encoder_set_transient_vertex_buffer(Encoder* _this, uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
///
[LinkName("bgfx_encoder_set_transient_vertex_buffer_with_layout")]
public static extern void encoder_set_transient_vertex_buffer_with_layout(Encoder* _this, uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
/// Number of vertices.
///
[LinkName("bgfx_encoder_set_vertex_count")]
public static extern void encoder_set_vertex_count(Encoder* _this, uint32 _numVertices);
///
/// Set instance data buffer for draw primitive.
///
///
/// Transient instance data buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_encoder_set_instance_data_buffer")]
public static extern void encoder_set_instance_data_buffer(Encoder* _this, InstanceDataBuffer* _idb, uint32 _start, uint32 _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Vertex buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_encoder_set_instance_data_from_vertex_buffer")]
public static extern void encoder_set_instance_data_from_vertex_buffer(Encoder* _this, VertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Dynamic vertex buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer")]
public static extern void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _this, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
///
/// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
[LinkName("bgfx_encoder_set_instance_count")]
public static extern void encoder_set_instance_count(Encoder* _this, uint32 _numInstances);
///
/// Set texture stage for draw primitive.
///
///
/// Texture unit.
/// Program sampler.
/// Texture handle.
/// Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_encoder_set_texture")]
public static extern void encoder_set_texture(Encoder* _this, uint8 _stage, UniformHandle _sampler, TextureHandle _handle, uint32 _flags);
///
/// Submit an empty primitive for rendering. Uniforms and draw state
/// will be applied but no geometry will be submitted. Useful in cases
/// when no other draw/compute primitive is submitted to view, but it's
/// desired to execute clear view.
/// @remark
/// These empty draw calls will sort before ordinary draw calls.
///
///
/// View id.
///
[LinkName("bgfx_encoder_touch")]
public static extern void encoder_touch(Encoder* _this, ViewId _id);
///
/// Submit primitive for rendering.
///
///
/// View id.
/// Program.
/// Depth for sorting.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_submit")]
public static extern void encoder_submit(Encoder* _this, ViewId _id, ProgramHandle _program, uint32 _depth, uint8 _flags);
///
/// Submit primitive with occlusion query for rendering.
///
///
/// View id.
/// Program.
/// Occlusion query.
/// Depth for sorting.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_submit_occlusion_query")]
public static extern void encoder_submit_occlusion_query(Encoder* _this, ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32 _depth, uint8 _flags);
///
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of draws.
/// Depth for sorting.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_submit_indirect")]
public static extern void encoder_submit_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint32 _depth, uint8 _flags);
///
/// Submit primitive for rendering with index and instance data info and
/// draw count from indirect buffers.
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
/// Element in number buffer.
/// Max number of draws.
/// Depth for sorting.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_submit_indirect_count")]
public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags);
///
/// Set compute index buffer.
///
///
/// Compute stage.
/// Index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_encoder_set_compute_index_buffer")]
public static extern void encoder_set_compute_index_buffer(Encoder* _this, uint8 _stage, IndexBufferHandle _handle, Access _access);
///
/// Set compute vertex buffer.
///
///
/// Compute stage.
/// Vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_encoder_set_compute_vertex_buffer")]
public static extern void encoder_set_compute_vertex_buffer(Encoder* _this, uint8 _stage, VertexBufferHandle _handle, Access _access);
///
/// Set compute dynamic index buffer.
///
///
/// Compute stage.
/// Dynamic index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_encoder_set_compute_dynamic_index_buffer")]
public static extern void encoder_set_compute_dynamic_index_buffer(Encoder* _this, uint8 _stage, DynamicIndexBufferHandle _handle, Access _access);
///
/// Set compute dynamic vertex buffer.
///
///
/// Compute stage.
/// Dynamic vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_encoder_set_compute_dynamic_vertex_buffer")]
public static extern void encoder_set_compute_dynamic_vertex_buffer(Encoder* _this, uint8 _stage, DynamicVertexBufferHandle _handle, Access _access);
///
/// Set compute indirect buffer.
///
///
/// Compute stage.
/// Indirect buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_encoder_set_compute_indirect_buffer")]
public static extern void encoder_set_compute_indirect_buffer(Encoder* _this, uint8 _stage, IndirectBufferHandle _handle, Access _access);
///
/// Set compute image from texture.
///
///
/// Compute stage.
/// Texture handle.
/// Mip level.
/// Image access. See `Access::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
///
[LinkName("bgfx_encoder_set_image")]
public static extern void encoder_set_image(Encoder* _this, uint8 _stage, TextureHandle _handle, uint8 _mip, Access _access, TextureFormat _format);
///
/// Dispatch compute.
///
///
/// View id.
/// Compute program.
/// Number of groups X.
/// Number of groups Y.
/// Number of groups Z.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_dispatch")]
public static extern void encoder_dispatch(Encoder* _this, ViewId _id, ProgramHandle _program, uint32 _numX, uint32 _numY, uint32 _numZ, uint8 _flags);
///
/// Dispatch compute indirect.
///
///
/// View id.
/// Compute program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_dispatch_indirect")]
public static extern void encoder_dispatch_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint8 _flags);
///
/// Discard previously set state for draw or compute call.
///
///
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_encoder_discard")]
public static extern void encoder_discard(Encoder* _this, uint8 _flags);
///
/// Blit 2D texture region between two 2D textures.
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
///
///
/// View id.
/// Destination texture handle.
/// Destination texture mip level.
/// Destination texture X position.
/// Destination texture Y position.
/// If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.
/// Source texture handle.
/// Source texture mip level.
/// Source texture X position.
/// Source texture Y position.
/// If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.
/// Width of region.
/// Height of region.
/// If texture is 3D this argument represents depth of region, otherwise it's unused.
///
[LinkName("bgfx_encoder_blit")]
public static extern void encoder_blit(Encoder* _this, ViewId _id, TextureHandle _dst, uint8 _dstMip, uint16 _dstX, uint16 _dstY, uint16 _dstZ, TextureHandle _src, uint8 _srcMip, uint16 _srcX, uint16 _srcY, uint16 _srcZ, uint16 _width, uint16 _height, uint16 _depth);
///
/// Request screen shot of window back buffer.
/// @remarks
/// `bgfx::CallbackI::screenShot` must be implemented.
/// @attention Frame buffer handle must be created with OS' target native window handle.
///
///
/// Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.
/// Will be passed to `bgfx::CallbackI::screenShot` callback.
///
[LinkName("bgfx_request_screen_shot")]
public static extern void request_screen_shot(FrameBufferHandle _handle, char8* _filePath);
///
/// Render frame.
/// @attention `bgfx::renderFrame` is blocking call. It waits for
/// `bgfx::frame` to be called from API thread to process frame.
/// If timeout value is passed call will timeout and return even
/// if `bgfx::frame` is not called.
/// @warning This call should be only used on platforms that don't
/// allow creating separate rendering thread. If it is called before
/// to bgfx::init, render thread won't be created by bgfx::init call.
///
///
/// Timeout in milliseconds.
///
[LinkName("bgfx_render_frame")]
public static extern RenderFrame render_frame(int _msecs);
///
/// Set platform data.
/// @warning Must be called before `bgfx::init`.
///
///
/// Platform data.
///
[LinkName("bgfx_set_platform_data")]
public static extern void set_platform_data(PlatformData* _data);
///
/// Get internal data for interop.
/// @attention It's expected you understand some bgfx internals before you
/// use this call.
/// @warning Must be called only on render thread.
///
///
[LinkName("bgfx_get_internal_data")]
public static extern InternalData* get_internal_data();
///
/// Override internal texture with externally created texture. Previously
/// created internal texture will released.
/// @attention It's expected you understand some bgfx internals before you
/// use this call.
/// @warning Must be called only on render thread.
///
///
/// Texture handle.
/// Native API pointer to texture.
///
[LinkName("bgfx_override_internal_texture_ptr")]
public static extern void* override_internal_texture_ptr(TextureHandle _handle, void* _ptr);
///
/// Override internal texture by creating new texture. Previously created
/// internal texture will released.
/// @attention It's expected you understand some bgfx internals before you
/// use this call.
/// @returns Native API pointer to texture. If result is 0, texture is not created yet from the
/// main thread.
/// @warning Must be called only on render thread.
///
///
/// Texture handle.
/// Width.
/// Height.
/// Number of mip-maps.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_override_internal_texture")]
public static extern void* override_internal_texture(TextureHandle _handle, uint16 _width, uint16 _height, uint8 _numMips, TextureFormat _format, uint64 _flags);
///
/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
/// graphics debugging tools.
///
///
/// Marker name.
/// Marker name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[LinkName("bgfx_set_marker")]
public static extern void set_marker(char8* _name, int _len);
///
/// Set render states for draw primitive.
/// @remarks
/// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
///
/// State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
/// Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
[LinkName("bgfx_set_state")]
public static extern void set_state(uint64 _state, uint32 _rgba);
///
/// Set condition for rendering.
///
///
/// Occlusion query handle.
/// Render if occlusion query is visible.
///
[LinkName("bgfx_set_condition")]
public static extern void set_condition(OcclusionQueryHandle _handle, bool _visible);
///
/// Set stencil test state.
///
///
/// Front stencil state.
/// Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.
///
[LinkName("bgfx_set_stencil")]
public static extern void set_stencil(uint32 _fstencil, uint32 _bstencil);
///
/// Set scissor for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[LinkName("bgfx_set_scissor")]
public static extern uint16 set_scissor(uint16 _x, uint16 _y, uint16 _width, uint16 _height);
///
/// Set scissor from cache for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Index in scissor cache.
///
[LinkName("bgfx_set_scissor_cached")]
public static extern void set_scissor_cached(uint16 _cache);
///
/// Set model matrix for draw primitive. If it is not called,
/// the model will be rendered with an identity model matrix.
///
///
/// Pointer to first matrix in array.
/// Number of matrices in array.
///
[LinkName("bgfx_set_transform")]
public static extern uint32 set_transform(void* _mtx, uint16 _num);
///
/// Set model matrix from matrix cache for draw primitive.
///
///
/// Index in matrix cache.
/// Number of matrices from cache.
///
[LinkName("bgfx_set_transform_cached")]
public static extern void set_transform_cached(uint32 _cache, uint16 _num);
///
/// Reserve matrices in internal matrix cache.
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
///
///
/// Pointer to `Transform` structure.
/// Number of matrices.
///
[LinkName("bgfx_alloc_transform")]
public static extern uint32 alloc_transform(Transform* _transform, uint16 _num);
///
/// Set shader uniform parameter for draw primitive.
///
///
/// Uniform.
/// Pointer to uniform data.
/// Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.
///
[LinkName("bgfx_set_uniform")]
public static extern void set_uniform(UniformHandle _handle, void* _value, uint16 _num);
///
/// Set index buffer for draw primitive.
///
///
/// Index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_set_index_buffer")]
public static extern void set_index_buffer(IndexBufferHandle _handle, uint32 _firstIndex, uint32 _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Dynamic index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_set_dynamic_index_buffer")]
public static extern void set_dynamic_index_buffer(DynamicIndexBufferHandle _handle, uint32 _firstIndex, uint32 _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Transient index buffer.
/// First index to render.
/// Number of indices to render.
///
[LinkName("bgfx_set_transient_index_buffer")]
public static extern void set_transient_index_buffer(TransientIndexBuffer* _tib, uint32 _firstIndex, uint32 _numIndices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_set_vertex_buffer")]
public static extern void set_vertex_buffer(uint8 _stream, VertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
///
[LinkName("bgfx_set_vertex_buffer_with_layout")]
public static extern void set_vertex_buffer_with_layout(uint8 _stream, VertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Dynamic vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_set_dynamic_vertex_buffer")]
public static extern void set_dynamic_vertex_buffer(uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Dynamic vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
///
[LinkName("bgfx_set_dynamic_vertex_buffer_with_layout")]
public static extern void set_dynamic_vertex_buffer_with_layout(uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[LinkName("bgfx_set_transient_vertex_buffer")]
public static extern void set_transient_vertex_buffer(uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
///
[LinkName("bgfx_set_transient_vertex_buffer_with_layout")]
public static extern void set_transient_vertex_buffer_with_layout(uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
///
/// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
/// Number of vertices.
///
[LinkName("bgfx_set_vertex_count")]
public static extern void set_vertex_count(uint32 _numVertices);
///
/// Set instance data buffer for draw primitive.
///
///
/// Transient instance data buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_set_instance_data_buffer")]
public static extern void set_instance_data_buffer(InstanceDataBuffer* _idb, uint32 _start, uint32 _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Vertex buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_set_instance_data_from_vertex_buffer")]
public static extern void set_instance_data_from_vertex_buffer(VertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Dynamic vertex buffer.
/// First instance data.
/// Number of data instances.
///
[LinkName("bgfx_set_instance_data_from_dynamic_vertex_buffer")]
public static extern void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
///
/// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
[LinkName("bgfx_set_instance_count")]
public static extern void set_instance_count(uint32 _numInstances);
///
/// Set texture stage for draw primitive.
///
///
/// Texture unit.
/// Program sampler.
/// Texture handle.
/// Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[LinkName("bgfx_set_texture")]
public static extern void set_texture(uint8 _stage, UniformHandle _sampler, TextureHandle _handle, uint32 _flags);
///
/// Submit an empty primitive for rendering. Uniforms and draw state
/// will be applied but no geometry will be submitted.
/// @remark
/// These empty draw calls will sort before ordinary draw calls.
///
///
/// View id.
///
[LinkName("bgfx_touch")]
public static extern void touch(ViewId _id);
///
/// Submit primitive for rendering.
///
///
/// View id.
/// Program.
/// Depth for sorting.
/// Which states to discard for next draw. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_submit")]
public static extern void submit(ViewId _id, ProgramHandle _program, uint32 _depth, uint8 _flags);
///
/// Submit primitive with occlusion query for rendering.
///
///
/// View id.
/// Program.
/// Occlusion query.
/// Depth for sorting.
/// Which states to discard for next draw. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_submit_occlusion_query")]
public static extern void submit_occlusion_query(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32 _depth, uint8 _flags);
///
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of draws.
/// Depth for sorting.
/// Which states to discard for next draw. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_submit_indirect")]
public static extern void submit_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint32 _depth, uint8 _flags);
///
/// Submit primitive for rendering with index and instance data info and
/// draw count from indirect buffers.
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
/// Element in number buffer.
/// Max number of draws.
/// Depth for sorting.
/// Which states to discard for next draw. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_submit_indirect_count")]
public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags);
///
/// Set compute index buffer.
///
///
/// Compute stage.
/// Index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_set_compute_index_buffer")]
public static extern void set_compute_index_buffer(uint8 _stage, IndexBufferHandle _handle, Access _access);
///
/// Set compute vertex buffer.
///
///
/// Compute stage.
/// Vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_set_compute_vertex_buffer")]
public static extern void set_compute_vertex_buffer(uint8 _stage, VertexBufferHandle _handle, Access _access);
///
/// Set compute dynamic index buffer.
///
///
/// Compute stage.
/// Dynamic index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_set_compute_dynamic_index_buffer")]
public static extern void set_compute_dynamic_index_buffer(uint8 _stage, DynamicIndexBufferHandle _handle, Access _access);
///
/// Set compute dynamic vertex buffer.
///
///
/// Compute stage.
/// Dynamic vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_set_compute_dynamic_vertex_buffer")]
public static extern void set_compute_dynamic_vertex_buffer(uint8 _stage, DynamicVertexBufferHandle _handle, Access _access);
///
/// Set compute indirect buffer.
///
///
/// Compute stage.
/// Indirect buffer handle.
/// Buffer access. See `Access::Enum`.
///
[LinkName("bgfx_set_compute_indirect_buffer")]
public static extern void set_compute_indirect_buffer(uint8 _stage, IndirectBufferHandle _handle, Access _access);
///
/// Set compute image from texture.
///
///
/// Compute stage.
/// Texture handle.
/// Mip level.
/// Image access. See `Access::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
///
[LinkName("bgfx_set_image")]
public static extern void set_image(uint8 _stage, TextureHandle _handle, uint8 _mip, Access _access, TextureFormat _format);
///
/// Dispatch compute.
///
///
/// View id.
/// Compute program.
/// Number of groups X.
/// Number of groups Y.
/// Number of groups Z.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_dispatch")]
public static extern void dispatch(ViewId _id, ProgramHandle _program, uint32 _numX, uint32 _numY, uint32 _numZ, uint8 _flags);
///
/// Dispatch compute indirect.
///
///
/// View id.
/// Compute program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
/// Discard or preserve states. See `BGFX_DISCARD_*`.
///
[LinkName("bgfx_dispatch_indirect")]
public static extern void dispatch_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, uint32 _num, uint8 _flags);
///
/// Discard previously set state for draw or compute call.
///
///
/// Draw/compute states to discard.
///
[LinkName("bgfx_discard")]
public static extern void discard(uint8 _flags);
///
/// Blit 2D texture region between two 2D textures.
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
///
///
/// View id.
/// Destination texture handle.
/// Destination texture mip level.
/// Destination texture X position.
/// Destination texture Y position.
/// If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.
/// Source texture handle.
/// Source texture mip level.
/// Source texture X position.
/// Source texture Y position.
/// If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.
/// Width of region.
/// Height of region.
/// If texture is 3D this argument represents depth of region, otherwise it's unused.
///
[LinkName("bgfx_blit")]
public static extern void blit(ViewId _id, TextureHandle _dst, uint8 _dstMip, uint16 _dstX, uint16 _dstY, uint16 _dstZ, TextureHandle _src, uint8 _srcMip, uint16 _srcX, uint16 _srcY, uint16 _srcZ, uint16 _width, uint16 _height, uint16 _depth);
public static bgfx.StateFlags blend_function_separate(bgfx.StateFlags _srcRGB, bgfx.StateFlags _dstRGB, bgfx.StateFlags _srcA, bgfx.StateFlags _dstA)
{
return (bgfx.StateFlags)(uint64(0) | (((uint64)(_srcRGB) | ((uint64)(_dstRGB) << 4))) | (((uint64)(_srcA) | ((uint64)(_dstA) << 4)) << 8));
}
public static bgfx.StateFlags blend_function(bgfx.StateFlags _srcRGB, bgfx.StateFlags _dstRGB)
{
return blend_function_separate(_srcRGB, _dstRGB, _srcRGB, _dstRGB);
}
}
}