Fixed MinGW build.

This commit is contained in:
Branimir Karadžić 2015-04-29 17:53:06 -07:00
parent d763196407
commit 3a0f46fe3f
2 changed files with 9 additions and 12 deletions

View file

@ -1001,11 +1001,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED); mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED);
} }
#if !defined(__MINGW32__)
if (BX_ENABLED(BGFX_CONFIG_DEBUG) if (BX_ENABLED(BGFX_CONFIG_DEBUG)
&& NULL != m_infoQueue) && NULL != m_infoQueue)
{ {
m_infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true); m_infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true);
} }
#endif // !defined(__MINGW32__)
updateMsaa(); updateMsaa();
postReset(); postReset();
@ -4005,37 +4007,30 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (isValid(draw.m_drawIndirectBuffer) ) if (isValid(draw.m_drawIndirectBuffer) )
{ {
const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx];
ID3D11Buffer* ptr = vb.m_ptr;
if (isValid(draw.m_indexBuffer) ) 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); const uint32_t commandSize = 5 * sizeof(uint32_t);
numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect; numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect;
uint32_t args = draw.m_startDrawIndirect * commandSize; uint32_t args = draw.m_startDrawIndirect * commandSize;
for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
{ {
deviceCtx->DrawIndexedInstancedIndirect(ptr deviceCtx->DrawIndexedInstancedIndirect(ptr, args);
, args
);
args += commandSize; args += commandSize;
} }
} }
else else
{ {
const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx];
ID3D11Buffer* ptr = vb.m_ptr;
const uint32_t commandSize = 4 * sizeof(uint32_t); const uint32_t commandSize = 4 * sizeof(uint32_t);
numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect; numDrawIndirect = UINT16_MAX == draw.m_numDrawIndirect ? vb.m_size/commandSize : draw.m_numDrawIndirect;
uint32_t args = draw.m_startDrawIndirect * commandSize; uint32_t args = draw.m_startDrawIndirect * commandSize;
for (uint32_t ii = 0; ii < numDrawIndirect; ++ii) for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
{ {
deviceCtx->DrawInstancedIndirect(ptr deviceCtx->DrawInstancedIndirect(ptr, args);
, args
);
args += commandSize; args += commandSize;
} }
} }

View file

@ -74,6 +74,8 @@ BX_PRAGMA_DIAGNOSTIC_POP()
# ifndef D3D11_REQ_MAXANISOTROPY # ifndef D3D11_REQ_MAXANISOTROPY
# define D3D11_REQ_MAXANISOTROPY 16 # define D3D11_REQ_MAXANISOTROPY 16
# endif // D3D11_REQ_MAXANISOTROPY # endif // D3D11_REQ_MAXANISOTROPY
typedef void ID3D11InfoQueue;
#endif // __MINGW32__ #endif // __MINGW32__
namespace bgfx { namespace d3d11 namespace bgfx { namespace d3d11