mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 12:42:34 +01:00
Cleanup.
This commit is contained in:
@@ -120,7 +120,7 @@ static const uint64_t s_ptState[]
|
||||
BGFX_STATE_PT_LINESTRIP,
|
||||
BGFX_STATE_PT_POINTS,
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
|
||||
static_assert(BX_COUNTOF(s_ptState) == BX_COUNTOF(s_ptNames) );
|
||||
|
||||
class ExampleCubes : public entry::AppI
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ static PosTexcoordVertex s_cubeVertices[] =
|
||||
{-1.0f, -1.0f, 1.0f, -2.0f, -2.0f, 2.0f },
|
||||
{ 1.0f, -1.0f, 1.0f, 2.0f, -2.0f, 2.0f },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeVertices) == 28);
|
||||
static_assert(BX_COUNTOF(s_cubeVertices) == 28);
|
||||
|
||||
static const uint16_t s_cubeIndices[] =
|
||||
{
|
||||
@@ -99,7 +99,7 @@ static const uint16_t s_cubeIndices[] =
|
||||
20, 22, 21, // 10
|
||||
21, 22, 23,
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_cubeIndices) == 36);
|
||||
static_assert(BX_COUNTOF(s_cubeIndices) == 36);
|
||||
|
||||
bx::Vec3 s_faceColors[] =
|
||||
{
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
m_textures[22] = loadTextureWithUpdate("textures/texture_compression_atci.dds");
|
||||
m_textures[23] = loadTextureWithUpdate("textures/texture_compression_atce.dds");
|
||||
|
||||
BX_STATIC_ASSERT(24 == BX_COUNTOF(m_textures));
|
||||
static_assert(24 == BX_COUNTOF(m_textures));
|
||||
|
||||
const bgfx::Caps* caps = bgfx::getCaps();
|
||||
m_texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D);
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
"compute",
|
||||
"frameBuffer",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
|
||||
static_assert(BX_COUNTOF(descTextureCube) == BX_COUNTOF(m_textureCube));
|
||||
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCube); ++ii)
|
||||
{
|
||||
@@ -847,7 +847,7 @@ public:
|
||||
"update\natci",
|
||||
"update\natce",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
|
||||
static_assert(BX_COUNTOF(descTextures) == BX_COUNTOF(m_textures));
|
||||
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
|
||||
{
|
||||
@@ -878,7 +878,7 @@ public:
|
||||
"Tex3D R16F",
|
||||
"Tex3D R32F",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
|
||||
static_assert(BX_COUNTOF(descTextures3d) == BX_COUNTOF(m_textures3d));
|
||||
|
||||
for (uint32_t ii = 0; ii < m_numTextures3d; ++ii)
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ static const char* s_easeFuncName[] =
|
||||
"InOutBounce",
|
||||
"OutInBounce",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
|
||||
static_assert(BX_COUNTOF(s_easeFuncName) == bx::Easing::Count);
|
||||
|
||||
struct Emitter
|
||||
{
|
||||
|
||||
@@ -527,7 +527,7 @@ public:
|
||||
m_temporaryColor.m_buffer,
|
||||
m_currentColor.m_buffer,
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
|
||||
static_assert(BX_COUNTOF(destBuffer) == DENOISE_MAX_PASSES);
|
||||
|
||||
const uint32_t denoisePasses = bx::min(DENOISE_MAX_PASSES, m_denoisePasses);
|
||||
|
||||
|
||||
@@ -1505,7 +1505,7 @@ struct DebugDrawEncoderImpl
|
||||
}
|
||||
else
|
||||
{
|
||||
BX_STATIC_ASSERT(sizeof(DdVertex) == sizeof(bx::Vec3), "");
|
||||
static_assert(sizeof(DdVertex) == sizeof(bx::Vec3), "");
|
||||
|
||||
uint64_t old = attrib.m_state;
|
||||
attrib.m_state &= ~BGFX_STATE_CULL_MASK;
|
||||
@@ -2241,7 +2241,7 @@ struct DebugDrawEncoderImpl
|
||||
static const uint32_t kCacheSize = 1024;
|
||||
static const uint32_t kStackSize = 16;
|
||||
static const uint32_t kCacheQuadSize = 1024;
|
||||
BX_STATIC_ASSERT(kCacheSize >= 3, "Cache must be at least 3 elements.");
|
||||
static_assert(kCacheSize >= 3, "Cache must be at least 3 elements.");
|
||||
|
||||
DebugVertex m_cache[kCacheSize+1];
|
||||
DebugUvVertex m_cacheQuad[kCacheQuadSize];
|
||||
@@ -2281,7 +2281,7 @@ struct DebugDrawEncoderImpl
|
||||
};
|
||||
|
||||
static DebugDrawEncoderImpl s_dde;
|
||||
BX_STATIC_ASSERT(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
|
||||
static_assert(sizeof(DebugDrawEncoderImpl) <= sizeof(DebugDrawEncoder), "Size must match");
|
||||
|
||||
void ddInit(bx::AllocatorI* _allocator)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ s_getFileNameA[] =
|
||||
{ GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 },
|
||||
{ GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
|
||||
static_assert(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count);
|
||||
#endif
|
||||
|
||||
#if !BX_PLATFORM_OSX
|
||||
|
||||
@@ -185,7 +185,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
"GamepadStart",
|
||||
"GamepadGuide",
|
||||
};
|
||||
BX_STATIC_ASSERT(Key::Count == BX_COUNTOF(s_keyName) );
|
||||
static_assert(Key::Count == BX_COUNTOF(s_keyName) );
|
||||
|
||||
const char* getName(Key::Enum _key)
|
||||
{
|
||||
@@ -455,7 +455,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
|
||||
AppI::AppI(const char* _name, const char* _description, const char* _url)
|
||||
{
|
||||
BX_STATIC_ASSERT(sizeof(AppInternal) <= sizeof(m_internal) );
|
||||
static_assert(sizeof(AppInternal) <= sizeof(m_internal) );
|
||||
s_offset = BX_OFFSETOF(AppI, m_internal);
|
||||
|
||||
AppInternal* ai = (AppInternal*)m_internal;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace entry
|
||||
{ Key::GamepadUp, Key::GamepadDown },
|
||||
{ Key::None, Key::None },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
|
||||
static_assert(BX_COUNTOF(s_translateAxis) == BX_COUNTOF(s_axisDpad) );
|
||||
|
||||
struct Joystick
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \
|
||||
BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) )
|
||||
static_assert(_enum::Count == _enum::Enum(_c99enumcount) )
|
||||
|
||||
BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT);
|
||||
BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT);
|
||||
@@ -30,7 +30,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT);
|
||||
#undef BGFX_C99_ENUM_CHECK
|
||||
|
||||
#define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \
|
||||
BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) )
|
||||
static_assert(sizeof(_cppstruct) == sizeof(_c99struct) )
|
||||
|
||||
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t);
|
||||
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t);
|
||||
|
||||
28
src/bgfx.cpp
28
src/bgfx.cpp
@@ -330,7 +330,7 @@ namespace bgfx
|
||||
{ "VL", "VertexLayout" },
|
||||
{ "?", "?" },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_typeName) == Handle::Count+1, "");
|
||||
static_assert(BX_COUNTOF(s_typeName) == Handle::Count+1, "");
|
||||
|
||||
const Handle::TypeName& Handle::getTypeName(Handle::Enum _enum)
|
||||
{
|
||||
@@ -748,7 +748,7 @@ namespace bgfx
|
||||
0xff4fe9fc, // Yellow
|
||||
0xffeceeee, // White
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_paletteSrgb) == 16);
|
||||
static_assert(BX_COUNTOF(s_paletteSrgb) == 16);
|
||||
|
||||
static const uint32_t s_paletteLinear[] =
|
||||
{
|
||||
@@ -769,7 +769,7 @@ namespace bgfx
|
||||
0xff13cff8, // Yellow
|
||||
0xffd5dada // White
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_paletteLinear) == 16);
|
||||
static_assert(BX_COUNTOF(s_paletteLinear) == 16);
|
||||
|
||||
void blit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem& _mem)
|
||||
{
|
||||
@@ -948,7 +948,7 @@ namespace bgfx
|
||||
"mat3",
|
||||
"mat4",
|
||||
};
|
||||
BX_STATIC_ASSERT(UniformType::Count == BX_COUNTOF(s_uniformTypeName) );
|
||||
static_assert(UniformType::Count == BX_COUNTOF(s_uniformTypeName) );
|
||||
|
||||
const char* getUniformTypeName(UniformType::Enum _enum)
|
||||
{
|
||||
@@ -1824,7 +1824,7 @@ namespace bgfx
|
||||
"LineStrip",
|
||||
"Points",
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_topologyName) );
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_topologyName) );
|
||||
|
||||
const char* getName(Topology::Enum _topology)
|
||||
{
|
||||
@@ -2656,7 +2656,7 @@ namespace bgfx
|
||||
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL
|
||||
{ vk::rendererCreate, vk::rendererDestroy, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
|
||||
static_assert(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
|
||||
|
||||
bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build)
|
||||
{
|
||||
@@ -5612,7 +5612,7 @@ extern "C"
|
||||
#endif // BGFX_CONFIG_PREFER_DISCRETE_GPU
|
||||
|
||||
#define BGFX_TEXTURE_FORMAT_BIMG(_fmt) \
|
||||
BX_STATIC_ASSERT(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) )
|
||||
static_assert(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) )
|
||||
|
||||
BGFX_TEXTURE_FORMAT_BIMG(BC1);
|
||||
BGFX_TEXTURE_FORMAT_BIMG(BC2);
|
||||
@@ -5718,29 +5718,29 @@ BGFX_TEXTURE_FORMAT_BIMG(Count);
|
||||
|
||||
#define FLAGS_MASK_TEST(_flags, _mask) ( (_flags) == ( (_flags) & (_mask) ) )
|
||||
|
||||
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
|
||||
static_assert(FLAGS_MASK_TEST(0
|
||||
| BGFX_SAMPLER_INTERNAL_DEFAULT
|
||||
| BGFX_SAMPLER_INTERNAL_SHARED
|
||||
, BGFX_SAMPLER_RESERVED_MASK
|
||||
) );
|
||||
|
||||
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
|
||||
static_assert(FLAGS_MASK_TEST(0
|
||||
| BGFX_RESET_INTERNAL_FORCE
|
||||
, BGFX_RESET_RESERVED_MASK
|
||||
) );
|
||||
|
||||
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
|
||||
static_assert(FLAGS_MASK_TEST(0
|
||||
| BGFX_STATE_INTERNAL_SCISSOR
|
||||
| BGFX_STATE_INTERNAL_OCCLUSION_QUERY
|
||||
, BGFX_STATE_RESERVED_MASK
|
||||
) );
|
||||
|
||||
BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
|
||||
static_assert(FLAGS_MASK_TEST(0
|
||||
| BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE
|
||||
, BGFX_SUBMIT_INTERNAL_RESERVED_MASK
|
||||
) );
|
||||
|
||||
BX_STATIC_ASSERT( (0
|
||||
static_assert( (0
|
||||
| BGFX_STATE_ALPHA_REF_MASK
|
||||
| BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
|
||||
| BGFX_STATE_BLEND_EQUATION_MASK
|
||||
@@ -5774,9 +5774,9 @@ BX_STATIC_ASSERT( (0
|
||||
^ BGFX_STATE_WRITE_MASK
|
||||
) );
|
||||
|
||||
BX_STATIC_ASSERT(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) );
|
||||
static_assert(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) );
|
||||
|
||||
BX_STATIC_ASSERT( (0
|
||||
static_assert( (0
|
||||
| BGFX_CAPS_ALPHA_TO_COVERAGE
|
||||
| BGFX_CAPS_BLEND_INDEPENDENT
|
||||
| BGFX_CAPS_COMPUTE
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \
|
||||
BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) )
|
||||
static_assert(_enum::Count == _enum::Enum(_c99enumcount) )
|
||||
|
||||
BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT);
|
||||
BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT);
|
||||
@@ -30,7 +30,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT);
|
||||
#undef BGFX_C99_ENUM_CHECK
|
||||
|
||||
#define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \
|
||||
BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) )
|
||||
static_assert(sizeof(_cppstruct) == sizeof(_c99struct) )
|
||||
|
||||
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t);
|
||||
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t);
|
||||
|
||||
12
src/bgfx_p.h
12
src/bgfx_p.h
@@ -1089,9 +1089,9 @@ namespace bgfx
|
||||
constexpr uint8_t kSortKeyComputeProgramShift = kSortKeyComputeSeqShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
||||
constexpr uint64_t kSortKeyComputeProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyComputeProgramShift;
|
||||
|
||||
BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= (1<<kSortKeyViewNumBits) );
|
||||
BX_STATIC_ASSERT( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // Must be power of 2.
|
||||
BX_STATIC_ASSERT( (0 // Render key mask shouldn't overlap.
|
||||
static_assert(BGFX_CONFIG_MAX_VIEWS <= (1<<kSortKeyViewNumBits) );
|
||||
static_assert( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // Must be power of 2.
|
||||
static_assert( (0 // Render key mask shouldn't overlap.
|
||||
| kSortKeyViewMask
|
||||
| kSortKeyDrawBit
|
||||
| kSortKeyDrawTypeMask
|
||||
@@ -1106,7 +1106,7 @@ namespace bgfx
|
||||
^ kSortKeyDraw0ProgramMask
|
||||
^ kSortKeyDraw0DepthMask
|
||||
) );
|
||||
BX_STATIC_ASSERT( (0 // Render key mask shouldn't overlap.
|
||||
static_assert( (0 // Render key mask shouldn't overlap.
|
||||
| kSortKeyViewMask
|
||||
| kSortKeyDrawBit
|
||||
| kSortKeyDrawTypeMask
|
||||
@@ -1121,7 +1121,7 @@ namespace bgfx
|
||||
^ kSortKeyDraw1BlendMask
|
||||
^ kSortKeyDraw1ProgramMask
|
||||
) );
|
||||
BX_STATIC_ASSERT( (0 // Render key mask shouldn't overlap.
|
||||
static_assert( (0 // Render key mask shouldn't overlap.
|
||||
| kSortKeyViewMask
|
||||
| kSortKeyDrawBit
|
||||
| kSortKeyDrawTypeMask
|
||||
@@ -1136,7 +1136,7 @@ namespace bgfx
|
||||
^ kSortKeyDraw2BlendMask
|
||||
^ kSortKeyDraw2ProgramMask
|
||||
) );
|
||||
BX_STATIC_ASSERT( (0 // Compute key mask shouldn't overlap.
|
||||
static_assert( (0 // Compute key mask shouldn't overlap.
|
||||
| kSortKeyViewMask
|
||||
| kSortKeyDrawBit
|
||||
| kSortKeyComputeSeqShift
|
||||
|
||||
@@ -239,12 +239,12 @@
|
||||
|
||||
// Cannot be configured via compiler options.
|
||||
#define BGFX_CONFIG_MAX_PROGRAMS (1<<BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM)
|
||||
BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_PROGRAMS), "BGFX_CONFIG_MAX_PROGRAMS must be power of 2.");
|
||||
static_assert(bx::isPowerOf2(BGFX_CONFIG_MAX_PROGRAMS), "BGFX_CONFIG_MAX_PROGRAMS must be power of 2.");
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_VIEWS
|
||||
# define BGFX_CONFIG_MAX_VIEWS 256
|
||||
#endif // BGFX_CONFIG_MAX_VIEWS
|
||||
BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS must be power of 2.");
|
||||
static_assert(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS must be power of 2.");
|
||||
|
||||
#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 6
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace bgfx
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
;
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_colorSpaceStr) == kDxgiLastColorSpace+2, "Colorspace string table mismatch with DXGI_COLOR_SPACE_*.");
|
||||
static_assert(BX_COUNTOF(s_colorSpaceStr) == kDxgiLastColorSpace+2, "Colorspace string table mismatch with DXGI_COLOR_SPACE_*.");
|
||||
|
||||
static const GUID s_dxgiDeviceIIDs[] =
|
||||
{
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace bgfx { namespace gl
|
||||
}
|
||||
BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create context 0x%08x.", GetLastError() );
|
||||
|
||||
BX_STATIC_ASSERT(sizeof(contextAttrs) == sizeof(m_contextAttrs) );
|
||||
static_assert(sizeof(contextAttrs) == sizeof(m_contextAttrs) );
|
||||
bx::memCopy(m_contextAttrs, contextAttrs, sizeof(contextAttrs) );
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace bgfx { namespace d3d11
|
||||
{ D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, 1, 1, 0 },
|
||||
{ D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED, 0, 0, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
|
||||
union Zero
|
||||
{
|
||||
@@ -300,7 +300,7 @@ namespace bgfx { namespace d3d11
|
||||
{ DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F
|
||||
{ DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
static const D3D11_INPUT_ELEMENT_DESC s_attrib[] =
|
||||
{
|
||||
@@ -323,7 +323,7 @@ namespace bgfx { namespace d3d11
|
||||
{ "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib) );
|
||||
static_assert(Attrib::Count == BX_COUNTOF(s_attrib) );
|
||||
|
||||
static const DXGI_FORMAT s_attribType[][4][2] =
|
||||
{
|
||||
@@ -358,7 +358,7 @@ namespace bgfx { namespace d3d11
|
||||
{ DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||
},
|
||||
};
|
||||
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
|
||||
static D3D11_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D11_INPUT_ELEMENT_DESC* _out, const VertexLayout& _layout)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace bgfx { namespace d3d12
|
||||
{ D3D_PRIMITIVE_TOPOLOGY_POINTLIST, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 1, 1, 0 },
|
||||
{ D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED, 0, 0, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
|
||||
static const uint32_t s_checkMsaa[] =
|
||||
{
|
||||
@@ -296,7 +296,7 @@ namespace bgfx { namespace d3d12
|
||||
#undef $B
|
||||
#undef $A
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
static const D3D12_INPUT_ELEMENT_DESC s_attrib[] =
|
||||
{
|
||||
@@ -319,7 +319,7 @@ namespace bgfx { namespace d3d12
|
||||
{ "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib) );
|
||||
static_assert(Attrib::Count == BX_COUNTOF(s_attrib) );
|
||||
|
||||
static const DXGI_FORMAT s_attribType[][4][2] =
|
||||
{
|
||||
@@ -354,7 +354,7 @@ namespace bgfx { namespace d3d12
|
||||
{ DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||
},
|
||||
};
|
||||
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
|
||||
static D3D12_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D12_INPUT_ELEMENT_DESC* _out, const VertexLayout& _layout)
|
||||
{
|
||||
@@ -470,7 +470,7 @@ namespace bgfx { namespace d3d12
|
||||
{ { D3D12_HEAP_TYPE_UPLOAD, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 }, D3D12_RESOURCE_STATE_GENERIC_READ },
|
||||
{ { D3D12_HEAP_TYPE_READBACK, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 }, D3D12_RESOURCE_STATE_COPY_DEST },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_heapProperties) == HeapProperty::Count);
|
||||
static_assert(BX_COUNTOF(s_heapProperties) == HeapProperty::Count);
|
||||
|
||||
static inline D3D12_HEAP_PROPERTIES ID3D12DeviceGetCustomHeapProperties(ID3D12Device *device, uint32_t nodeMask, D3D12_HEAP_TYPE heapType)
|
||||
{
|
||||
@@ -1308,7 +1308,7 @@ namespace bgfx { namespace d3d12
|
||||
{ D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
|
||||
{ D3D12_DESCRIPTOR_RANGE_TYPE_UAV, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(descRange) == Rdt::Count);
|
||||
static_assert(BX_COUNTOF(descRange) == Rdt::Count);
|
||||
|
||||
D3D12_ROOT_PARAMETER rootParameter[] =
|
||||
{
|
||||
@@ -2510,9 +2510,9 @@ namespace bgfx { namespace d3d12
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
uint32_t nodeMask[] = { 1, 1, 1, 1 };
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(nodeMask) );
|
||||
static_assert(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(nodeMask) );
|
||||
IUnknown* presentQueue[] ={ m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue };
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(presentQueue) );
|
||||
static_assert(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(presentQueue) );
|
||||
DX_CHECK(m_dxgi.resizeBuffers(m_swapChain, m_scd, nodeMask, presentQueue) );
|
||||
#elif BX_PLATFORM_WINRT
|
||||
DX_CHECK(m_dxgi.resizeBuffers(m_swapChain, m_scd));
|
||||
@@ -4453,7 +4453,7 @@ namespace bgfx { namespace d3d12
|
||||
sizeof(BatchD3D12::DrawIndirectCommand),
|
||||
sizeof(BatchD3D12::DrawIndexedIndirectCommand),
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_indirectCommandSize) == BatchD3D12::Count);
|
||||
static_assert(BX_COUNTOF(s_indirectCommandSize) == BatchD3D12::Count);
|
||||
|
||||
void BatchD3D12::flush(ID3D12GraphicsCommandList* _commandList, Enum _type)
|
||||
{
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace bgfx { namespace d3d12
|
||||
, m_completedFence(0)
|
||||
, m_control(BX_COUNTOF(m_commandList) )
|
||||
{
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) );
|
||||
static_assert(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) );
|
||||
}
|
||||
|
||||
void init(ID3D12Device* _device);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace bgfx { namespace gl
|
||||
{ GL_POINTS, 1, 1, 0 },
|
||||
{ GL_ZERO, 0, 0, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
|
||||
static const char* s_attribName[] =
|
||||
{
|
||||
@@ -63,7 +63,7 @@ namespace bgfx { namespace gl
|
||||
"a_texcoord6",
|
||||
"a_texcoord7",
|
||||
};
|
||||
BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
static_assert(Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
|
||||
static const char* s_instanceDataName[] =
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace bgfx { namespace gl
|
||||
"i_data3",
|
||||
"i_data4",
|
||||
};
|
||||
BX_STATIC_ASSERT(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
|
||||
static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
|
||||
|
||||
static const GLenum s_access[] =
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace bgfx { namespace gl
|
||||
GL_WRITE_ONLY,
|
||||
GL_READ_WRITE,
|
||||
};
|
||||
BX_STATIC_ASSERT(Access::Count == BX_COUNTOF(s_access) );
|
||||
static_assert(Access::Count == BX_COUNTOF(s_access) );
|
||||
|
||||
static const GLenum s_attribType[] =
|
||||
{
|
||||
@@ -91,7 +91,7 @@ namespace bgfx { namespace gl
|
||||
GL_HALF_FLOAT, // Half
|
||||
GL_FLOAT, // Float
|
||||
};
|
||||
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
|
||||
struct Blend
|
||||
{
|
||||
@@ -320,7 +320,7 @@ namespace bgfx { namespace gl
|
||||
#undef $B
|
||||
#undef $A
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
static bool s_textureFilter[TextureFormat::Count+1];
|
||||
|
||||
@@ -423,7 +423,7 @@ namespace bgfx { namespace gl
|
||||
GL_DEPTH_COMPONENT32F, // D32F
|
||||
GL_STENCIL_INDEX8, // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_rboFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_rboFormat) );
|
||||
|
||||
static GLenum s_imageFormat[] =
|
||||
{
|
||||
@@ -524,7 +524,7 @@ namespace bgfx { namespace gl
|
||||
GL_ZERO, // D32F
|
||||
GL_ZERO, // D0S8
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_imageFormat) );
|
||||
|
||||
struct Extension
|
||||
{
|
||||
@@ -936,7 +936,7 @@ namespace bgfx { namespace gl
|
||||
{ "WEBKIT_WEBGL_compressed_texture_s3tc", false, true },
|
||||
{ "WEBKIT_WEBGL_depth_texture", false, true },
|
||||
};
|
||||
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
|
||||
static_assert(Extension::Count == BX_COUNTOF(s_extension) );
|
||||
|
||||
static const char* s_ARB_shader_texture_lod[] =
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace bgfx { namespace mtl
|
||||
{ MTLPrimitiveTypeLineStrip, 2, 1, 1 },
|
||||
{ MTLPrimitiveTypePoint, 1, 1, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo) );
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_primInfo) );
|
||||
|
||||
static const char* s_attribName[] =
|
||||
{
|
||||
@@ -70,7 +70,7 @@ namespace bgfx { namespace mtl
|
||||
"a_texcoord6",
|
||||
"a_texcoord7",
|
||||
};
|
||||
BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
static_assert(Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
|
||||
static const char* s_instanceDataName[] =
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace bgfx { namespace mtl
|
||||
"i_data3",
|
||||
"i_data4",
|
||||
};
|
||||
BX_STATIC_ASSERT(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
|
||||
static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
|
||||
|
||||
static const MTLVertexFormat s_attribType[][4][2] = //type, count, normalized
|
||||
{
|
||||
@@ -125,7 +125,7 @@ namespace bgfx { namespace mtl
|
||||
{ MTLVertexFormatFloat4, MTLVertexFormatFloat4 },
|
||||
},
|
||||
};
|
||||
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
|
||||
static const MTLCullMode s_cullMode[] =
|
||||
{
|
||||
@@ -348,7 +348,7 @@ namespace bgfx { namespace mtl
|
||||
#undef $A
|
||||
};
|
||||
BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
int32_t s_msaa[] =
|
||||
{
|
||||
@@ -425,7 +425,7 @@ static const char* s_accessNames[] = {
|
||||
"Access::Write",
|
||||
"Access::ReadWrite",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames count");
|
||||
static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames count");
|
||||
|
||||
#ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
|
||||
# define __IPHONE_OS_VERSION_MAX_ALLOWED 0
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace bgfx { namespace vk
|
||||
{ VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 1, 1, 0 },
|
||||
{ VK_PRIMITIVE_TOPOLOGY_MAX_ENUM, 0, 0, 0 },
|
||||
};
|
||||
BX_STATIC_ASSERT(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
static_assert(Topology::Count == BX_COUNTOF(s_primInfo)-1);
|
||||
|
||||
static MsaaSamplerVK s_msaa[] =
|
||||
{
|
||||
@@ -271,7 +271,7 @@ VK_IMPORT_DEVICE
|
||||
#undef $B
|
||||
#undef $A
|
||||
};
|
||||
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
static_assert(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
|
||||
|
||||
struct ImageTest
|
||||
{
|
||||
@@ -322,7 +322,7 @@ VK_IMPORT_DEVICE
|
||||
{ "VK_LAYER_LUNARG_standard_validation", 1, { false, false }, { false, false } },
|
||||
{ "", 0, { false, false }, { false, false } },
|
||||
};
|
||||
BX_STATIC_ASSERT(Layer::Count == BX_COUNTOF(s_layer)-1);
|
||||
static_assert(Layer::Count == BX_COUNTOF(s_layer)-1);
|
||||
|
||||
void updateLayer(const char* _name, uint32_t _version, bool _instanceLayer)
|
||||
{
|
||||
@@ -414,7 +414,7 @@ VK_IMPORT_DEVICE
|
||||
{ VK_NN_VI_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
|
||||
# endif
|
||||
};
|
||||
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
|
||||
static_assert(Extension::Count == BX_COUNTOF(s_extension) );
|
||||
|
||||
bool updateExtension(const char* _name, uint32_t _version, bool _instanceExt, Extension _extensions[Extension::Count])
|
||||
{
|
||||
@@ -482,7 +482,7 @@ VK_IMPORT_DEVICE
|
||||
{ VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT },
|
||||
},
|
||||
};
|
||||
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
|
||||
|
||||
void fillVertexLayout(const ShaderVK* _vsh, VkPipelineVertexInputStateCreateInfo& _vertexInputState, const VertexLayout& _layout)
|
||||
{
|
||||
@@ -571,7 +571,7 @@ VK_IMPORT_DEVICE
|
||||
"vkDevice",
|
||||
"vkInstance",
|
||||
};
|
||||
BX_STATIC_ASSERT(VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE == BX_COUNTOF(s_allocScopeName)-1);
|
||||
static_assert(VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE == BX_COUNTOF(s_allocScopeName)-1);
|
||||
|
||||
constexpr size_t kMinAlignment = 16;
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace bgfx { namespace vk
|
||||
::Vk##_name* operator &() { return &vk; } \
|
||||
const ::Vk##_name* operator &() const { return &vk; } \
|
||||
}; \
|
||||
BX_STATIC_ASSERT(sizeof(::Vk##_name) == sizeof(Vk##_name) ); \
|
||||
static_assert(sizeof(::Vk##_name) == sizeof(Vk##_name) ); \
|
||||
void vkDestroy(Vk##_name&); \
|
||||
void release(Vk##_name&)
|
||||
VK_DESTROY
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace bgfx
|
||||
{ DescriptorType::StorageBuffer, 0x0007 },
|
||||
{ DescriptorType::StorageImage, 0x0003 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_descriptorTypeToId) == DescriptorType::Count);
|
||||
static_assert(BX_COUNTOF(s_descriptorTypeToId) == DescriptorType::Count);
|
||||
|
||||
DescriptorType::Enum idToDescriptorType(uint16_t _id)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace bgfx
|
||||
{ TextureComponentType::Depth, 0x03 },
|
||||
{ TextureComponentType::UnfilterableFloat, 0x04 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_textureComponentTypeToId) == TextureComponentType::Count);
|
||||
static_assert(BX_COUNTOF(s_textureComponentTypeToId) == TextureComponentType::Count);
|
||||
|
||||
TextureComponentType::Enum idToTextureComponentType(uint8_t _id)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ namespace bgfx
|
||||
{ TextureDimension::DimensionCubeArray, 0x05 },
|
||||
{ TextureDimension::Dimension3D, 0x06 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_textureDimensionToId) == TextureDimension::Count);
|
||||
static_assert(BX_COUNTOF(s_textureDimensionToId) == TextureDimension::Count);
|
||||
|
||||
TextureDimension::Enum idToTextureDimension(uint8_t _id)
|
||||
{
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace bgfx
|
||||
{ 0, 0 }, // ITOD
|
||||
{ 0, 0 }, // UTOD
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcodeInfo) == DxbcOpcode::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcOpcodeInfo) == DxbcOpcode::Count);
|
||||
|
||||
static const char* s_dxbcOpcode[] =
|
||||
{
|
||||
@@ -464,7 +464,7 @@ namespace bgfx
|
||||
"itod",
|
||||
"utod",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcode) == DxbcOpcode::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcOpcode) == DxbcOpcode::Count);
|
||||
|
||||
const char* getName(DxbcOpcode::Enum _opcode)
|
||||
{
|
||||
@@ -488,7 +488,7 @@ namespace bgfx
|
||||
"RawBuffer", // RawBuffer
|
||||
"StructuredBuffer", // StructuredBuffer
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count);
|
||||
|
||||
const char* s_dxbcInterpolationName[] =
|
||||
{
|
||||
@@ -501,7 +501,7 @@ namespace bgfx
|
||||
"linear sample",
|
||||
"linear noperspective sample",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count);
|
||||
|
||||
const char *s_dxbcPrimitiveTopologyName[] =
|
||||
{
|
||||
@@ -520,7 +520,7 @@ namespace bgfx
|
||||
"TriangleListAdj",
|
||||
"TriangleStripAdj",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveTopologyName) == DxbcPrimitiveTopology::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcPrimitiveTopologyName) == DxbcPrimitiveTopology::Count);
|
||||
|
||||
const char *s_dxbcPrimitiveName[] = {
|
||||
"",
|
||||
@@ -564,7 +564,7 @@ namespace bgfx
|
||||
"_31ControlPointPatch",
|
||||
"_32ControlPointPatch",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveName) == DxbcPrimitive::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcPrimitiveName) == DxbcPrimitive::Count);
|
||||
|
||||
// mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/shortfiles.txt
|
||||
static const char* s_dxbcOperandType[] =
|
||||
@@ -611,7 +611,7 @@ namespace bgfx
|
||||
"oDepthLE", // OutputDepthLessEqual
|
||||
"vCycleCounter", // CycleCounter
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOperandType) == DxbcOperandType::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcOperandType) == DxbcOperandType::Count);
|
||||
|
||||
static const char* s_dxbcCustomDataClass[] =
|
||||
{
|
||||
@@ -622,7 +622,7 @@ namespace bgfx
|
||||
"ShaderMessage",
|
||||
"ClipPlaneConstantMappingsForDx9",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcCustomDataClass) == DxbcCustomDataClass::Count);
|
||||
static_assert(BX_COUNTOF(s_dxbcCustomDataClass) == DxbcCustomDataClass::Count);
|
||||
|
||||
#define DXBC_MAX_NAME_STRING 512
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace bgfx
|
||||
{ false, false, /* AtomicFlagClear, // 319 */ SPV_OPERAND(_) },
|
||||
{ true, true, /* ImageSparseRead, // 320 */ SPV_OPERAND(_) },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_spvOpcodeInfo) == SpvOpcode::Count);
|
||||
static_assert(BX_COUNTOF(s_spvOpcodeInfo) == SpvOpcode::Count);
|
||||
|
||||
const char* s_spvOpcode[] =
|
||||
{
|
||||
@@ -686,7 +686,7 @@ namespace bgfx
|
||||
"ImageSparseRead",
|
||||
"",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_spvOpcode)-1 == SpvOpcode::Count);
|
||||
static_assert(BX_COUNTOF(s_spvOpcode)-1 == SpvOpcode::Count);
|
||||
|
||||
const char* getName(SpvOpcode::Enum _opcode)
|
||||
{
|
||||
@@ -800,7 +800,7 @@ namespace bgfx
|
||||
"Alignment",
|
||||
""
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_spvDecoration)-1 == SpvDecoration::Count);
|
||||
static_assert(BX_COUNTOF(s_spvDecoration)-1 == SpvDecoration::Count);
|
||||
|
||||
const char* getName(SpvDecoration::Enum _enum)
|
||||
{
|
||||
@@ -831,7 +831,7 @@ namespace bgfx
|
||||
"Image",
|
||||
""
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_spvStorageClass)-1 == SpvStorageClass::Count);
|
||||
static_assert(BX_COUNTOF(s_spvStorageClass)-1 == SpvStorageClass::Count);
|
||||
|
||||
const char* getName(SpvStorageClass::Enum _enum)
|
||||
{
|
||||
@@ -887,7 +887,7 @@ namespace bgfx
|
||||
"InstanceIndex",
|
||||
"",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_spvBuiltin)-1 == SpvBuiltin::Count);
|
||||
static_assert(BX_COUNTOF(s_spvBuiltin)-1 == SpvBuiltin::Count);
|
||||
|
||||
const char* getName(SpvBuiltin::Enum _enum)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace bgfx
|
||||
&s_attribTypeSizeD3D1x, // Vulkan
|
||||
&s_attribTypeSizeD3D1x, // Count
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1);
|
||||
static_assert(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1);
|
||||
|
||||
void initAttribTypeSizeTable(RendererType::Enum _type)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ namespace bgfx
|
||||
true, // Half
|
||||
true, // Float
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count);
|
||||
static_assert(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count);
|
||||
|
||||
bool isFloat(AttribType::Enum _type)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace bgfx
|
||||
"T6", "Attrib::TexCoord6",
|
||||
"T7", "Attrib::TexCoord7",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attrName) == Attrib::Count*2);
|
||||
static_assert(BX_COUNTOF(s_attrName) == Attrib::Count*2);
|
||||
|
||||
const char* getAttribNameShort(Attrib::Enum _attr)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ namespace bgfx
|
||||
{ Attrib::TexCoord6, 0x0016 },
|
||||
{ Attrib::TexCoord7, 0x0017 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribToId) == Attrib::Count);
|
||||
static_assert(BX_COUNTOF(s_attribToId) == Attrib::Count);
|
||||
|
||||
Attrib::Enum idToAttrib(uint16_t id)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ namespace bgfx
|
||||
{ AttribType::Half, 0x0003 },
|
||||
{ AttribType::Float, 0x0004 },
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeToId) == AttribType::Count);
|
||||
static_assert(BX_COUNTOF(s_attribTypeToId) == AttribType::Count);
|
||||
|
||||
AttribType::Enum idToAttribType(uint16_t id)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ static const char* s_attribShortNames[] =
|
||||
"TC6", // TexCoord6
|
||||
"TC7", // TexCoord7
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribShortNames) == bgfx::Attrib::Count);
|
||||
static_assert(BX_COUNTOF(s_attribShortNames) == bgfx::Attrib::Count);
|
||||
|
||||
|
||||
static const char* s_supportedExt[] =
|
||||
@@ -150,7 +150,7 @@ static const char* s_bindingName[] =
|
||||
"Help",
|
||||
"About",
|
||||
};
|
||||
BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_bindingName) );
|
||||
static_assert(Binding::Count == BX_COUNTOF(s_bindingName) );
|
||||
|
||||
static const InputBinding* s_binding[] =
|
||||
{
|
||||
@@ -159,7 +159,7 @@ static const InputBinding* s_binding[] =
|
||||
s_bindingHelp,
|
||||
s_bindingAbout,
|
||||
};
|
||||
BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_binding) );
|
||||
static_assert(Binding::Count == BX_COUNTOF(s_binding) );
|
||||
|
||||
static const char* s_filter = ""
|
||||
"Bgfx geometry (bin) | *.bin\n"
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace bgfx
|
||||
|
||||
"Unknown?!"
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_shadingLangName) == ShadingLang::Count+1, "ShadingLang::Enum and s_shadingLangName mismatch");
|
||||
static_assert(BX_COUNTOF(s_shadingLangName) == ShadingLang::Count+1, "ShadingLang::Enum and s_shadingLangName mismatch");
|
||||
|
||||
const char* getName(ShadingLang::Enum _lang)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ namespace bgfx
|
||||
"mat3", "float3x3",
|
||||
"mat4", "float4x4",
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_uniformTypeName) == UniformType::Count*2);
|
||||
static_assert(BX_COUNTOF(s_uniformTypeName) == UniformType::Count*2);
|
||||
|
||||
static const char* s_allowedVertexShaderInputs[] =
|
||||
{
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace bgfx { namespace metal
|
||||
"a_texcoord6",
|
||||
"a_texcoord7",
|
||||
};
|
||||
BX_STATIC_ASSERT(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
|
||||
bgfx::Attrib::Enum toAttribEnum(const bx::StringView& _name)
|
||||
{
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace bgfx { namespace spirv
|
||||
"a_texcoord6",
|
||||
"a_texcoord7",
|
||||
};
|
||||
BX_STATIC_ASSERT(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
|
||||
|
||||
bgfx::Attrib::Enum toAttribEnum(const bx::StringView& _name)
|
||||
{
|
||||
|
||||
@@ -219,7 +219,7 @@ static const char* s_bindingName[] =
|
||||
"Help",
|
||||
"About",
|
||||
};
|
||||
BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_bindingName) );
|
||||
static_assert(Binding::Count == BX_COUNTOF(s_bindingName) );
|
||||
|
||||
static const InputBinding* s_binding[] =
|
||||
{
|
||||
@@ -228,7 +228,7 @@ static const InputBinding* s_binding[] =
|
||||
s_bindingHelp,
|
||||
s_bindingAbout,
|
||||
};
|
||||
BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_binding) );
|
||||
static_assert(Binding::Count == BX_COUNTOF(s_binding) );
|
||||
|
||||
static const char* s_filter = ""
|
||||
"All Image Formats (bmp, dds, exr, gif, gnf, jpg, jpeg, hdr, ktx, pgm, png, ppm, psd, pvr, tga) | *.bmp *.dds *.exr *.gif *.gnf *.jpg *.jpeg *.hdr *.ktx *.pgm *.png *.ppm *.psd *.pvr *.tga\n"
|
||||
|
||||
Reference in New Issue
Block a user