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);
}
#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();
@ -4004,38 +4006,31 @@ BX_PRAGMA_DIAGNOSTIC_POP();
uint32_t numDrawIndirect = 0;
if (isValid(draw.m_drawIndirectBuffer) )
{
if (isValid(draw.m_indexBuffer) )
{
const VertexBufferD3D11& vb = m_vertexBuffers[draw.m_drawIndirectBuffer.idx];
ID3D11Buffer* ptr = vb.m_ptr;
if (isValid(draw.m_indexBuffer) )
{
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;
}
}

View file

@ -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