From 3a0f46fe3f5fcf6773f81fda81d33a19c046e4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 29 Apr 2015 17:53:06 -0700 Subject: [PATCH] Fixed MinGW build. --- src/renderer_d3d11.cpp | 19 +++++++------------ src/renderer_d3d11.h | 2 ++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 1034ae9b..460843fa 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1001,11 +1001,13 @@ BX_PRAGMA_DIAGNOSTIC_POP(); mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED); } +#if !defined(__MINGW32__) if (BX_ENABLED(BGFX_CONFIG_DEBUG) && NULL != m_infoQueue) { m_infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true); } +#endif // !defined(__MINGW32__) updateMsaa(); postReset(); @@ -4005,37 +4007,30 @@ BX_PRAGMA_DIAGNOSTIC_POP(); if (isValid(draw.m_drawIndirectBuffer) ) { + const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx]; + ID3D11Buffer* ptr = vb.m_ptr; + if (isValid(draw.m_indexBuffer) ) { - const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx]; - ID3D11Buffer* ptr = vb.m_ptr; - const uint32_t commandSize = 5 * sizeof(uint32_t); numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect; uint32_t args = draw.m_startDrawIndirect * commandSize; for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) { - deviceCtx->DrawIndexedInstancedIndirect(ptr - , args - ); + deviceCtx->DrawIndexedInstancedIndirect(ptr, args); args += commandSize; } } else { - const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx]; - ID3D11Buffer* ptr = vb.m_ptr; - const uint32_t commandSize = 4 * sizeof(uint32_t); numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect; uint32_t args = draw.m_startDrawIndirect * commandSize; for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) { - deviceCtx->DrawInstancedIndirect(ptr - , args - ); + deviceCtx->DrawInstancedIndirect(ptr, args); args += commandSize; } } diff --git a/src/renderer_d3d11.h b/src/renderer_d3d11.h index 68c8e5b5..7cd6c5e9 100644 --- a/src/renderer_d3d11.h +++ b/src/renderer_d3d11.h @@ -74,6 +74,8 @@ BX_PRAGMA_DIAGNOSTIC_POP() # ifndef D3D11_REQ_MAXANISOTROPY # define D3D11_REQ_MAXANISOTROPY 16 # endif // D3D11_REQ_MAXANISOTROPY + +typedef void ID3D11InfoQueue; #endif // __MINGW32__ namespace bgfx { namespace d3d11