Module bgfx_rs::static_lib[][src]

Structs

Frame buffer texture attachment info.

Renderer capabilities.

Renderer runtime limits.

Rendering state discard. When state is preserved in submit, rendering states can be discarded on a finer grain.

Encoders are used for submitting draw calls from multiple threads. Only one encoder per thread should be used. Use bgfx::begin() to obtain an encoder for a thread.

Encoder stats.

GPU info.

Initialization parameters used by bgfx::init.

Instance data buffer info.

Internal data.

Configurable runtime limits parameters.

bgfx-managed buffer of memory.

Platform data.

Backbuffer resolution and reset parameters.

Sampler flags.

Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA) helper macros.

Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) helper macros.

Cull state. When StateCullFlags is not specified culling will be disabled.

Depth test state. When [StateFlags::DEPTH_] is not specified depth test will be disabled.

Enable MSAA write when writing into MSAA frame buffer. This flag is ignored when not writing into MSAA frame buffer.

Color RGB/alpha/depth write. When it’s not specified write will be disabled.

Renderer statistics data.

Texture info.

Transform data.

Transient index buffer.

Transient vertex buffer.

Uniform info.

Vertex layout.

View stats.

Enums

Access mode enum.

Vertex attribute enum.

Vertex attribute type enum.

Backbuffer ratio enum.

Fatal error enum.

Occlusion query result.

Render frame enum.

Renderer backend type enum.

Texture format enum.

Primitive topology.

Topology conversion function.

Topology sort order.

Uniform type enum.

View mode sets draw call sort order.

Functions

  • idb: InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.
  • num: Number of instances.
  • stride: Instance stride. Must be multiple of 16.
  • transform: Pointer to Transform structure.
  • num: Number of matrices.
  • tvb: TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
  • layout: Vertex layout.
  • num_vertices: Number of vertices to allocate.
  • tib: TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
  • num_indices: Number of indices to allocate.
  • index_32: Set to true if input indices will be 32-bit.
  • tib: TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
  • num: Number of indices to allocate.
  • index_32: Set to true if input indices will be 32-bit.
  • tvb: TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
  • num: Number of vertices to allocate.
  • layout: Vertex layout.
  • id: View id.
  • dst: Destination texture handle.
  • dst_mip: Destination texture mip level.
  • dst_x: Destination texture X position.
  • dst_y: Destination texture Y position.
  • dst_z: 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.
  • src: Source texture handle.
  • src_mip: Source texture mip level.
  • src_x: Source texture X position.
  • src_y: Source texture Y position.
  • src_z: 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: Width of region.
  • height: Height of region.
  • depth: If texture is 3D this argument represents depth of region, otherwise it’s unused.
  • info: Resulting texture info structure. See: TextureInfo.
  • width: Width.
  • height: Height.
  • depth: Depth dimension of volume texture.
  • cube_map: Indicates that texture contains cubemap.
  • has_mips: Indicates that texture contains full mip-map chain.
  • num_layers: Number of layers in texture array.
  • format: Texture format. See: TextureFormat.
  • csh: Compute shader.
  • destroy_shaders: If true, shaders will be destroyed when program is destroyed.
  • num: Number of indices.
  • flags: Buffer creation flags.

  • BufferFlags::NONE - No flags.
  • BufferFlags::COMPUTE_READ - Buffer will be read from by compute shader.
  • BufferFlags::COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BufferFlags::COMPUTE_WRITE flag it cannot be updated from CPU.
  • BufferFlags::COMPUTE_READ_WRITE - Buffer will be used for read/write by compute shader.
  • BufferFlags::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.
  • [BufferFlags::INDEX32] - Buffer is using 32-bit indices. This flag has effect only on index buffers.
  • mem: Index buffer data.
  • flags: Buffer creation flags.

  • BufferFlags::NONE - No flags.
  • BufferFlags::COMPUTE_READ - Buffer will be read from by compute shader.
  • BufferFlags::COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BufferFlags::COMPUTE_WRITE flag it cannot be updated from CPU.
  • BufferFlags::COMPUTE_READ_WRITE - Buffer will be used for read/write by compute shader.
  • BufferFlags::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.
  • [BufferFlags::INDEX32] - Buffer is using 32-bit indices. This flag has effect only on index buffers.
  • num: Number of vertices.
  • layout: Vertex layout.
  • flags: Buffer creation flags.

  • BufferFlags::NONE - No flags.
  • BufferFlags::COMPUTE_READ - Buffer will be read from by compute shader.
  • BufferFlags::COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BufferFlags::COMPUTE_WRITE flag it cannot be updated from CPU.
  • BufferFlags::COMPUTE_READ_WRITE - Buffer will be used for read/write by compute shader.
  • BufferFlags::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.
  • [BufferFlags::INDEX32] - Buffer is using 32-bit indices. This flag has effect only on index buffers.
  • mem: Vertex buffer data.
  • layout: Vertex layout.
  • flags: Buffer creation flags.

  • BufferFlags::NONE - No flags.
  • BufferFlags::COMPUTE_READ - Buffer will be read from by compute shader.
  • BufferFlags::COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BufferFlags::COMPUTE_WRITE flag it cannot be updated from CPU.
  • BufferFlags::COMPUTE_READ_WRITE - Buffer will be used for read/write by compute shader.
  • BufferFlags::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.
  • [BufferFlags::INDEX32] - Buffer is using 32-bit indices. This flag has effect only on index buffers.
  • width: Texture width.
  • height: Texture height.
  • format: Texture format. See: TextureFormat.
  • texture_flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • num: Number of attachments.
  • attachment: Attachment texture info. See: bgfx::Attachment.
  • destroy_texture: If true, textures will be destroyed when frame buffer is destroyed.
  • num: Number of texture handles.
  • handles: Texture attachments.
  • destroy_texture: If true, textures will be destroyed when frame buffer is destroyed.
  • nwh: OS’ target native window handle.
  • width: Window back buffer width.
  • height: Window back buffer height.
  • format: Window back buffer color format.
  • depth_format: Window back buffer depth format.
  • ratio: Frame buffer size in respect to back-buffer size. See: BackbufferRatio.
  • format: Texture format. See: TextureFormat.
  • texture_flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • mem: Index buffer data.
  • flags: Buffer creation flags.

  • BufferFlags::NONE - No flags.
  • BufferFlags::COMPUTE_READ - Buffer will be read from by compute shader.
  • BufferFlags::COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BufferFlags::COMPUTE_WRITE flag it cannot be updated from CPU.
  • BufferFlags::COMPUTE_READ_WRITE - Buffer will be used for read/write by compute shader.
  • BufferFlags::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.
  • [BufferFlags::INDEX32] - Buffer is using 32-bit indices. This flag has effect only on index buffers.
  • num: Number of indirect calls.
  • vsh: Vertex shader.
  • fsh: Fragment shader.
  • destroy_shaders: If true, shaders will be destroyed when program is destroyed.
  • mem: Shader binary.
  • mem: DDS, KTX or PVR texture binary data.
  • flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • width: Width.
  • height: Height.
  • has_mips: Indicates that texture contains full mip-map chain.
  • num_layers: Number of layers in texture array. Must be 1 if caps [CapsFlags::TEXTURE_2D_ARRAY] flag is not set.
  • format: Texture format. See: TextureFormat.
  • flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • ratio: Texture size in respect to back-buffer size. See: BackbufferRatio.
  • has_mips: Indicates that texture contains full mip-map chain.
  • num_layers: Number of layers in texture array. Must be 1 if caps [CapsFlags::TEXTURE_2D_ARRAY] flag is not set.
  • format: Texture format. See: TextureFormat.
  • flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • width: Width.
  • height: Height.
  • depth: Depth.
  • has_mips: Indicates that texture contains full mip-map chain.
  • format: Texture format. See: TextureFormat.
  • flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • size: Cube side size.
  • has_mips: Indicates that texture contains full mip-map chain.
  • num_layers: Number of layers in texture array. Must be 1 if caps [CapsFlags::TEXTURE_2D_ARRAY] flag is not set.
  • format: Texture format. See: TextureFormat.
  • flags: Texture creation (see TextureFlags.), and sampler (see SamplerFlags) flags. Default texture sampling mode is linear, and wrap mode is repeat.
  • mem: Vertex buffer data.
  • layout: Vertex layout.
  • flags: Buffer creation flags.
  • layout: Vertex layout.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • attr: 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).
  • text: Text to be displayed
  • attr: Background color.
  • small: Default 8x16 or 8x8 font.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • width: Image width.
  • height: Image height.
  • data: Raw image data (character/attribute raw encoding).
  • pitch: Image pitch in bytes.
  • flags: Draw/compute states to discard.
  • id: View id.
  • program: Compute program.
  • num_x: Number of groups X.
  • num_y: Number of groups Y.
  • num_z: Number of groups Z.
  • flags: Discard or preserve states. See DiscardFlags.
  • id: View id.
  • program: Compute program.
  • indirect_handle: Indirect buffer.
  • start: First element in indirect buffer.
  • num: Number of dispatches.
  • flags: Discard or preserve states. See DiscardFlags.
  • for_thread: Explicitly request an encoder for a worker thread.
  • encoder: Encoder.
  • capture: Capture frame with graphics debugger.
  • num: Number of required instances.
  • stride: Stride per instance.
  • num: Number of required indices.
  • index_32: Set to true if input indices will be 32-bit.
  • num: Number of required vertices.
  • layout: Vertex layout.
  • handle: Handle to occlusion query object.
  • result: Number of pixels that passed test. This argument can be NULL if result of occlusion query is not needed.
  • handle: Frame buffer handle.
  • attachment:
  • handle: Handle to uniform object.
  • info: Uniform info.
  • init: Initialization parameters. See: bgfx::Init for more info.
  • num: Number of attachments.
  • attachment: Attachment texture info. See: bgfx::Attachment.
  • depth: Depth dimension of volume texture.
  • cube_map: Indicates that texture contains cubemap.
  • num_layers: Number of layers in texture array.
  • format: Texture format. See: TextureFormat.
  • flags: Texture flags. See TextureFlags.
  • msecs: Timeout in milliseconds.
  • handle: Frame buffer handle. If handle is ]BGFX_INVALID_HANDLE] request will be made for main window back buffer.
  • file_path: Will be passed to bgfx::CallbackI::screenShot callback.
  • width: Back-buffer width.
  • height: Back-buffer height.
  • flags: See: ResetFlags for more info.

  • ResetFlags::NONE - No reset flags.
  • ResetFlags::FULLSCREEN - Not supported yet.
  • [ResetMsaaFlags::X[2/4/8/16]] - Enable 2, 4, 8 or 16 x MSAA.
  • ResetFlags::VSYNC - Enable V-Sync.
  • ResetFlags::MAXANISOTROPY - Turn on/off max anisotropy.
  • ResetFlags::CAPTURE - Begin screen capture.
  • ResetFlags::FLUSH_AFTER_RENDER - Flush rendering after submitting to GPU.
  • ResetFlags::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.
  • ResetFlags::SRGB_BACKBUFFER - Enable sRGB backbuffer.
  • format: Texture format. See: TextureFormat.
  • stage: Compute stage.
  • handle: Dynamic index buffer handle.
  • access: Buffer access. See Access.
  • stage: Compute stage.
  • handle: Dynamic vertex buffer handle.
  • access: Buffer access. See Access.
  • stage: Compute stage.
  • handle: Index buffer handle.
  • access: Buffer access. See Access.
  • stage: Compute stage.
  • handle: Indirect buffer handle.
  • access: Buffer access. See Access.
  • stage: Compute stage.
  • handle: Vertex buffer handle.
  • access: Buffer access. See Access.
  • handle: Occlusion query handle.
  • visible: Render if occlusion query is visible.
  • debug: Available flags:

  • DebugFlags::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.
  • DebugFlags::PROFILER - Enable profiler.
  • DebugFlags::STATS - Display internal statistics.
  • DebugFlags::TEXT - Display debug text.
  • DebugFlags::WIREFRAME - Wireframe rendering. All rendering primitives will be rendered as lines.
  • handle: Dynamic index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
  • stream: Vertex stream.
  • handle: Dynamic vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • stream: Vertex stream.
  • handle: Dynamic vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
  • stage: Compute stage.
  • handle: Texture handle.
  • mip: Mip level.
  • access: Image access. See Access.
  • format: Texture format. See: TextureFormat.
  • handle: Index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
  • num_instances:
  • idb: Transient instance data buffer.
  • start: First instance data.
  • num: Number of data instances.
  • handle: Dynamic vertex buffer.
  • start_vertex: First instance data.
  • num: Number of data instances.
  • handle: Vertex buffer.
  • start_vertex: First instance data.
  • num: Number of data instances. Set instance data buffer for draw primitive. Dynamic vertex buffer.
  • marker: Marker string.
  • data: Platform data.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • width: Width of view scissor region.
  • height: Height of view scissor region.
  • cache: Index in scissor cache.
  • state: State flags. Default state for primitive type is triangles. See: StateFlags::DEFAULT.

  • StateDepthTestFlags - Depth test function.
  • StateBlendFlags - See remark 1 about BGFX_STATE_BLEND_FUNC.
  • StateBlendEquationFlags - See remark 2.
  • StateCullFlags - Backface culling mode.
  • StateWriteFlags - Enable R, G, B, A or Z write.
  • StateFlags::MSAA - Enable hardware multisample antialiasing.
  • [StatePtFlags::[TRISTRIP/LINES/POINTS]] - Primitive type.
  • rgba: Sets blend factor used by StateBlendFlags::FACTOR and StateBlendFlags::INV_FACTOR blend modes.
  • fstencil: Front stencil state.
  • bstencil: Back stencil state. If back is set to StencilFlags::NONE _fstencil is applied to both front and back facing primitives.
  • stage: Texture unit.
  • sampler: Program sampler.
  • handle: Texture handle.
  • flags: Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.

  • [SamplerFlags::[U/V/W]_[MIRROR/CLAMP]] - Mirror or clamp to edge wrap mode.
  • [SamplerFlags::[MIN/MAG/MIP]_[POINT/ANISOTROPIC]] - Point or anisotropic sampling.
  • mtx: Pointer to first matrix in array.
  • num: Number of matrices in array.
  • tib: Transient index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
  • stream: Vertex stream.
  • tvb: Transient vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • stream: Vertex stream.
  • tvb: Transient vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
  • handle: Uniform.
  • value: Pointer to uniform data.
  • num: Number of elements. Passing u16::MAX will use the _num passed on uniform creation.
  • stream: Vertex stream.
  • handle: Vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • stream: Vertex stream.
  • handle: Vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
  • num_vertices: Number of vertices.
  • id: View id.
  • flags: Clear flags. Use ClearFlags::NONE to remove any clear operation. See: ClearFlags.
  • rgba: Color clear value.
  • depth: Depth clear value.
  • stencil: Stencil clear value.
  • id: View id.
  • flags: Clear flags. Use ClearFlags::NONE to remove any clear operation. See: ClearFlags.
  • depth: Depth clear value.
  • stencil: Stencil clear value.
  • c_0: Palette index for frame buffer attachment 0.
  • c_1: Palette index for frame buffer attachment 1.
  • c_2: Palette index for frame buffer attachment 2.
  • c_3: Palette index for frame buffer attachment 3.
  • c_4: Palette index for frame buffer attachment 4.
  • c_5: Palette index for frame buffer attachment 5.
  • c_6: Palette index for frame buffer attachment 6.
  • c_7: Palette index for frame buffer attachment 7.
  • id: View id.
  • handle: Frame buffer handle. Passing ]BGFX_INVALID_HANDLE] as frame buffer handle will draw primitives from this view into default back buffer.
  • id: View id.
  • mode: View sort mode. See ViewMode.
  • id: View id.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • width: Width of view port region.
  • height: Height of view port region.
  • id: View id.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • ratio: Width and height will be set in respect to back-buffer size. See: BackbufferRatio.
  • id: View id.
  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • width: Width of view scissor region.
  • height: Height of view scissor region.
  • id: View id.
  • view: View matrix.
  • proj: Projection matrix.
  • id: View id.
  • program: Program.
  • depth: Depth for sorting.
  • flags: Which states to discard for next draw. See DiscardFlags.
  • id: View id.
  • program: Program.
  • indirect_handle: Indirect buffer.
  • start: First element in indirect buffer.
  • num: Number of dispatches.
  • depth: Depth for sorting.
  • flags: Which states to discard for next draw. See DiscardFlags.
  • id: View id.
  • program: Program.
  • occlusion_query: Occlusion query.
  • depth: Depth for sorting.
  • flags: Which states to discard for next draw. See DiscardFlags.
  • id: View id.
  • handle: Dynamic index buffer handle.
  • start_index: Start index.
  • mem: Index buffer data.
  • handle: Dynamic vertex buffer handle.
  • start_vertex: Start vertex.
  • mem: Vertex buffer data.
  • handle: Texture handle.
  • layer: Layer in texture array.
  • mip: Mip level.
  • x: X offset in texture.
  • y: Y offset in texture.
  • width: Width of texture block.
  • height: Height of texture block.
  • mem: Texture update data.
  • pitch: Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.
  • handle: Texture handle.
  • mip: Mip level.
  • x: X offset in texture.
  • y: Y offset in texture.
  • z: Z offset in texture.
  • width: Width of texture block.
  • height: Height of texture block.
  • depth: Depth of texture block.
  • mem: Texture update data.
  • handle: Texture handle.

  • layer: Layer in texture array.

  • side: Cubemap side [CubeMapFlags::_<X, Y or Z>], where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.

  • Type Definitions