IDL now generates defines.h
This commit is contained in:
parent
54d844be45
commit
a1cdb91758
@ -8,121 +8,497 @@
|
||||
|
||||
#define BGFX_API_VERSION UINT32_C(99)
|
||||
|
||||
/// Color RGB/alpha/depth write. When it's not specified write will be disabled.
|
||||
#define BGFX_STATE_WRITE_R UINT64_C(0x0000000000000001) //!< Enable R write.
|
||||
#define BGFX_STATE_WRITE_G UINT64_C(0x0000000000000002) //!< Enable G write.
|
||||
#define BGFX_STATE_WRITE_B UINT64_C(0x0000000000000004) //!< Enable B write.
|
||||
#define BGFX_STATE_WRITE_A UINT64_C(0x0000000000000008) //!< Enable alpha write.
|
||||
#define BGFX_STATE_WRITE_Z UINT64_C(0x0000004000000000) //!< Enable depth write.
|
||||
|
||||
/**
|
||||
* Color RGB/alpha/depth write. When it's not specified write will be disabled.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_WRITE_R UINT64_C(0x0000000000000001) //!< Enable R write.
|
||||
#define BGFX_STATE_WRITE_G UINT64_C(0x0000000000000002) //!< Enable G write.
|
||||
#define BGFX_STATE_WRITE_B UINT64_C(0x0000000000000004) //!< Enable B write.
|
||||
#define BGFX_STATE_WRITE_A UINT64_C(0x0000000000000008) //!< Enable alpha write.
|
||||
#define BGFX_STATE_WRITE_Z UINT64_C(0x0000004000000000) //!< Enable depth write.
|
||||
/// Enable RGB write.
|
||||
#define BGFX_STATE_WRITE_RGB (0 \
|
||||
| BGFX_STATE_WRITE_R \
|
||||
| BGFX_STATE_WRITE_G \
|
||||
| BGFX_STATE_WRITE_B \
|
||||
| BGFX_STATE_WRITE_R \
|
||||
| BGFX_STATE_WRITE_G \
|
||||
| BGFX_STATE_WRITE_B \
|
||||
)
|
||||
|
||||
/// Write all channels mask.
|
||||
#define BGFX_STATE_WRITE_MASK (0 \
|
||||
| BGFX_STATE_WRITE_RGB \
|
||||
| BGFX_STATE_WRITE_A \
|
||||
| BGFX_STATE_WRITE_Z \
|
||||
| BGFX_STATE_WRITE_RGB \
|
||||
| BGFX_STATE_WRITE_A \
|
||||
| BGFX_STATE_WRITE_Z \
|
||||
)
|
||||
|
||||
/// Depth test state. When `BGFX_STATE_DEPTH_` is not specified depth test will be disabled.
|
||||
#define BGFX_STATE_DEPTH_TEST_LESS UINT64_C(0x0000000000000010) //!< Enable depth test, less.
|
||||
#define BGFX_STATE_DEPTH_TEST_LEQUAL UINT64_C(0x0000000000000020) //!< Enable depth test, less or equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_EQUAL UINT64_C(0x0000000000000030) //!< Enable depth test, equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_GEQUAL UINT64_C(0x0000000000000040) //!< Enable depth test, greater or equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_GREATER UINT64_C(0x0000000000000050) //!< Enable depth test, greater.
|
||||
#define BGFX_STATE_DEPTH_TEST_NOTEQUAL UINT64_C(0x0000000000000060) //!< Enable depth test, not equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_NEVER UINT64_C(0x0000000000000070) //!< Enable depth test, never.
|
||||
#define BGFX_STATE_DEPTH_TEST_ALWAYS UINT64_C(0x0000000000000080) //!< Enable depth test, always.
|
||||
#define BGFX_STATE_DEPTH_TEST_SHIFT 4 //!< Depth test state bit shift.
|
||||
#define BGFX_STATE_DEPTH_TEST_MASK UINT64_C(0x00000000000000f0) //!< Depth test state bit mask.
|
||||
|
||||
/// Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)
|
||||
/// helper macros.
|
||||
#define BGFX_STATE_BLEND_ZERO UINT64_C(0x0000000000001000) //!< 0, 0, 0, 0
|
||||
#define BGFX_STATE_BLEND_ONE UINT64_C(0x0000000000002000) //!< 1, 1, 1, 1
|
||||
#define BGFX_STATE_BLEND_SRC_COLOR UINT64_C(0x0000000000003000) //!< Rs, Gs, Bs, As
|
||||
#define BGFX_STATE_BLEND_INV_SRC_COLOR UINT64_C(0x0000000000004000) //!< 1-Rs, 1-Gs, 1-Bs, 1-As
|
||||
#define BGFX_STATE_BLEND_SRC_ALPHA UINT64_C(0x0000000000005000) //!< As, As, As, As
|
||||
#define BGFX_STATE_BLEND_INV_SRC_ALPHA UINT64_C(0x0000000000006000) //!< 1-As, 1-As, 1-As, 1-As
|
||||
#define BGFX_STATE_BLEND_DST_ALPHA UINT64_C(0x0000000000007000) //!< Ad, Ad, Ad, Ad
|
||||
#define BGFX_STATE_BLEND_INV_DST_ALPHA UINT64_C(0x0000000000008000) //!< 1-Ad, 1-Ad, 1-Ad ,1-Ad
|
||||
#define BGFX_STATE_BLEND_DST_COLOR UINT64_C(0x0000000000009000) //!< Rd, Gd, Bd, Ad
|
||||
#define BGFX_STATE_BLEND_INV_DST_COLOR UINT64_C(0x000000000000a000) //!< 1-Rd, 1-Gd, 1-Bd, 1-Ad
|
||||
#define BGFX_STATE_BLEND_SRC_ALPHA_SAT UINT64_C(0x000000000000b000) //!< f, f, f, 1; f = min(As, 1-Ad)
|
||||
#define BGFX_STATE_BLEND_FACTOR UINT64_C(0x000000000000c000) //!< Blend factor
|
||||
#define BGFX_STATE_BLEND_INV_FACTOR UINT64_C(0x000000000000d000) //!< 1-Blend factor
|
||||
#define BGFX_STATE_BLEND_SHIFT 12 //!< Blend state bit shift.
|
||||
#define BGFX_STATE_BLEND_MASK UINT64_C(0x000000000ffff000) //!< Blend state bit mask.
|
||||
/**
|
||||
* Depth test state. When `BGFX_STATE_DEPTH_` is not specified depth test will be disabled.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_DEPTH_TEST_LESS UINT64_C(0x0000000000000010) //!< Enable depth test, less.
|
||||
#define BGFX_STATE_DEPTH_TEST_LEQUAL UINT64_C(0x0000000000000020) //!< Enable depth test, less or equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_EQUAL UINT64_C(0x0000000000000030) //!< Enable depth test, equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_GEQUAL UINT64_C(0x0000000000000040) //!< Enable depth test, greater or equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_GREATER UINT64_C(0x0000000000000050) //!< Enable depth test, greater.
|
||||
#define BGFX_STATE_DEPTH_TEST_NOTEQUAL UINT64_C(0x0000000000000060) //!< Enable depth test, not equal.
|
||||
#define BGFX_STATE_DEPTH_TEST_NEVER UINT64_C(0x0000000000000070) //!< Enable depth test, never.
|
||||
#define BGFX_STATE_DEPTH_TEST_ALWAYS UINT64_C(0x0000000000000080) //!< Enable depth test, always.
|
||||
#define BGFX_STATE_DEPTH_TEST_SHIFT 4 //!< Depth test state bit shift
|
||||
#define BGFX_STATE_DEPTH_TEST_MASK UINT64_C(0x00000000000000f0) //!< Depth test state bit mask
|
||||
|
||||
/// Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
|
||||
/// helper macros.
|
||||
#define BGFX_STATE_BLEND_EQUATION_ADD UINT64_C(0x0000000000000000) //!< Blend add: src + dst.
|
||||
#define BGFX_STATE_BLEND_EQUATION_SUB UINT64_C(0x0000000010000000) //!< Blend subtract: src - dst.
|
||||
#define BGFX_STATE_BLEND_EQUATION_REVSUB UINT64_C(0x0000000020000000) //!< Blend reverse subtract: dst - src.
|
||||
#define BGFX_STATE_BLEND_EQUATION_MIN UINT64_C(0x0000000030000000) //!< Blend min: min(src, dst).
|
||||
#define BGFX_STATE_BLEND_EQUATION_MAX UINT64_C(0x0000000040000000) //!< Blend max: max(src, dst).
|
||||
#define BGFX_STATE_BLEND_EQUATION_SHIFT 28 //!< Blend equation bit shift.
|
||||
#define BGFX_STATE_BLEND_EQUATION_MASK UINT64_C(0x00000003f0000000) //!< Blend equation bit mask.
|
||||
/**
|
||||
* Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)
|
||||
* helper macros.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_BLEND_ZERO UINT64_C(0x0000000000001000) //!< 0, 0, 0, 0
|
||||
#define BGFX_STATE_BLEND_ONE UINT64_C(0x0000000000002000) //!< 1, 1, 1, 1
|
||||
#define BGFX_STATE_BLEND_SRC_COLOR UINT64_C(0x0000000000003000) //!< Rs, Gs, Bs, As
|
||||
#define BGFX_STATE_BLEND_INV_SRC_COLOR UINT64_C(0x0000000000004000) //!< 1-Rs, 1-Gs, 1-Bs, 1-As
|
||||
#define BGFX_STATE_BLEND_SRC_ALPHA UINT64_C(0x0000000000005000) //!< As, As, As, As
|
||||
#define BGFX_STATE_BLEND_INV_SRC_ALPHA UINT64_C(0x0000000000006000) //!< 1-As, 1-As, 1-As, 1-As
|
||||
#define BGFX_STATE_BLEND_DST_ALPHA UINT64_C(0x0000000000007000) //!< Ad, Ad, Ad, Ad
|
||||
#define BGFX_STATE_BLEND_INV_DST_ALPHA UINT64_C(0x0000000000008000) //!< 1-Ad, 1-Ad, 1-Ad ,1-Ad
|
||||
#define BGFX_STATE_BLEND_DST_COLOR UINT64_C(0x0000000000009000) //!< Rd, Gd, Bd, Ad
|
||||
#define BGFX_STATE_BLEND_INV_DST_COLOR UINT64_C(0x000000000000a000) //!< 1-Rd, 1-Gd, 1-Bd, 1-Ad
|
||||
#define BGFX_STATE_BLEND_SRC_ALPHA_SAT UINT64_C(0x000000000000b000) //!< f, f, f, 1; f = min(As, 1-Ad)
|
||||
#define BGFX_STATE_BLEND_FACTOR UINT64_C(0x000000000000c000) //!< Blend factor
|
||||
#define BGFX_STATE_BLEND_INV_FACTOR UINT64_C(0x000000000000d000) //!< 1-Blend factor
|
||||
#define BGFX_STATE_BLEND_SHIFT 12 //!< Blend state bit shift
|
||||
#define BGFX_STATE_BLEND_MASK UINT64_C(0x000000000ffff000) //!< Blend state bit mask
|
||||
|
||||
#define BGFX_STATE_BLEND_INDEPENDENT UINT64_C(0x0000000400000000) //!< Enable blend independent.
|
||||
#define BGFX_STATE_BLEND_ALPHA_TO_COVERAGE UINT64_C(0x0000000800000000) //!< Enable alpha to coverage.
|
||||
/**
|
||||
* Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
|
||||
* helper macros.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_BLEND_EQUATION_ADD UINT64_C(0x0000000000000000) //!< Blend add: src + dst.
|
||||
#define BGFX_STATE_BLEND_EQUATION_SUB UINT64_C(0x0000000010000000) //!< Blend subtract: src - dst.
|
||||
#define BGFX_STATE_BLEND_EQUATION_REVSUB UINT64_C(0x0000000020000000) //!< Blend reverse subtract: dst - src.
|
||||
#define BGFX_STATE_BLEND_EQUATION_MIN UINT64_C(0x0000000030000000) //!< Blend min: min(src, dst).
|
||||
#define BGFX_STATE_BLEND_EQUATION_MAX UINT64_C(0x0000000040000000) //!< Blend max: max(src, dst).
|
||||
#define BGFX_STATE_BLEND_EQUATION_SHIFT 28 //!< Blend equation bit shift
|
||||
#define BGFX_STATE_BLEND_EQUATION_MASK UINT64_C(0x00000003f0000000) //!< Blend equation bit mask
|
||||
|
||||
/// Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
|
||||
#define BGFX_STATE_CULL_CW UINT64_C(0x0000001000000000) //!< Cull clockwise triangles.
|
||||
#define BGFX_STATE_CULL_CCW UINT64_C(0x0000002000000000) //!< Cull counter-clockwise triangles.
|
||||
#define BGFX_STATE_CULL_SHIFT 36 //!< Culling mode bit shift.
|
||||
#define BGFX_STATE_CULL_MASK UINT64_C(0x0000003000000000) //!< Culling mode bit mask.
|
||||
/**
|
||||
* Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_CULL_CW UINT64_C(0x0000001000000000) //!< Cull clockwise triangles.
|
||||
#define BGFX_STATE_CULL_CCW UINT64_C(0x0000002000000000) //!< Cull counter-clockwise triangles.
|
||||
#define BGFX_STATE_CULL_SHIFT 36 //!< Culling mode bit shift
|
||||
#define BGFX_STATE_CULL_MASK UINT64_C(0x0000003000000000) //!< Culling mode bit mask
|
||||
|
||||
/// See BGFX_STATE_ALPHA_REF(_ref) helper macro.
|
||||
#define BGFX_STATE_ALPHA_REF_SHIFT 40 //!< Alpha reference bit shift.
|
||||
#define BGFX_STATE_ALPHA_REF_MASK UINT64_C(0x0000ff0000000000) //!< Alpha reference bit mask.
|
||||
/**
|
||||
* Alpha reference value.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_ALPHA_REF_SHIFT 40 //!< Alpha reference bit shift
|
||||
#define BGFX_STATE_ALPHA_REF_MASK UINT64_C(0x0000ff0000000000) //!< Alpha reference bit mask
|
||||
#define BGFX_STATE_ALPHA_REF(v) ( ( (uint64_t)(v)<<BGFX_STATE_ALPHA_REF_SHIFT )&BGFX_STATE_ALPHA_REF_MASK)
|
||||
|
||||
#define BGFX_STATE_PT_TRISTRIP UINT64_C(0x0001000000000000) //!< Tristrip.
|
||||
#define BGFX_STATE_PT_LINES UINT64_C(0x0002000000000000) //!< Lines.
|
||||
#define BGFX_STATE_PT_LINESTRIP UINT64_C(0x0003000000000000) //!< Line strip.
|
||||
#define BGFX_STATE_PT_POINTS UINT64_C(0x0004000000000000) //!< Points.
|
||||
#define BGFX_STATE_PT_SHIFT 48 //!< Primitive type bit shift.
|
||||
#define BGFX_STATE_PT_MASK UINT64_C(0x0007000000000000) //!< Primitive type bit mask.
|
||||
#define BGFX_STATE_PT_TRISTRIP UINT64_C(0x0001000000000000) //!< Tristrip.
|
||||
#define BGFX_STATE_PT_LINES UINT64_C(0x0002000000000000) //!< Lines.
|
||||
#define BGFX_STATE_PT_LINESTRIP UINT64_C(0x0003000000000000) //!< Line strip.
|
||||
#define BGFX_STATE_PT_POINTS UINT64_C(0x0004000000000000) //!< Points.
|
||||
#define BGFX_STATE_PT_SHIFT 48 //!< Primitive type bit shift
|
||||
#define BGFX_STATE_PT_MASK UINT64_C(0x0007000000000000) //!< Primitive type bit mask
|
||||
|
||||
/// See BGFX_STATE_POINT_SIZE(_size) helper macro.
|
||||
#define BGFX_STATE_POINT_SIZE_SHIFT 52 //!< Point size bit shift.
|
||||
#define BGFX_STATE_POINT_SIZE_MASK UINT64_C(0x00f0000000000000) //!< Point size bit mask.
|
||||
|
||||
/// Enable MSAA write when writing into MSAA frame buffer.
|
||||
/// This flag is ignored when not writing into MSAA frame buffer.
|
||||
#define BGFX_STATE_MSAA UINT64_C(0x0100000000000000) //!< Enable MSAA rasterization.
|
||||
#define BGFX_STATE_LINEAA UINT64_C(0x0200000000000000) //!< Enable line AA rasterization.
|
||||
#define BGFX_STATE_CONSERVATIVE_RASTER UINT64_C(0x0400000000000000) //!< Enable conservative rasterization.
|
||||
|
||||
/// Do not use!
|
||||
#define BGFX_STATE_RESERVED_SHIFT 61 //!< Internal bits shift.
|
||||
#define BGFX_STATE_RESERVED_MASK UINT64_C(0xe000000000000000) //!< Internal bits mask.
|
||||
|
||||
///
|
||||
#define BGFX_STATE_NONE UINT64_C(0x0000000000000000) //!< No state.
|
||||
#define BGFX_STATE_MASK UINT64_C(0xffffffffffffffff) //!< State mask.
|
||||
/**
|
||||
* Point size value.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_POINT_SIZE_SHIFT 52 //!< Point size bit shift
|
||||
#define BGFX_STATE_POINT_SIZE_MASK UINT64_C(0x00f0000000000000) //!< Point size bit mask
|
||||
#define BGFX_STATE_POINT_SIZE(v) ( ( (uint64_t)(v)<<BGFX_STATE_POINT_SIZE_SHIFT )&BGFX_STATE_POINT_SIZE_MASK)
|
||||
|
||||
/**
|
||||
* Enable MSAA write when writing into MSAA frame buffer.
|
||||
* This flag is ignored when not writing into MSAA frame buffer.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_MSAA UINT64_C(0x0100000000000000) //!< Enable MSAA rasterization.
|
||||
#define BGFX_STATE_LINEAA UINT64_C(0x0200000000000000) //!< Enable line AA rasterization.
|
||||
#define BGFX_STATE_CONSERVATIVE_RASTER UINT64_C(0x0400000000000000) //!< Enable conservative rasterization.
|
||||
#define BGFX_STATE_NONE UINT64_C(0x0000000000000000) //!< No state.
|
||||
#define BGFX_STATE_BLEND_INDEPENDENT UINT64_C(0x0000000400000000) //!< Enable blend independent.
|
||||
#define BGFX_STATE_BLEND_ALPHA_TO_COVERAGE UINT64_C(0x0000000800000000) //!< Enable alpha to coverage.
|
||||
/// 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).
|
||||
#define BGFX_STATE_DEFAULT (0 \
|
||||
| BGFX_STATE_WRITE_RGB \
|
||||
| BGFX_STATE_WRITE_A \
|
||||
| BGFX_STATE_WRITE_Z \
|
||||
#define BGFX_STATE_DEFAULT (0 \
|
||||
| BGFX_STATE_WRITE_RGB \
|
||||
| BGFX_STATE_WRITE_A \
|
||||
| BGFX_STATE_WRITE_Z \
|
||||
| BGFX_STATE_DEPTH_TEST_LESS \
|
||||
| BGFX_STATE_CULL_CW \
|
||||
| BGFX_STATE_MSAA \
|
||||
| BGFX_STATE_CULL_CW \
|
||||
| BGFX_STATE_MSAA \
|
||||
)
|
||||
|
||||
/// Alpha reference value.
|
||||
#define BGFX_STATE_ALPHA_REF(_ref) ( ( (uint64_t)(_ref )<<BGFX_STATE_ALPHA_REF_SHIFT )&BGFX_STATE_ALPHA_REF_MASK)
|
||||
#define BGFX_STATE_MASK UINT64_C(0xffffffffffffffff) //!< State bit mask
|
||||
|
||||
/**
|
||||
* Do not use!
|
||||
*
|
||||
*/
|
||||
#define BGFX_STATE_RESERVED_SHIFT 61
|
||||
|
||||
#define BGFX_STATE_RESERVED_MASK UINT64_C(0xe000000000000000)
|
||||
|
||||
/**
|
||||
* Set stencil ref value.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STENCIL_FUNC_REF_SHIFT 0
|
||||
|
||||
#define BGFX_STENCIL_FUNC_REF_MASK UINT32_C(0x000000ff)
|
||||
#define BGFX_STENCIL_FUNC_REF(v) ( ( (uint32_t)(v)<<BGFX_STENCIL_FUNC_REF_SHIFT )&BGFX_STENCIL_FUNC_REF_MASK)
|
||||
|
||||
/**
|
||||
* Set stencil rmask value.
|
||||
*
|
||||
*/
|
||||
#define BGFX_STENCIL_FUNC_RMASK_SHIFT 8
|
||||
|
||||
#define BGFX_STENCIL_FUNC_RMASK_MASK UINT32_C(0x0000ff00)
|
||||
#define BGFX_STENCIL_FUNC_RMASK(v) ( ( (uint32_t)(v)<<BGFX_STENCIL_FUNC_RMASK_SHIFT )&BGFX_STENCIL_FUNC_RMASK_MASK)
|
||||
|
||||
#define BGFX_STENCIL_NONE UINT32_C(0x00000000)
|
||||
#define BGFX_STENCIL_MASK UINT32_C(0xffffffff)
|
||||
#define BGFX_STENCIL_DEFAULT UINT32_C(0x00000000)
|
||||
|
||||
#define BGFX_STENCIL_TEST_LESS UINT32_C(0x00010000) //!< Enable stencil test, less.
|
||||
#define BGFX_STENCIL_TEST_LEQUAL UINT32_C(0x00020000) //!< Enable stencil test, less or equal.
|
||||
#define BGFX_STENCIL_TEST_EQUAL UINT32_C(0x00030000) //!< Enable stencil test, equal.
|
||||
#define BGFX_STENCIL_TEST_GEQUAL UINT32_C(0x00040000) //!< Enable stencil test, greater or equal.
|
||||
#define BGFX_STENCIL_TEST_GREATER UINT32_C(0x00050000) //!< Enable stencil test, greater.
|
||||
#define BGFX_STENCIL_TEST_NOTEQUAL UINT32_C(0x00060000) //!< Enable stencil test, not equal.
|
||||
#define BGFX_STENCIL_TEST_NEVER UINT32_C(0x00070000) //!< Enable stencil test, never.
|
||||
#define BGFX_STENCIL_TEST_ALWAYS UINT32_C(0x00080000) //!< Enable stencil test, always.
|
||||
#define BGFX_STENCIL_TEST_SHIFT 16 //!< Stencil test bit shift
|
||||
#define BGFX_STENCIL_TEST_MASK UINT32_C(0x000f0000) //!< Stencil test bit mask
|
||||
|
||||
#define BGFX_STENCIL_OP_FAIL_S_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_KEEP UINT32_C(0x00100000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_REPLACE UINT32_C(0x00200000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INCR UINT32_C(0x00300000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INCRSAT UINT32_C(0x00400000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_DECR UINT32_C(0x00500000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_DECRSAT UINT32_C(0x00600000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INVERT UINT32_C(0x00700000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_SHIFT 20 //!< Stencil operation fail bit shift
|
||||
#define BGFX_STENCIL_OP_FAIL_S_MASK UINT32_C(0x00f00000) //!< Stencil operation fail bit mask
|
||||
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_KEEP UINT32_C(0x01000000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_REPLACE UINT32_C(0x02000000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INCR UINT32_C(0x03000000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INCRSAT UINT32_C(0x04000000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_DECR UINT32_C(0x05000000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_DECRSAT UINT32_C(0x06000000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INVERT UINT32_C(0x07000000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_SHIFT 24 //!< Stencil operation depth fail bit shift
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_MASK UINT32_C(0x0f000000) //!< Stencil operation depth fail bit mask
|
||||
|
||||
#define BGFX_STENCIL_OP_PASS_Z_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_KEEP UINT32_C(0x10000000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_REPLACE UINT32_C(0x20000000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INCR UINT32_C(0x30000000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INCRSAT UINT32_C(0x40000000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_DECR UINT32_C(0x50000000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_DECRSAT UINT32_C(0x60000000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INVERT UINT32_C(0x70000000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_SHIFT 28 //!< Stencil operation depth pass bit shift
|
||||
#define BGFX_STENCIL_OP_PASS_Z_MASK UINT32_C(0xf0000000) //!< Stencil operation depth pass bit mask
|
||||
|
||||
#define BGFX_CLEAR_NONE UINT16_C(0x0000) //!< No clear flags.
|
||||
#define BGFX_CLEAR_COLOR UINT16_C(0x0001) //!< Clear color.
|
||||
#define BGFX_CLEAR_DEPTH UINT16_C(0x0002) //!< Clear depth.
|
||||
#define BGFX_CLEAR_STENCIL UINT16_C(0x0004) //!< Clear stencil.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_0 UINT16_C(0x0008) //!< Discard frame buffer attachment 0.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_1 UINT16_C(0x0010) //!< Discard frame buffer attachment 1.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_2 UINT16_C(0x0020) //!< Discard frame buffer attachment 2.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_3 UINT16_C(0x0040) //!< Discard frame buffer attachment 3.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_4 UINT16_C(0x0080) //!< Discard frame buffer attachment 4.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_5 UINT16_C(0x0100) //!< Discard frame buffer attachment 5.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_6 UINT16_C(0x0200) //!< Discard frame buffer attachment 6.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_7 UINT16_C(0x0400) //!< Discard frame buffer attachment 7.
|
||||
#define BGFX_CLEAR_DISCARD_DEPTH UINT16_C(0x0800) //!< Discard frame buffer depth attachment.
|
||||
#define BGFX_CLEAR_DISCARD_STENCIL UINT16_C(0x1000) //!< Discard frame buffer stencil attachment.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_MASK (0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_1 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_2 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_3 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_4 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_5 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_6 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_7 \
|
||||
)
|
||||
|
||||
#define BGFX_CLEAR_DISCARD_MASK (0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_MASK \
|
||||
| BGFX_CLEAR_DISCARD_DEPTH \
|
||||
| BGFX_CLEAR_DISCARD_STENCIL \
|
||||
)
|
||||
|
||||
|
||||
#define BGFX_DEBUG_NONE UINT32_C(0x00000000) //!< No debug.
|
||||
#define BGFX_DEBUG_WIREFRAME UINT32_C(0x00000001) //!< Enable wireframe for all primitives.
|
||||
#define BGFX_DEBUG_IFH UINT32_C(0x00000002) //!< 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.
|
||||
#define BGFX_DEBUG_STATS UINT32_C(0x00000004) //!< Enable statistics display.
|
||||
#define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display.
|
||||
#define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler.
|
||||
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X1 UINT16_C(0x0001) //!< 1 8-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X2 UINT16_C(0x0002) //!< 2 8-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X4 UINT16_C(0x0003) //!< 4 8-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X1 UINT16_C(0x0004) //!< 1 16-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X2 UINT16_C(0x0005) //!< 2 16-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X4 UINT16_C(0x0006) //!< 4 16-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X1 UINT16_C(0x0007) //!< 1 32-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X2 UINT16_C(0x0008) //!< 2 32-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X4 UINT16_C(0x0009) //!< 4 32-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_SHIFT 0
|
||||
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_MASK UINT16_C(0x000f)
|
||||
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_INT UINT16_C(0x0010) //!< Type `int`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_UINT UINT16_C(0x0020) //!< Type `uint`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_FLOAT UINT16_C(0x0030) //!< Type `float`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_SHIFT 4
|
||||
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_MASK UINT16_C(0x0030)
|
||||
|
||||
#define BGFX_BUFFER_NONE UINT16_C(0x0000)
|
||||
#define BGFX_BUFFER_COMPUTE_READ UINT16_C(0x0100) //!< Buffer will be read by shader.
|
||||
#define BGFX_BUFFER_COMPUTE_WRITE UINT16_C(0x0200) //!< Buffer will be used for writing.
|
||||
#define BGFX_BUFFER_DRAW_INDIRECT UINT16_C(0x0400) //!< Buffer will be used for storing draw indirect commands.
|
||||
#define BGFX_BUFFER_ALLOW_RESIZE UINT16_C(0x0800) //!< Allow dynamic index/vertex buffer resize during update.
|
||||
#define BGFX_BUFFER_INDEX32 UINT16_C(0x1000) //!< Index buffer contains 32-bit indices.
|
||||
#define BGFX_BUFFER_COMPUTE_READ_WRITE (0 \
|
||||
| BGFX_BUFFER_COMPUTE_READ \
|
||||
| BGFX_BUFFER_COMPUTE_WRITE \
|
||||
)
|
||||
|
||||
|
||||
#define BGFX_TEXTURE_NONE UINT64_C(0x0000000000000000)
|
||||
#define BGFX_TEXTURE_MSAA_SAMPLE UINT64_C(0x0000000800000000) //!< Texture will be used for MSAA sampling.
|
||||
#define BGFX_TEXTURE_RT UINT64_C(0x0000001000000000) //!< Render target no MSAA.
|
||||
#define BGFX_TEXTURE_COMPUTE_WRITE UINT64_C(0x0000100000000000) //!< Texture will be used for compute write.
|
||||
#define BGFX_TEXTURE_SRGB UINT64_C(0x0000200000000000) //!< Sample texture as sRGB.
|
||||
#define BGFX_TEXTURE_BLIT_DST UINT64_C(0x0000400000000000) //!< Texture will be used as blit destination.
|
||||
#define BGFX_TEXTURE_READ_BACK UINT64_C(0x0000800000000000) //!< Texture will be used for read back from GPU.
|
||||
|
||||
#define BGFX_TEXTURE_RT_MSAA_X2 UINT64_C(0x0000002000000000) //!< Render target MSAAx2 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X4 UINT64_C(0x0000003000000000) //!< Render target MSAAx4 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X8 UINT64_C(0x0000004000000000) //!< Render target MSAAx8 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X16 UINT64_C(0x0000005000000000) //!< Render target MSAAx16 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_SHIFT 36
|
||||
|
||||
#define BGFX_TEXTURE_RT_MSAA_MASK UINT64_C(0x0000007000000000)
|
||||
|
||||
#define BGFX_TEXTURE_RT_WRITE_ONLY UINT64_C(0x0000008000000000) //!< Render target will be used for writing
|
||||
#define BGFX_TEXTURE_RT_SHIFT 36
|
||||
|
||||
#define BGFX_TEXTURE_RT_MASK UINT64_C(0x000000f000000000)
|
||||
|
||||
/**
|
||||
* Sampler flags.
|
||||
*
|
||||
*/
|
||||
#define BGFX_SAMPLER_U_MIRROR UINT32_C(0x00000001) //!< Wrap U mode: Mirror
|
||||
#define BGFX_SAMPLER_U_CLAMP UINT32_C(0x00000002) //!< Wrap U mode: Clamp
|
||||
#define BGFX_SAMPLER_U_BORDER UINT32_C(0x00000003) //!< Wrap U mode: Border
|
||||
#define BGFX_SAMPLER_U_SHIFT 0
|
||||
|
||||
#define BGFX_SAMPLER_U_MASK UINT32_C(0x00000003)
|
||||
|
||||
#define BGFX_SAMPLER_V_MIRROR UINT32_C(0x00000004) //!< Wrap V mode: Mirror
|
||||
#define BGFX_SAMPLER_V_CLAMP UINT32_C(0x00000008) //!< Wrap V mode: Clamp
|
||||
#define BGFX_SAMPLER_V_BORDER UINT32_C(0x0000000c) //!< Wrap V mode: Border
|
||||
#define BGFX_SAMPLER_V_SHIFT 2
|
||||
|
||||
#define BGFX_SAMPLER_V_MASK UINT32_C(0x0000000c)
|
||||
|
||||
#define BGFX_SAMPLER_W_MIRROR UINT32_C(0x00000010) //!< Wrap W mode: Mirror
|
||||
#define BGFX_SAMPLER_W_CLAMP UINT32_C(0x00000020) //!< Wrap W mode: Clamp
|
||||
#define BGFX_SAMPLER_W_BORDER UINT32_C(0x00000030) //!< Wrap W mode: Border
|
||||
#define BGFX_SAMPLER_W_SHIFT 4
|
||||
|
||||
#define BGFX_SAMPLER_W_MASK UINT32_C(0x00000030)
|
||||
|
||||
#define BGFX_SAMPLER_MIN_POINT UINT32_C(0x00000040) //!< Min sampling mode: Point
|
||||
#define BGFX_SAMPLER_MIN_ANISOTROPIC UINT32_C(0x00000080) //!< Min sampling mode: Anisotropic
|
||||
#define BGFX_SAMPLER_MIN_SHIFT 6
|
||||
|
||||
#define BGFX_SAMPLER_MIN_MASK UINT32_C(0x000000c0)
|
||||
|
||||
#define BGFX_SAMPLER_MAG_POINT UINT32_C(0x00000100) //!< Mag sampling mode: Point
|
||||
#define BGFX_SAMPLER_MAG_ANISOTROPIC UINT32_C(0x00000200) //!< Mag sampling mode: Anisotropic
|
||||
#define BGFX_SAMPLER_MAG_SHIFT 8
|
||||
|
||||
#define BGFX_SAMPLER_MAG_MASK UINT32_C(0x00000300)
|
||||
|
||||
#define BGFX_SAMPLER_MIP_POINT UINT32_C(0x00000400) //!< Mip sampling mode: Point
|
||||
#define BGFX_SAMPLER_MIP_SHIFT 10
|
||||
|
||||
#define BGFX_SAMPLER_MIP_MASK UINT32_C(0x00000400)
|
||||
|
||||
#define BGFX_SAMPLER_COMPARE_LESS UINT32_C(0x00010000) //!< Compare when sampling depth texture: less.
|
||||
#define BGFX_SAMPLER_COMPARE_LEQUAL UINT32_C(0x00020000) //!< Compare when sampling depth texture: less or equal.
|
||||
#define BGFX_SAMPLER_COMPARE_EQUAL UINT32_C(0x00030000) //!< Compare when sampling depth texture: equal.
|
||||
#define BGFX_SAMPLER_COMPARE_GEQUAL UINT32_C(0x00040000) //!< Compare when sampling depth texture: greater or equal.
|
||||
#define BGFX_SAMPLER_COMPARE_GREATER UINT32_C(0x00050000) //!< Compare when sampling depth texture: greater.
|
||||
#define BGFX_SAMPLER_COMPARE_NOTEQUAL UINT32_C(0x00060000) //!< Compare when sampling depth texture: not equal.
|
||||
#define BGFX_SAMPLER_COMPARE_NEVER UINT32_C(0x00070000) //!< Compare when sampling depth texture: never.
|
||||
#define BGFX_SAMPLER_COMPARE_ALWAYS UINT32_C(0x00080000) //!< Compare when sampling depth texture: always.
|
||||
#define BGFX_SAMPLER_COMPARE_SHIFT 16
|
||||
|
||||
#define BGFX_SAMPLER_COMPARE_MASK UINT32_C(0x000f0000)
|
||||
|
||||
#define BGFX_SAMPLER_BORDER_COLOR_SHIFT 24
|
||||
|
||||
#define BGFX_SAMPLER_BORDER_COLOR_MASK UINT32_C(0x0f000000)
|
||||
#define BGFX_SAMPLER_BORDER_COLOR(v) ( ( (uint32_t)(v)<<BGFX_SAMPLER_BORDER_COLOR_SHIFT )&BGFX_SAMPLER_BORDER_COLOR_MASK)
|
||||
|
||||
#define BGFX_SAMPLER_RESERVED_SHIFT 28
|
||||
|
||||
#define BGFX_SAMPLER_RESERVED_MASK UINT32_C(0xf0000000)
|
||||
|
||||
#define BGFX_SAMPLER_NONE UINT32_C(0x00000000)
|
||||
#define BGFX_SAMPLER_SAMPLE_STENCIL UINT32_C(0x00100000) //!< Sample stencil instead of depth.
|
||||
#define BGFX_SAMPLER_POINT (0 \
|
||||
| BGFX_SAMPLER_MIN_POINT \
|
||||
| BGFX_SAMPLER_MAG_POINT \
|
||||
| BGFX_SAMPLER_MIP_POINT \
|
||||
)
|
||||
|
||||
#define BGFX_SAMPLER_UVW_MIRROR (0 \
|
||||
| BGFX_SAMPLER_U_MIRROR \
|
||||
| BGFX_SAMPLER_V_MIRROR \
|
||||
| BGFX_SAMPLER_W_MIRROR \
|
||||
)
|
||||
|
||||
#define BGFX_SAMPLER_UVW_CLAMP (0 \
|
||||
| BGFX_SAMPLER_U_CLAMP \
|
||||
| BGFX_SAMPLER_V_CLAMP \
|
||||
| BGFX_SAMPLER_W_CLAMP \
|
||||
)
|
||||
|
||||
#define BGFX_SAMPLER_UVW_BORDER (0 \
|
||||
| BGFX_SAMPLER_U_BORDER \
|
||||
| BGFX_SAMPLER_V_BORDER \
|
||||
| BGFX_SAMPLER_W_BORDER \
|
||||
)
|
||||
|
||||
#define BGFX_SAMPLER_BITS_MASK (0 \
|
||||
| BGFX_SAMPLER_U_MASK \
|
||||
| BGFX_SAMPLER_V_MASK \
|
||||
| BGFX_SAMPLER_W_MASK \
|
||||
| BGFX_SAMPLER_MIN_MASK \
|
||||
| BGFX_SAMPLER_MAG_MASK \
|
||||
| BGFX_SAMPLER_MIP_MASK \
|
||||
| BGFX_SAMPLER_COMPARE_MASK \
|
||||
)
|
||||
|
||||
|
||||
#define BGFX_RESET_MSAA_X2 UINT32_C(0x00000010) //!< Enable 2x MSAA.
|
||||
#define BGFX_RESET_MSAA_X4 UINT32_C(0x00000020) //!< Enable 4x MSAA.
|
||||
#define BGFX_RESET_MSAA_X8 UINT32_C(0x00000030) //!< Enable 8x MSAA.
|
||||
#define BGFX_RESET_MSAA_X16 UINT32_C(0x00000040) //!< Enable 16x MSAA.
|
||||
#define BGFX_RESET_MSAA_SHIFT 4
|
||||
|
||||
#define BGFX_RESET_MSAA_MASK UINT32_C(0x00000070)
|
||||
|
||||
#define BGFX_RESET_NONE UINT32_C(0x00000000) //!< No reset flags.
|
||||
#define BGFX_RESET_FULLSCREEN UINT32_C(0x00000001) //!< Not supported yet.
|
||||
#define BGFX_RESET_VSYNC UINT32_C(0x00000080) //!< Enable V-Sync.
|
||||
#define BGFX_RESET_MAXANISOTROPY UINT32_C(0x00000100) //!< Turn on/off max anisotropy.
|
||||
#define BGFX_RESET_CAPTURE UINT32_C(0x00000200) //!< Begin screen capture.
|
||||
#define BGFX_RESET_FLUSH_AFTER_RENDER UINT32_C(0x00002000) //!< Flush rendering after submitting to GPU.
|
||||
#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000) //!< This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
|
||||
#define BGFX_RESET_SRGB_BACKBUFFER UINT32_C(0x00008000) //!< Enable sRGB backbuffer.
|
||||
#define BGFX_RESET_HDR10 UINT32_C(0x00010000) //!< Enable HDR10 rendering.
|
||||
#define BGFX_RESET_HIDPI UINT32_C(0x00020000) //!< Enable HiDPI rendering.
|
||||
#define BGFX_RESET_DEPTH_CLAMP UINT32_C(0x00040000) //!< Enable depth clamp.
|
||||
#define BGFX_RESET_SUSPEND UINT32_C(0x00080000) //!< Suspend rendering.
|
||||
|
||||
#define BGFX_RESET_FULLSCREEN_SHIFT 0
|
||||
|
||||
#define BGFX_RESET_FULLSCREEN_MASK UINT32_C(0x00000001)
|
||||
|
||||
#define BGFX_RESET_RESERVED_SHIFT 31 //!< Internal bit shift
|
||||
#define BGFX_RESET_RESERVED_MASK UINT32_C(0x80000000) //!< Internal bit mask
|
||||
|
||||
#define BGFX_CAPS_ALPHA_TO_COVERAGE UINT64_C(0x0000000000000001) //!< Alpha to coverage is supported.
|
||||
#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000002) //!< Blend independent is supported.
|
||||
#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000004) //!< Compute shaders are supported.
|
||||
#define BGFX_CAPS_CONSERVATIVE_RASTER UINT64_C(0x0000000000000008) //!< Conservative rasterization is supported.
|
||||
#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000000010) //!< Draw indirect is supported.
|
||||
#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000020) //!< Fragment depth is accessible in fragment shader.
|
||||
#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000040) //!< Fragment ordering is available in fragment shader.
|
||||
#define BGFX_CAPS_FRAMEBUFFER_RW UINT64_C(0x0000000000000080) //!< Read/Write frame buffer attachments are supported.
|
||||
#define BGFX_CAPS_GRAPHICS_DEBUGGER UINT64_C(0x0000000000000100) //!< Graphics debugger is present.
|
||||
#define BGFX_CAPS_RESERVED UINT64_C(0x0000000000000200)
|
||||
#define BGFX_CAPS_HDR10 UINT64_C(0x0000000000000400) //!< HDR10 rendering is supported.
|
||||
#define BGFX_CAPS_HIDPI UINT64_C(0x0000000000000800) //!< HiDPI rendering is supported.
|
||||
#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000001000) //!< 32-bit indices are supported.
|
||||
#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000002000) //!< Instancing is supported.
|
||||
#define BGFX_CAPS_OCCLUSION_QUERY UINT64_C(0x0000000000004000) //!< Occlusion query is supported.
|
||||
#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000008000) //!< Renderer is on separate thread.
|
||||
#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000010000) //!< Multiple windows are supported.
|
||||
#define BGFX_CAPS_TEXTURE_2D_ARRAY UINT64_C(0x0000000000020000) //!< 2D texture array is supported.
|
||||
#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000040000) //!< 3D textures are supported.
|
||||
#define BGFX_CAPS_TEXTURE_BLIT UINT64_C(0x0000000000080000) //!< Texture blit is supported.
|
||||
#define BGFX_CAPS_TEXTURE_COMPARE_RESERVED UINT64_C(0x0000000000100000) //!< All texture compare modes are supported.
|
||||
#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000200000) //!< Texture compare less equal mode is supported.
|
||||
#define BGFX_CAPS_TEXTURE_CUBE_ARRAY UINT64_C(0x0000000000400000) //!< Cubemap texture array is supported.
|
||||
#define BGFX_CAPS_TEXTURE_DIRECT_ACCESS UINT64_C(0x0000000000800000) //!< CPU direct access to GPU texture memory.
|
||||
#define BGFX_CAPS_TEXTURE_READ_BACK UINT64_C(0x0000000001000000) //!< Read-back texture is supported.
|
||||
#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000002000000) //!< Vertex attribute half-float is supported.
|
||||
#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000004000000) //!< Vertex attribute 10_10_10_2 is supported.
|
||||
#define BGFX_CAPS_VERTEX_ID UINT64_C(0x0000000008000000) //!< Rendering with VertexID only is supported.
|
||||
/// All texture compare modes are supported.
|
||||
#define BGFX_CAPS_TEXTURE_COMPARE_ALL (0 \
|
||||
| BGFX_CAPS_TEXTURE_COMPARE_RESERVED \
|
||||
| BGFX_CAPS_TEXTURE_COMPARE_LEQUAL \
|
||||
)
|
||||
|
||||
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT16_C(0x0000) //!< Texture format is not supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D UINT16_C(0x0001) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB UINT16_C(0x0002) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED UINT16_C(0x0004) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D UINT16_C(0x0008) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB UINT16_C(0x0010) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED UINT16_C(0x0020) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE UINT16_C(0x0040) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB UINT16_C(0x0080) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED UINT16_C(0x0100) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_VERTEX UINT16_C(0x0200) //!< Texture format can be used from vertex shader.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE UINT16_C(0x0400) //!< Texture format can be used as image from compute shader.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER UINT16_C(0x0800) //!< Texture format can be used as frame buffer.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA UINT16_C(0x1000) //!< Texture format can be used as MSAA frame buffer.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_MSAA UINT16_C(0x2000) //!< Texture can be sampled as MSAA.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN UINT16_C(0x4000) //!< Texture format supports auto-generated mips.
|
||||
|
||||
#define BGFX_RESOLVE_NONE UINT8_C(0x00) //!< No resolve flags.
|
||||
#define BGFX_RESOLVE_AUTO_GEN_MIPS UINT8_C(0x01) //!< Auto-generate mip maps on resolve.
|
||||
|
||||
#define BGFX_PCI_ID_NONE UINT16_C(0x0000) //!< Autoselect adapter.
|
||||
#define BGFX_PCI_ID_SOFTWARE_RASTERIZER UINT16_C(0x0001) //!< Software rasterizer.
|
||||
#define BGFX_PCI_ID_AMD UINT16_C(0x1002) //!< AMD adapter.
|
||||
#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) //!< Intel adapter.
|
||||
#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) //!< nVidia adapter.
|
||||
|
||||
#define BGFX_CUBE_MAP_POSITIVE_X UINT8_C(0x00) //!< Cubemap +x.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_X UINT8_C(0x01) //!< Cubemap -x.
|
||||
#define BGFX_CUBE_MAP_POSITIVE_Y UINT8_C(0x02) //!< Cubemap +y.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_Y UINT8_C(0x03) //!< Cubemap -y.
|
||||
#define BGFX_CUBE_MAP_POSITIVE_Z UINT8_C(0x04) //!< Cubemap +z.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_Z UINT8_C(0x05) //!< Cubemap -z.
|
||||
|
||||
/// Point size value.
|
||||
#define BGFX_STATE_POINT_SIZE(_size) ( ( (uint64_t)(_size)<<BGFX_STATE_POINT_SIZE_SHIFT)&BGFX_STATE_POINT_SIZE_MASK)
|
||||
|
||||
/// Blend function separate.
|
||||
#define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (UINT64_C(0) \
|
||||
@ -204,341 +580,5 @@
|
||||
#define BGFX_STATE_BLEND_FUNC_RT_2E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<11)
|
||||
#define BGFX_STATE_BLEND_FUNC_RT_3E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<22)
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_FUNC_REF_SHIFT 0 //!<
|
||||
#define BGFX_STENCIL_FUNC_REF_MASK UINT32_C(0x000000ff) //!<
|
||||
#define BGFX_STENCIL_FUNC_RMASK_SHIFT 8 //!<
|
||||
#define BGFX_STENCIL_FUNC_RMASK_MASK UINT32_C(0x0000ff00) //!<
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_TEST_LESS UINT32_C(0x00010000) //!< Enable stencil test, less.
|
||||
#define BGFX_STENCIL_TEST_LEQUAL UINT32_C(0x00020000) //!< Enable stencil test, less or equal.
|
||||
#define BGFX_STENCIL_TEST_EQUAL UINT32_C(0x00030000) //!< Enable stencil test, equal.
|
||||
#define BGFX_STENCIL_TEST_GEQUAL UINT32_C(0x00040000) //!< Enable stencil test, greater or equal.
|
||||
#define BGFX_STENCIL_TEST_GREATER UINT32_C(0x00050000) //!< Enable stencil test, greater.
|
||||
#define BGFX_STENCIL_TEST_NOTEQUAL UINT32_C(0x00060000) //!< Enable stencil test, not equal.
|
||||
#define BGFX_STENCIL_TEST_NEVER UINT32_C(0x00070000) //!< Enable stencil test, never.
|
||||
#define BGFX_STENCIL_TEST_ALWAYS UINT32_C(0x00080000) //!< Enable stencil test, always.
|
||||
#define BGFX_STENCIL_TEST_SHIFT 16 //!< Stencil test bit shift.
|
||||
#define BGFX_STENCIL_TEST_MASK UINT32_C(0x000f0000) //!< Stencil test bit mask.
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_OP_FAIL_S_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_KEEP UINT32_C(0x00100000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_REPLACE UINT32_C(0x00200000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INCR UINT32_C(0x00300000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INCRSAT UINT32_C(0x00400000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_DECR UINT32_C(0x00500000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_DECRSAT UINT32_C(0x00600000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_INVERT UINT32_C(0x00700000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_SHIFT 20 //!< Stencil operation fail bit shift.
|
||||
#define BGFX_STENCIL_OP_FAIL_S_MASK UINT32_C(0x00f00000) //!< Stencil operation fail bit mask.
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_KEEP UINT32_C(0x01000000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_REPLACE UINT32_C(0x02000000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INCR UINT32_C(0x03000000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INCRSAT UINT32_C(0x04000000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_DECR UINT32_C(0x05000000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_DECRSAT UINT32_C(0x06000000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_INVERT UINT32_C(0x07000000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_SHIFT 24 //!< Stencil operation depth fail bit shift
|
||||
#define BGFX_STENCIL_OP_FAIL_Z_MASK UINT32_C(0x0f000000) //!< Stencil operation depth fail bit mask.
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_OP_PASS_Z_ZERO UINT32_C(0x00000000) //!< Zero.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_KEEP UINT32_C(0x10000000) //!< Keep.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_REPLACE UINT32_C(0x20000000) //!< Replace.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INCR UINT32_C(0x30000000) //!< Increment and wrap.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INCRSAT UINT32_C(0x40000000) //!< Increment and clamp.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_DECR UINT32_C(0x50000000) //!< Decrement and wrap.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_DECRSAT UINT32_C(0x60000000) //!< Decrement and clamp.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_INVERT UINT32_C(0x70000000) //!< Invert.
|
||||
#define BGFX_STENCIL_OP_PASS_Z_SHIFT 28 //!< Stencil operation depth pass bit shift
|
||||
#define BGFX_STENCIL_OP_PASS_Z_MASK UINT32_C(0xf0000000) //!< Stencil operation depth pass bit mask.
|
||||
|
||||
///
|
||||
#define BGFX_STENCIL_NONE UINT32_C(0x00000000) //!<
|
||||
#define BGFX_STENCIL_MASK UINT32_C(0xffffffff) //!<
|
||||
#define BGFX_STENCIL_DEFAULT UINT32_C(0x00000000) //!<
|
||||
|
||||
/// Set stencil ref value.
|
||||
#define BGFX_STENCIL_FUNC_REF(_ref) ( ((uint32_t)(_ref)<<BGFX_STENCIL_FUNC_REF_SHIFT)&BGFX_STENCIL_FUNC_REF_MASK)
|
||||
|
||||
/// Set stencil rmask value.
|
||||
#define BGFX_STENCIL_FUNC_RMASK(_mask) ( ((uint32_t)(_mask)<<BGFX_STENCIL_FUNC_RMASK_SHIFT)&BGFX_STENCIL_FUNC_RMASK_MASK)
|
||||
|
||||
///
|
||||
#define BGFX_CLEAR_NONE UINT16_C(0x0000) //!< No clear flags.
|
||||
#define BGFX_CLEAR_COLOR UINT16_C(0x0001) //!< Clear color.
|
||||
#define BGFX_CLEAR_DEPTH UINT16_C(0x0002) //!< Clear depth.
|
||||
#define BGFX_CLEAR_STENCIL UINT16_C(0x0004) //!< Clear stencil.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_0 UINT16_C(0x0008) //!< Discard frame buffer attachment 0.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_1 UINT16_C(0x0010) //!< Discard frame buffer attachment 1.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_2 UINT16_C(0x0020) //!< Discard frame buffer attachment 2.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_3 UINT16_C(0x0040) //!< Discard frame buffer attachment 3.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_4 UINT16_C(0x0080) //!< Discard frame buffer attachment 4.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_5 UINT16_C(0x0100) //!< Discard frame buffer attachment 5.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_6 UINT16_C(0x0200) //!< Discard frame buffer attachment 6.
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_7 UINT16_C(0x0400) //!< Discard frame buffer attachment 7.
|
||||
#define BGFX_CLEAR_DISCARD_DEPTH UINT16_C(0x0800) //!< Discard frame buffer depth attachment.
|
||||
#define BGFX_CLEAR_DISCARD_STENCIL UINT16_C(0x1000) //!< Discard frame buffer stencil attachment.
|
||||
|
||||
///
|
||||
#define BGFX_CLEAR_DISCARD_COLOR_MASK (0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_1 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_2 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_3 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_4 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_5 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_6 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_7 \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_CLEAR_DISCARD_MASK (0 \
|
||||
| BGFX_CLEAR_DISCARD_COLOR_MASK \
|
||||
| BGFX_CLEAR_DISCARD_DEPTH \
|
||||
| BGFX_CLEAR_DISCARD_STENCIL \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_DEBUG_NONE UINT32_C(0x00000000) //!< No debug.
|
||||
#define BGFX_DEBUG_WIREFRAME UINT32_C(0x00000001) //!< Enable wireframe for all primitives.
|
||||
#define BGFX_DEBUG_IFH UINT32_C(0x00000002) //!< 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.
|
||||
#define BGFX_DEBUG_STATS UINT32_C(0x00000004) //!< Enable statistics display.
|
||||
#define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display.
|
||||
#define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler.
|
||||
|
||||
///
|
||||
#define BGFX_BUFFER_NONE UINT16_C(0x0000) //!<
|
||||
|
||||
///
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X1 UINT16_C(0x0001) //!< 1 8-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X2 UINT16_C(0x0002) //!< 2 8-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_8X4 UINT16_C(0x0003) //!< 4 8-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X1 UINT16_C(0x0004) //!< 1 16-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X2 UINT16_C(0x0005) //!< 2 16-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_16X4 UINT16_C(0x0006) //!< 4 16-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X1 UINT16_C(0x0007) //!< 1 32-bit value
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X2 UINT16_C(0x0008) //!< 2 32-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_32X4 UINT16_C(0x0009) //!< 4 32-bit values
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_SHIFT 0 //!<
|
||||
#define BGFX_BUFFER_COMPUTE_FORMAT_MASK UINT16_C(0x000f) //!<
|
||||
|
||||
///
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_INT UINT16_C(0x0010) //!< Type `int`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_UINT UINT16_C(0x0020) //!< Type `uint`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_FLOAT UINT16_C(0x0030) //!< Type `float`.
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_SHIFT 4 //!<
|
||||
#define BGFX_BUFFER_COMPUTE_TYPE_MASK UINT16_C(0x0030) //!<
|
||||
|
||||
///
|
||||
#define BGFX_BUFFER_COMPUTE_READ UINT16_C(0x0100) //!< Buffer will be read by shader.
|
||||
#define BGFX_BUFFER_COMPUTE_WRITE UINT16_C(0x0200) //!< Buffer will be used for writing.
|
||||
#define BGFX_BUFFER_DRAW_INDIRECT UINT16_C(0x0400) //!< Buffer will be used for storing draw indirect commands.
|
||||
#define BGFX_BUFFER_ALLOW_RESIZE UINT16_C(0x0800) //!< Allow dynamic index/vertex buffer resize during update.
|
||||
#define BGFX_BUFFER_INDEX32 UINT16_C(0x1000) //!< Index buffer contains 32-bit indices.
|
||||
|
||||
///
|
||||
#define BGFX_BUFFER_COMPUTE_READ_WRITE (0 \
|
||||
| BGFX_BUFFER_COMPUTE_READ \
|
||||
| BGFX_BUFFER_COMPUTE_WRITE \
|
||||
)
|
||||
|
||||
/// Texture creation flags.
|
||||
#define BGFX_TEXTURE_NONE UINT64_C(0x0000000000000000) //!<
|
||||
#define BGFX_TEXTURE_MSAA_SAMPLE UINT64_C(0x0000000800000000) //!< Texture will be used for MSAA sampling.
|
||||
#define BGFX_TEXTURE_RT UINT64_C(0x0000001000000000) //!< Render target no MSAA.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X2 UINT64_C(0x0000002000000000) //!< Render target MSAAx2 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X4 UINT64_C(0x0000003000000000) //!< Render target MSAAx4 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X8 UINT64_C(0x0000004000000000) //!< Render target MSAAx8 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_X16 UINT64_C(0x0000005000000000) //!< Render target MSAAx16 mode.
|
||||
#define BGFX_TEXTURE_RT_MSAA_SHIFT 36 //!<
|
||||
#define BGFX_TEXTURE_RT_MSAA_MASK UINT64_C(0x0000007000000000) //!<
|
||||
#define BGFX_TEXTURE_RT_WRITE_ONLY UINT64_C(0x0000008000000000) //!< Render target will be used for writing only.
|
||||
#define BGFX_TEXTURE_RT_MASK UINT64_C(0x000000f000000000) //!<
|
||||
#define BGFX_TEXTURE_COMPUTE_WRITE UINT64_C(0x0000100000000000) //!< Texture will be used for compute write.
|
||||
#define BGFX_TEXTURE_SRGB UINT64_C(0x0000200000000000) //!< Sample texture as sRGB.
|
||||
#define BGFX_TEXTURE_BLIT_DST UINT64_C(0x0000400000000000) //!< Texture will be used as blit destination.
|
||||
#define BGFX_TEXTURE_READ_BACK UINT64_C(0x0000800000000000) //!< Texture will be used for read back from GPU.
|
||||
|
||||
/// Sampler flags.
|
||||
#define BGFX_SAMPLER_NONE UINT32_C(0x00000000) //!<
|
||||
#define BGFX_SAMPLER_U_MIRROR UINT32_C(0x00000001) //!< Wrap U mode: Mirror
|
||||
#define BGFX_SAMPLER_U_CLAMP UINT32_C(0x00000002) //!< Wrap U mode: Clamp
|
||||
#define BGFX_SAMPLER_U_BORDER UINT32_C(0x00000003) //!< Wrap U mode: Border
|
||||
#define BGFX_SAMPLER_U_SHIFT 0 //!<
|
||||
#define BGFX_SAMPLER_U_MASK UINT32_C(0x00000003) //!<
|
||||
#define BGFX_SAMPLER_V_MIRROR UINT32_C(0x00000004) //!< Wrap V mode: Mirror
|
||||
#define BGFX_SAMPLER_V_CLAMP UINT32_C(0x00000008) //!< Wrap V mode: Clamp
|
||||
#define BGFX_SAMPLER_V_BORDER UINT32_C(0x0000000c) //!< Wrap V mode: Border
|
||||
#define BGFX_SAMPLER_V_SHIFT 2 //!<
|
||||
#define BGFX_SAMPLER_V_MASK UINT32_C(0x0000000c) //!<
|
||||
#define BGFX_SAMPLER_W_MIRROR UINT32_C(0x00000010) //!< Wrap W mode: Mirror
|
||||
#define BGFX_SAMPLER_W_CLAMP UINT32_C(0x00000020) //!< Wrap W mode: Clamp
|
||||
#define BGFX_SAMPLER_W_BORDER UINT32_C(0x00000030) //!< Wrap W mode: Border
|
||||
#define BGFX_SAMPLER_W_SHIFT 4 //!<
|
||||
#define BGFX_SAMPLER_W_MASK UINT32_C(0x00000030) //!<
|
||||
#define BGFX_SAMPLER_MIN_POINT UINT32_C(0x00000040) //!< Min sampling mode: Point
|
||||
#define BGFX_SAMPLER_MIN_ANISOTROPIC UINT32_C(0x00000080) //!< Min sampling mode: Anisotropic
|
||||
#define BGFX_SAMPLER_MIN_SHIFT 6 //!<
|
||||
#define BGFX_SAMPLER_MIN_MASK UINT32_C(0x000000c0) //!<
|
||||
#define BGFX_SAMPLER_MAG_POINT UINT32_C(0x00000100) //!< Mag sampling mode: Point
|
||||
#define BGFX_SAMPLER_MAG_ANISOTROPIC UINT32_C(0x00000200) //!< Mag sampling mode: Anisotropic
|
||||
#define BGFX_SAMPLER_MAG_SHIFT 8 //!<
|
||||
#define BGFX_SAMPLER_MAG_MASK UINT32_C(0x00000300) //!<
|
||||
#define BGFX_SAMPLER_MIP_POINT UINT32_C(0x00000400) //!< Mip sampling mode: Point
|
||||
#define BGFX_SAMPLER_MIP_SHIFT 10 //!<
|
||||
#define BGFX_SAMPLER_MIP_MASK UINT32_C(0x00000400) //!<
|
||||
#define BGFX_SAMPLER_COMPARE_LESS UINT32_C(0x00010000) //!< Compare when sampling depth texture: less.
|
||||
#define BGFX_SAMPLER_COMPARE_LEQUAL UINT32_C(0x00020000) //!< Compare when sampling depth texture: less or equal.
|
||||
#define BGFX_SAMPLER_COMPARE_EQUAL UINT32_C(0x00030000) //!< Compare when sampling depth texture: equal.
|
||||
#define BGFX_SAMPLER_COMPARE_GEQUAL UINT32_C(0x00040000) //!< Compare when sampling depth texture: greater or equal.
|
||||
#define BGFX_SAMPLER_COMPARE_GREATER UINT32_C(0x00050000) //!< Compare when sampling depth texture: greater.
|
||||
#define BGFX_SAMPLER_COMPARE_NOTEQUAL UINT32_C(0x00060000) //!< Compare when sampling depth texture: not equal.
|
||||
#define BGFX_SAMPLER_COMPARE_NEVER UINT32_C(0x00070000) //!< Compare when sampling depth texture: never.
|
||||
#define BGFX_SAMPLER_COMPARE_ALWAYS UINT32_C(0x00080000) //!< Compare when sampling depth texture: always.
|
||||
#define BGFX_SAMPLER_COMPARE_SHIFT 16 //!<
|
||||
#define BGFX_SAMPLER_COMPARE_MASK UINT32_C(0x000f0000) //!<
|
||||
#define BGFX_SAMPLER_SAMPLE_STENCIL UINT32_C(0x00100000) //!< Sample stencil instead of depth.
|
||||
#define BGFX_SAMPLER_BORDER_COLOR_SHIFT 24 //!<
|
||||
#define BGFX_SAMPLER_BORDER_COLOR_MASK UINT32_C(0x0f000000) //!<
|
||||
#define BGFX_SAMPLER_RESERVED_SHIFT 28 //!<
|
||||
#define BGFX_SAMPLER_RESERVED_MASK UINT32_C(0xf0000000) //!<
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_BORDER_COLOR(_index) ( (_index << BGFX_SAMPLER_BORDER_COLOR_SHIFT) & BGFX_SAMPLER_BORDER_COLOR_MASK)
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_POINT (0 \
|
||||
| BGFX_SAMPLER_MIN_POINT \
|
||||
| BGFX_SAMPLER_MAG_POINT \
|
||||
| BGFX_SAMPLER_MIP_POINT \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_UVW_MIRROR (0 \
|
||||
| BGFX_SAMPLER_U_MIRROR \
|
||||
| BGFX_SAMPLER_V_MIRROR \
|
||||
| BGFX_SAMPLER_W_MIRROR \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_UVW_CLAMP (0 \
|
||||
| BGFX_SAMPLER_U_CLAMP \
|
||||
| BGFX_SAMPLER_V_CLAMP \
|
||||
| BGFX_SAMPLER_W_CLAMP \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_UVW_BORDER (0 \
|
||||
| BGFX_SAMPLER_U_BORDER \
|
||||
| BGFX_SAMPLER_V_BORDER \
|
||||
| BGFX_SAMPLER_W_BORDER \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_SAMPLER_BITS_MASK (0 \
|
||||
| BGFX_SAMPLER_U_MASK \
|
||||
| BGFX_SAMPLER_V_MASK \
|
||||
| BGFX_SAMPLER_W_MASK \
|
||||
| BGFX_SAMPLER_MIN_MASK \
|
||||
| BGFX_SAMPLER_MAG_MASK \
|
||||
| BGFX_SAMPLER_MIP_MASK \
|
||||
| BGFX_SAMPLER_COMPARE_MASK \
|
||||
)
|
||||
|
||||
///
|
||||
#define BGFX_RESET_NONE UINT32_C(0x00000000) //!< No reset flags.
|
||||
#define BGFX_RESET_FULLSCREEN UINT32_C(0x00000001) //!< Not supported yet.
|
||||
#define BGFX_RESET_FULLSCREEN_SHIFT 0 //!< Fullscreen bit shift.
|
||||
#define BGFX_RESET_FULLSCREEN_MASK UINT32_C(0x00000001) //!< Fullscreen bit mask.
|
||||
#define BGFX_RESET_MSAA_X2 UINT32_C(0x00000010) //!< Enable 2x MSAA.
|
||||
#define BGFX_RESET_MSAA_X4 UINT32_C(0x00000020) //!< Enable 4x MSAA.
|
||||
#define BGFX_RESET_MSAA_X8 UINT32_C(0x00000030) //!< Enable 8x MSAA.
|
||||
#define BGFX_RESET_MSAA_X16 UINT32_C(0x00000040) //!< Enable 16x MSAA.
|
||||
#define BGFX_RESET_MSAA_SHIFT 4 //!< MSAA mode bit shift.
|
||||
#define BGFX_RESET_MSAA_MASK UINT32_C(0x00000070) //!< MSAA mode bit mask.
|
||||
#define BGFX_RESET_VSYNC UINT32_C(0x00000080) //!< Enable V-Sync.
|
||||
#define BGFX_RESET_MAXANISOTROPY UINT32_C(0x00000100) //!< Turn on/off max anisotropy.
|
||||
#define BGFX_RESET_CAPTURE UINT32_C(0x00000200) //!< Begin screen capture.
|
||||
#define BGFX_RESET_FLUSH_AFTER_RENDER UINT32_C(0x00002000) //!< Flush rendering after submitting to GPU.
|
||||
#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000) //!< This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
|
||||
#define BGFX_RESET_SRGB_BACKBUFFER UINT32_C(0x00008000) //!< Enable sRGB backbuffer.
|
||||
#define BGFX_RESET_HDR10 UINT32_C(0x00010000) //!< Enable HDR10 rendering.
|
||||
#define BGFX_RESET_HIDPI UINT32_C(0x00020000) //!< Enable HiDPI rendering.
|
||||
#define BGFX_RESET_DEPTH_CLAMP UINT32_C(0x00040000) //!< Enable depth clamp.
|
||||
#define BGFX_RESET_SUSPEND UINT32_C(0x00080000) //!< Suspend rendering.
|
||||
#define BGFX_RESET_RESERVED_SHIFT 31 //!< Internal bits shift.
|
||||
#define BGFX_RESET_RESERVED_MASK UINT32_C(0x80000000) //!< Internal bits mask.
|
||||
|
||||
///
|
||||
#define BGFX_CAPS_ALPHA_TO_COVERAGE UINT64_C(0x0000000000000001) //!< Alpha to coverage is supported.
|
||||
#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000002) //!< Blend independent is supported.
|
||||
#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000004) //!< Compute shaders are supported.
|
||||
#define BGFX_CAPS_CONSERVATIVE_RASTER UINT64_C(0x0000000000000008) //!< Conservative rasterization is supported.
|
||||
#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000000010) //!< Draw indirect is supported.
|
||||
#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000020) //!< Fragment depth is accessible in fragment shader.
|
||||
#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000040) //!< Fragment ordering is available in fragment shader.
|
||||
#define BGFX_CAPS_FRAMEBUFFER_RW UINT64_C(0x0000000000000080) //!< Read/Write frame buffer attachments are supported.
|
||||
#define BGFX_CAPS_GRAPHICS_DEBUGGER UINT64_C(0x0000000000000100) //!< Graphics debugger is present.
|
||||
#define BGFX_CAPS_HDR10 UINT64_C(0x0000000000000400) //!< HDR10 rendering is supported.
|
||||
#define BGFX_CAPS_HIDPI UINT64_C(0x0000000000000800) //!< HiDPI rendering is supported.
|
||||
#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000001000) //!< 32-bit indices are supported.
|
||||
#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000002000) //!< Instancing is supported.
|
||||
#define BGFX_CAPS_OCCLUSION_QUERY UINT64_C(0x0000000000004000) //!< Occlusion query is supported.
|
||||
#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000008000) //!< Renderer is on separate thread.
|
||||
#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000010000) //!< Multiple windows are supported.
|
||||
#define BGFX_CAPS_TEXTURE_2D_ARRAY UINT64_C(0x0000000000020000) //!< 2D texture array is supported.
|
||||
#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000040000) //!< 3D textures are supported.
|
||||
#define BGFX_CAPS_TEXTURE_BLIT UINT64_C(0x0000000000080000) //!< Texture blit is supported.
|
||||
#define BGFX_CAPS_TEXTURE_COMPARE_ALL UINT64_C(0x0000000000300000) //!< All texture compare modes are supported.
|
||||
#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000200000) //!< Texture compare less equal mode is supported.
|
||||
#define BGFX_CAPS_TEXTURE_CUBE_ARRAY UINT64_C(0x0000000000400000) //!< Cubemap texture array is supported.
|
||||
#define BGFX_CAPS_TEXTURE_DIRECT_ACCESS UINT64_C(0x0000000000800000) //!< CPU direct access to GPU texture memory.
|
||||
#define BGFX_CAPS_TEXTURE_READ_BACK UINT64_C(0x0000000001000000) //!< Read-back texture is supported.
|
||||
#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000002000000) //!< Vertex attribute half-float is supported.
|
||||
#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000004000000) //!< Vertex attribute 10_10_10_2 is supported.
|
||||
#define BGFX_CAPS_VERTEX_ID UINT64_C(0x0000000008000000) //!< Rendering with VertexID only is supported.
|
||||
|
||||
///
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT16_C(0x0000) //!< Texture format is not supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D UINT16_C(0x0001) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB UINT16_C(0x0002) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED UINT16_C(0x0004) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D UINT16_C(0x0008) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB UINT16_C(0x0010) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED UINT16_C(0x0020) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE UINT16_C(0x0040) //!< Texture format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB UINT16_C(0x0080) //!< Texture as sRGB format is supported.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED UINT16_C(0x0100) //!< Texture format is emulated.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_VERTEX UINT16_C(0x0200) //!< Texture format can be used from vertex shader.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE UINT16_C(0x0400) //!< Texture format can be used as image from compute shader.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER UINT16_C(0x0800) //!< Texture format can be used as frame buffer.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA UINT16_C(0x1000) //!< Texture format can be used as MSAA frame buffer.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_MSAA UINT16_C(0x2000) //!< Texture can be sampled as MSAA.
|
||||
#define BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN UINT16_C(0x4000) //!< Texture format supports auto-generated mips.
|
||||
|
||||
///
|
||||
#define BGFX_RESOLVE_NONE UINT8_C(0x00) //!< No resolve flags.
|
||||
#define BGFX_RESOLVE_AUTO_GEN_MIPS UINT8_C(0x01) //!< Auto-generate mip maps on resolve.
|
||||
|
||||
///
|
||||
#define BGFX_PCI_ID_NONE UINT16_C(0x0000) //!< Autoselect adapter.
|
||||
#define BGFX_PCI_ID_SOFTWARE_RASTERIZER UINT16_C(0x0001) //!< Software rasterizer.
|
||||
#define BGFX_PCI_ID_AMD UINT16_C(0x1002) //!< AMD adapter.
|
||||
#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) //!< Intel adapter.
|
||||
#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) //!< nVidia adapter.
|
||||
|
||||
///
|
||||
#define BGFX_CUBE_MAP_POSITIVE_X UINT8_C(0x00) //!< Cubemap +x.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_X UINT8_C(0x01) //!< Cubemap -x.
|
||||
#define BGFX_CUBE_MAP_POSITIVE_Y UINT8_C(0x02) //!< Cubemap +y.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_Y UINT8_C(0x03) //!< Cubemap -y.
|
||||
#define BGFX_CUBE_MAP_POSITIVE_Z UINT8_C(0x04) //!< Cubemap +z.
|
||||
#define BGFX_CUBE_MAP_NEGATIVE_Z UINT8_C(0x05) //!< Cubemap -z.
|
||||
|
||||
#endif // BGFX_DEFINES_H_HEADER_GUARD
|
||||
|
@ -64,7 +64,7 @@ flag.StateBlend { bits = 64, shift = 12, range = 16, base = 1, desc = "Blend sta
|
||||
.InvDstColor --- 1-Rd, 1-Gd, 1-Bd, 1-Ad
|
||||
.SrcAlphaSat --- f, f, f, 1; f = min(As, 1-Ad)
|
||||
.Factor --- Blend factor
|
||||
.Inv_Factor --- 1-Blend factor
|
||||
.InvFactor --- 1-Blend factor
|
||||
()
|
||||
|
||||
--- Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
|
||||
@ -86,7 +86,7 @@ flag.StateCull { bits = 64, shift = 36, range = 2, base = 1, desc = "Culling mod
|
||||
--- Alpha reference value.
|
||||
flag.StateAlphaRef { bits = 64, shift = 40, range = 8, desc = "Alpha reference", "helper" }
|
||||
|
||||
flag.StatePt { bits = 64, shift = 48, range = 3, desc = "Primitive type" }
|
||||
flag.StatePt { bits = 64, shift = 48, range = 3, base = 1, desc = "Primitive type" }
|
||||
.Tristrip --- Tristrip.
|
||||
.Lines --- Lines.
|
||||
.Linestrip --- Line strip.
|
||||
@ -173,25 +173,25 @@ flag.Clear { bits = 16 }
|
||||
.Color --- Clear color.
|
||||
.Depth --- Clear depth.
|
||||
.Stencil --- Clear stencil.
|
||||
.DiscardColor0 --- Discard frame buffer attachment 0.
|
||||
.DiscardColor1 --- Discard frame buffer attachment 1.
|
||||
.DiscardColor2 --- Discard frame buffer attachment 2.
|
||||
.DiscardColor3 --- Discard frame buffer attachment 3.
|
||||
.DiscardColor4 --- Discard frame buffer attachment 4.
|
||||
.DiscardColor5 --- Discard frame buffer attachment 5.
|
||||
.DiscardColor6 --- Discard frame buffer attachment 6.
|
||||
.DiscardColor7 --- Discard frame buffer attachment 7.
|
||||
.DiscardColor_0 --- Discard frame buffer attachment 0.
|
||||
.DiscardColor_1 --- Discard frame buffer attachment 1.
|
||||
.DiscardColor_2 --- Discard frame buffer attachment 2.
|
||||
.DiscardColor_3 --- Discard frame buffer attachment 3.
|
||||
.DiscardColor_4 --- Discard frame buffer attachment 4.
|
||||
.DiscardColor_5 --- Discard frame buffer attachment 5.
|
||||
.DiscardColor_6 --- Discard frame buffer attachment 6.
|
||||
.DiscardColor_7 --- Discard frame buffer attachment 7.
|
||||
.DiscardDepth --- Discard frame buffer depth attachment.
|
||||
.DiscardStencil --- Discard frame buffer stencil attachment.
|
||||
.DiscardColorMask {
|
||||
"DiscardColor0",
|
||||
"DiscardColor1",
|
||||
"DiscardColor2",
|
||||
"DiscardColor3",
|
||||
"DiscardColor4",
|
||||
"DiscardColor5",
|
||||
"DiscardColor6",
|
||||
"DiscardColor7"
|
||||
"DiscardColor_0",
|
||||
"DiscardColor_1",
|
||||
"DiscardColor_2",
|
||||
"DiscardColor_3",
|
||||
"DiscardColor_4",
|
||||
"DiscardColor_5",
|
||||
"DiscardColor_6",
|
||||
"DiscardColor_7"
|
||||
}
|
||||
.DiscardMask {
|
||||
"DiscardColorMask",
|
||||
@ -209,15 +209,15 @@ flag.Debug { bits = 32 }
|
||||
()
|
||||
|
||||
flag.BufferComputeFormat { bits = 16, shift = 0, range = 4, base = 1 }
|
||||
["8x1"] --- 1 8-bit value
|
||||
["8x2"] --- 2 8-bit values
|
||||
["8x4"] --- 4 8-bit values
|
||||
["16x1"] --- 1 16-bit value
|
||||
["16x2"] --- 2 16-bit values
|
||||
["16x4"] --- 4 16-bit values
|
||||
["32x1"] --- 1 32-bit value
|
||||
["32x2"] --- 2 32-bit values
|
||||
["32x4"] --- 4 32-bit values
|
||||
._8x1 --- 1 8-bit value
|
||||
._8x2 --- 2 8-bit values
|
||||
._8x4 --- 4 8-bit values
|
||||
._16x1 --- 1 16-bit value
|
||||
._16x2 --- 2 16-bit values
|
||||
._16x4 --- 4 16-bit values
|
||||
._32x1 --- 1 32-bit value
|
||||
._32x2 --- 2 32-bit values
|
||||
._32x4 --- 4 32-bit values
|
||||
()
|
||||
|
||||
flag.BufferComputeType { bits = 16, shift = 4, range = 2, base = 1 }
|
||||
@ -232,7 +232,7 @@ flag.Buffer { bits = 16, base = 8 }
|
||||
.ComputeWrite --- Buffer will be used for writing.
|
||||
.DrawIndirect --- Buffer will be used for storing draw indirect commands.
|
||||
.AllowResize --- Allow dynamic index/vertex buffer resize during update.
|
||||
.Index32 { cname = "INDEX32" } --- Index buffer contains 32-bit indices.
|
||||
.Index32 --- Index buffer contains 32-bit indices.
|
||||
.ComputeReadWrite { "ComputeRead" , "ComputeWrite" }
|
||||
()
|
||||
|
||||
@ -313,10 +313,6 @@ flag.Sampler { bits = 32 }
|
||||
.BitsMask { "UMask", "VMask", "WMask", "MinMask", "MagMask", "MipMask", "CompareMask" }
|
||||
()
|
||||
|
||||
flag.ResetFullscreen { bits = 32, shift = 0, range = 1, base = 1 }
|
||||
.Fullscreen --- Not supported yet.
|
||||
()
|
||||
|
||||
flag.ResetMsaa { bits = 32, shift = 4, range = 3, base = 1 }
|
||||
.X2 --- Enable 2x MSAA.
|
||||
.X4 --- Enable 4x MSAA.
|
||||
@ -327,6 +323,7 @@ flag.ResetMsaa { bits = 32, shift = 4, range = 3, base = 1 }
|
||||
|
||||
flag.Reset { bits = 32 }
|
||||
.None (0) --- No reset flags.
|
||||
.Fullscreen (1) --- Not supported yet.
|
||||
.Vsync (8) --- Enable V-Sync.
|
||||
.Maxanisotropy (9) --- Turn on/off max anisotropy.
|
||||
.Capture (10) --- Begin screen capture.
|
||||
@ -339,6 +336,9 @@ flag.Reset { bits = 32 }
|
||||
.Suspend (20) --- Suspend rendering.
|
||||
()
|
||||
|
||||
flag.ResetFullscreen { bits = 32, shift = 0, range = 1, base = 1 }
|
||||
()
|
||||
|
||||
flag.ResetReserved { bits = 32, shift = 31, range = 1 , desc = "Internal" }
|
||||
|
||||
flag.Caps { bits = 64, base = 1, name = "Caps" }
|
||||
@ -352,15 +352,15 @@ flag.Caps { bits = 64, base = 1, name = "Caps" }
|
||||
.FramebufferRw --- Read/Write frame buffer attachments are supported.
|
||||
.GraphicsDebugger --- Graphics debugger is present.
|
||||
.Reserved
|
||||
.Hdr10 { cname = "HDR10" } --- HDR10 rendering is supported.
|
||||
.Hdr10 --- HDR10 rendering is supported.
|
||||
.Hidpi --- HiDPI rendering is supported.
|
||||
.Index32 { cname = "INDEX32" } --- 32-bit indices are supported.
|
||||
.Index32 --- 32-bit indices are supported.
|
||||
.Instancing --- Instancing is supported.
|
||||
.OcclusionQuery --- Occlusion query is supported.
|
||||
.RendererMultithreaded --- Renderer is on separate thread.
|
||||
.SwapChain --- Multiple windows are supported.
|
||||
.Texture2dArray --- 2D texture array is supported.
|
||||
.Texture3d --- 3D textures are supported.
|
||||
.Texture_2dArray --- 2D texture array is supported.
|
||||
.Texture_3d --- 3D textures are supported.
|
||||
.TextureBlit --- Texture blit is supported.
|
||||
.TextureCompareReserved --- All texture compare modes are supported.
|
||||
.TextureCompareLequal --- Texture compare less equal mode is supported.
|
||||
@ -368,19 +368,19 @@ flag.Caps { bits = 64, base = 1, name = "Caps" }
|
||||
.TextureDirectAccess --- CPU direct access to GPU texture memory.
|
||||
.TextureReadBack --- Read-back texture is supported.
|
||||
.VertexAttribHalf --- Vertex attribute half-float is supported.
|
||||
.VertexAttribUint10 { cname = "VERTEX_ATTRIB_UINT10" } --- Vertex attribute 10_10_10_2 is supported.
|
||||
.VertexAttribUint10 --- Vertex attribute 10_10_10_2 is supported.
|
||||
.VertexId --- Rendering with VertexID only is supported.
|
||||
.TextureCompareAll { "TextureCompareReserved", "TextureCompareLequal" } --- All texture compare modes are supported.
|
||||
()
|
||||
|
||||
flag.CapsFormat { bits = 16 }
|
||||
.TextureNone --- Texture format is not supported.
|
||||
.Texture2d --- Texture format is supported.
|
||||
.Texture2dSrgb --- Texture as sRGB format is supported.
|
||||
.Texture2dEmulated --- Texture format is emulated.
|
||||
.Texture3d --- Texture format is supported.
|
||||
.Texture3dSrgb --- Texture as sRGB format is supported.
|
||||
.Texture3dEmulated --- Texture format is emulated.
|
||||
.Texture_2d --- Texture format is supported.
|
||||
.Texture_2dSrgb --- Texture as sRGB format is supported.
|
||||
.Texture_2dEmulated --- Texture format is emulated.
|
||||
.Texture_3d --- Texture format is supported.
|
||||
.Texture_3dSrgb --- Texture as sRGB format is supported.
|
||||
.Texture_3dEmulated --- Texture format is emulated.
|
||||
.TextureCube --- Texture format is supported.
|
||||
.TextureCubeSrgb --- Texture as sRGB format is supported.
|
||||
.TextureCubeEmulated --- Texture format is emulated.
|
||||
|
@ -18,6 +18,17 @@ local function camelcase_to_underscorecase(name)
|
||||
return table.concat(tmp, "_")
|
||||
end
|
||||
|
||||
local function to_underscorecase(name)
|
||||
local tmp = {}
|
||||
for v in name:gmatch "[_%u][%l%d]*" do
|
||||
if v:byte() == 95 then -- '_'
|
||||
v = v:sub(2) -- remove _
|
||||
end
|
||||
tmp[#tmp+1] = v
|
||||
end
|
||||
return table.concat(tmp, "_")
|
||||
end
|
||||
|
||||
local function underscorecase_to_camelcase(name)
|
||||
local tmp = {}
|
||||
for v in name:gmatch "[^_]+" do
|
||||
@ -217,13 +228,11 @@ function codegen.nameconversion(all_types, all_funcs)
|
||||
if cname == nil then
|
||||
if name:match "^%u" then
|
||||
cname = camelcase_to_underscorecase(name)
|
||||
else
|
||||
elseif not v.flag then
|
||||
v.cname = name
|
||||
end
|
||||
end
|
||||
if v.flag then
|
||||
v.cname = "BGFX_" .. cname:upper()
|
||||
elseif cname then
|
||||
if cname and not v.flag then
|
||||
if v.namespace then
|
||||
cname = camelcase_to_underscorecase(v.namespace) .. "_" .. cname
|
||||
end
|
||||
@ -673,6 +682,7 @@ end
|
||||
function codegen.gen_flag_cdefine(flag)
|
||||
assert(type(flag.flag) == "table", "Not a flag")
|
||||
flag_format(flag)
|
||||
local cname = "BGFX_" .. (flag.cname or to_underscorecase(flag.name):upper())
|
||||
local s = {}
|
||||
local shift = flag.shift
|
||||
local base = flag.base or 0
|
||||
@ -680,9 +690,9 @@ function codegen.gen_flag_cdefine(flag)
|
||||
for index, item in ipairs(flag.flag) do
|
||||
local name
|
||||
if item.cname then
|
||||
name = flag.cname .. "_" .. item.cname
|
||||
name = cname .. "_" .. item.cname
|
||||
else
|
||||
name = flag.cname .. "_" .. camelcase_to_underscorecase(item.name):upper()
|
||||
name = cname .. "_" .. to_underscorecase(item.name):upper()
|
||||
end
|
||||
local value = item.value
|
||||
if flag.const then
|
||||
@ -726,7 +736,7 @@ function codegen.gen_flag_cdefine(flag)
|
||||
end
|
||||
local sets = { "" }
|
||||
for _, v in ipairs(item) do
|
||||
sets[#sets+1] = flag.cname .. "_" .. camelcase_to_underscorecase(v):upper()
|
||||
sets[#sets+1] = cname .. "_" .. to_underscorecase(v):upper()
|
||||
end
|
||||
s[#s+1] = string.format("#define %s (0%s \\\n\t)\n", name, table.concat(sets, " \\\n\t| "))
|
||||
else
|
||||
@ -752,7 +762,7 @@ function codegen.gen_flag_cdefine(flag)
|
||||
end
|
||||
|
||||
if shift then
|
||||
local name = flag.cname .. "_SHIFT"
|
||||
local name = cname .. "_SHIFT"
|
||||
local comment = flag.desc or ""
|
||||
local shift_align = tostring(shift)
|
||||
shift_align = shift_align .. namealign(shift_align, #mask)
|
||||
@ -764,7 +774,7 @@ function codegen.gen_flag_cdefine(flag)
|
||||
s[#s+1] = code
|
||||
end
|
||||
if flag.range then
|
||||
local name = flag.cname .. "_MASK"
|
||||
local name = cname .. "_MASK"
|
||||
local comment = ""
|
||||
if flag.desc then
|
||||
comment = string.format(" //!< %s bit mask", flag.desc)
|
||||
@ -776,10 +786,10 @@ function codegen.gen_flag_cdefine(flag)
|
||||
if flag.helper then
|
||||
s[#s+1] = string.format(
|
||||
"#define %s(v) ( ( (uint%d_t)(v)<<%s )&%s)",
|
||||
flag.cname,
|
||||
cname,
|
||||
flag.bits,
|
||||
(flag.cname .. "_SHIFT"),
|
||||
(flag.cname .. "_MASK"))
|
||||
(cname .. "_SHIFT"),
|
||||
(cname .. "_MASK"))
|
||||
end
|
||||
|
||||
s[#s+1] = ""
|
||||
|
@ -64,7 +64,7 @@ newaction {
|
||||
|
||||
generate("temp.bgfx.h" , "../include/bgfx/c99/bgfx.h", " ")
|
||||
generate("temp.bgfx.idl.inl", "../src/bgfx.idl.inl", "\t")
|
||||
-- generate("temp.defines.h", "../include/bgfx/defines.h", "\t")
|
||||
generate("temp.defines.h", "../include/bgfx/defines.h", "\t")
|
||||
|
||||
os.exit()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user