diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index ae53700e8..570cf4a45 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -21,11 +21,11 @@ * 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. +#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 \ @@ -45,81 +45,81 @@ * 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 +#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 +#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 /** * 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 +#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 +#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 /** * 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_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)<