From 5e39e3b16a23ddb3536c42ede9391a809203ca74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 16 Oct 2014 19:54:29 -0700 Subject: [PATCH] clang on VS201x. --- 3rdparty/renderdoc/renderdoc_app.h | 2 +- examples/common/entry/entry_windows.cpp | 72 ++++++++++++------------- src/renderer_d3d11.cpp | 22 ++++---- src/renderer_d3d9.cpp | 2 + 4 files changed, 48 insertions(+), 50 deletions(-) diff --git a/3rdparty/renderdoc/renderdoc_app.h b/3rdparty/renderdoc/renderdoc_app.h index 4c5a33df..c1243077 100644 --- a/3rdparty/renderdoc/renderdoc_app.h +++ b/3rdparty/renderdoc/renderdoc_app.h @@ -175,7 +175,7 @@ enum InAppOverlay eOverlay_CaptureList = 0x8, eOverlay_Default = (eOverlay_Enabled|eOverlay_FrameRate|eOverlay_FrameNumber|eOverlay_CaptureList), - eOverlay_All = ~0U, + eOverlay_All = INT32_MAX, eOverlay_None = 0, }; diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 0e1f3a44..1d8d51f2 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -142,42 +142,42 @@ namespace entry s_translateKey[VK_NUMPAD7] = Key::NumPad7; s_translateKey[VK_NUMPAD8] = Key::NumPad8; s_translateKey[VK_NUMPAD9] = Key::NumPad9; - s_translateKey['0'] = Key::Key0; - s_translateKey['1'] = Key::Key1; - s_translateKey['2'] = Key::Key2; - s_translateKey['3'] = Key::Key3; - s_translateKey['4'] = Key::Key4; - s_translateKey['5'] = Key::Key5; - s_translateKey['6'] = Key::Key6; - s_translateKey['7'] = Key::Key7; - s_translateKey['8'] = Key::Key8; - s_translateKey['9'] = Key::Key9; - s_translateKey['A'] = Key::KeyA; - s_translateKey['B'] = Key::KeyB; - s_translateKey['C'] = Key::KeyC; - s_translateKey['D'] = Key::KeyD; - s_translateKey['E'] = Key::KeyE; - s_translateKey['F'] = Key::KeyF; - s_translateKey['G'] = Key::KeyG; - s_translateKey['H'] = Key::KeyH; - s_translateKey['I'] = Key::KeyI; - s_translateKey['J'] = Key::KeyJ; - s_translateKey['K'] = Key::KeyK; - s_translateKey['L'] = Key::KeyL; - s_translateKey['M'] = Key::KeyM; - s_translateKey['N'] = Key::KeyN; - s_translateKey['O'] = Key::KeyO; - s_translateKey['P'] = Key::KeyP; - s_translateKey['Q'] = Key::KeyQ; - s_translateKey['R'] = Key::KeyR; - s_translateKey['S'] = Key::KeyS; - s_translateKey['T'] = Key::KeyT; - s_translateKey['U'] = Key::KeyU; - s_translateKey['V'] = Key::KeyV; - s_translateKey['W'] = Key::KeyW; - s_translateKey['X'] = Key::KeyX; - s_translateKey['Y'] = Key::KeyY; - s_translateKey['Z'] = Key::KeyZ; + s_translateKey[uint8_t('0')] = Key::Key0; + s_translateKey[uint8_t('1')] = Key::Key1; + s_translateKey[uint8_t('2')] = Key::Key2; + s_translateKey[uint8_t('3')] = Key::Key3; + s_translateKey[uint8_t('4')] = Key::Key4; + s_translateKey[uint8_t('5')] = Key::Key5; + s_translateKey[uint8_t('6')] = Key::Key6; + s_translateKey[uint8_t('7')] = Key::Key7; + s_translateKey[uint8_t('8')] = Key::Key8; + s_translateKey[uint8_t('9')] = Key::Key9; + s_translateKey[uint8_t('A')] = Key::KeyA; + s_translateKey[uint8_t('B')] = Key::KeyB; + s_translateKey[uint8_t('C')] = Key::KeyC; + s_translateKey[uint8_t('D')] = Key::KeyD; + s_translateKey[uint8_t('E')] = Key::KeyE; + s_translateKey[uint8_t('F')] = Key::KeyF; + s_translateKey[uint8_t('G')] = Key::KeyG; + s_translateKey[uint8_t('H')] = Key::KeyH; + s_translateKey[uint8_t('I')] = Key::KeyI; + s_translateKey[uint8_t('J')] = Key::KeyJ; + s_translateKey[uint8_t('K')] = Key::KeyK; + s_translateKey[uint8_t('L')] = Key::KeyL; + s_translateKey[uint8_t('M')] = Key::KeyM; + s_translateKey[uint8_t('N')] = Key::KeyN; + s_translateKey[uint8_t('O')] = Key::KeyO; + s_translateKey[uint8_t('P')] = Key::KeyP; + s_translateKey[uint8_t('Q')] = Key::KeyQ; + s_translateKey[uint8_t('R')] = Key::KeyR; + s_translateKey[uint8_t('S')] = Key::KeyS; + s_translateKey[uint8_t('T')] = Key::KeyT; + s_translateKey[uint8_t('U')] = Key::KeyU; + s_translateKey[uint8_t('V')] = Key::KeyV; + s_translateKey[uint8_t('W')] = Key::KeyW; + s_translateKey[uint8_t('X')] = Key::KeyX; + s_translateKey[uint8_t('Y')] = Key::KeyY; + s_translateKey[uint8_t('Z')] = Key::KeyZ; } int32_t run(int _argc, char** _argv) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 93b65a7a..4cd16e52 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -120,19 +120,6 @@ namespace bgfx D3D11_CULL_BACK, }; - static const DXGI_FORMAT s_depthFormat[] = - { - DXGI_FORMAT_UNKNOWN, // ignored - DXGI_FORMAT_D16_UNORM, // D16 - DXGI_FORMAT_D24_UNORM_S8_UINT, // D24 - DXGI_FORMAT_D24_UNORM_S8_UINT, // D24S8 - DXGI_FORMAT_D24_UNORM_S8_UINT, // D32 - DXGI_FORMAT_D32_FLOAT, // D16F - DXGI_FORMAT_D32_FLOAT, // D24F - DXGI_FORMAT_D32_FLOAT, // D32F - DXGI_FORMAT_D24_UNORM_S8_UINT, // D0S8 - }; - static const D3D11_TEXTURE_ADDRESS_MODE s_textureAddress[] = { D3D11_TEXTURE_ADDRESS_WRAP, @@ -345,6 +332,11 @@ namespace bgfx ID3D11SamplerState* m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; }; +#if BX_COMPILER_CLANG +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-const-variable" +#endif // BX_COMPILER_CLANG + static const GUID WKPDID_D3DDebugObjectName = { 0x429b8c22, 0x9188, 0x4b0c, { 0x87, 0x42, 0xac, 0xb0, 0xbf, 0x85, 0xc2, 0x00 } }; template @@ -363,6 +355,10 @@ namespace bgfx } } +#if BX_COMPILER_CLANG +# pragma GCC diagnostic pop +#endif // BX_COMPILER_CLANG + static BX_NO_INLINE bool getIntelExtensions(ID3D11Device* _device) { uint8_t temp[28]; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 763a0e01..f00f3b4f 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -251,8 +251,10 @@ namespace bgfx { D3DFMT_RAWZ, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, false }, }; +#if BGFX_CONFIG_RENDERER_DIRECT3D9EX static const GUID IID_IDirect3D9 = { 0x81bdcbca, 0x64d4, 0x426d, { 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c } }; static const GUID IID_IDirect3DDevice9Ex = { 0xb18b10ce, 0x2649, 0x405a, { 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a } }; +#endif // BGFX_CONFIG_RENDERER_DIRECT3D9EX static PFN_D3DPERF_SET_MARKER D3DPERF_SetMarker; static PFN_D3DPERF_BEGIN_EVENT D3DPERF_BeginEvent;