mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
a87b59a0c7
commit
b2a91c4a29
5 changed files with 43 additions and 34 deletions
|
@ -1376,9 +1376,9 @@ again:
|
||||||
RendererType::Enum first = RendererType::Direct3D9;
|
RendererType::Enum first = RendererType::Direct3D9;
|
||||||
RendererType::Enum second = RendererType::Direct3D11;
|
RendererType::Enum second = RendererType::Direct3D11;
|
||||||
|
|
||||||
if (windowsVersionIs(Condition::GreaterEqual, 0x0603) )
|
if (windowsVersionIs(Condition::GreaterEqual, 0x0602) )
|
||||||
{
|
{
|
||||||
first = RendererType::Direct3D11 /* Direct3D12 */;
|
first = RendererType::Enum(RendererType::Direct3D11+1) /* Direct3D12 */;
|
||||||
second = RendererType::Direct3D11;
|
second = RendererType::Direct3D11;
|
||||||
if (!s_rendererCreator[second].supported)
|
if (!s_rendererCreator[second].supported)
|
||||||
second = RendererType::Direct3D9;
|
second = RendererType::Direct3D9;
|
||||||
|
|
|
@ -1091,16 +1091,19 @@ namespace bgfx
|
||||||
}
|
}
|
||||||
|
|
||||||
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
||||||
|
{
|
||||||
|
const uint32_t numVertices = _numIndices*4/6;
|
||||||
|
if (0 < numVertices)
|
||||||
{
|
{
|
||||||
ID3D11DeviceContext* deviceCtx = m_deviceCtx;
|
ID3D11DeviceContext* deviceCtx = m_deviceCtx;
|
||||||
|
|
||||||
uint32_t numVertices = _numIndices*4/6;
|
|
||||||
m_indexBuffers [_blitter.m_ib->handle.idx].update(0, _numIndices*2, _blitter.m_ib->data);
|
m_indexBuffers [_blitter.m_ib->handle.idx].update(0, _numIndices*2, _blitter.m_ib->data);
|
||||||
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
|
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
|
||||||
|
|
||||||
deviceCtx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
deviceCtx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||||
deviceCtx->DrawIndexed(_numIndices, 0, 0);
|
deviceCtx->DrawIndexed(_numIndices, 0, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void preReset()
|
void preReset()
|
||||||
{
|
{
|
||||||
|
|
|
@ -924,7 +924,9 @@ namespace bgfx
|
||||||
|
|
||||||
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
||||||
{
|
{
|
||||||
uint32_t numVertices = _numIndices*4/6;
|
const uint32_t numVertices = _numIndices*4/6;
|
||||||
|
if (0 < numVertices)
|
||||||
|
{
|
||||||
m_indexBuffers[_blitter.m_ib->handle.idx].update(0, _numIndices * 2, _blitter.m_ib->data, true);
|
m_indexBuffers[_blitter.m_ib->handle.idx].update(0, _numIndices * 2, _blitter.m_ib->data, true);
|
||||||
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
|
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
|
||||||
|
|
||||||
|
@ -936,6 +938,7 @@ namespace bgfx
|
||||||
, _numIndices / 3
|
, _numIndices / 3
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateMsaa()
|
void updateMsaa()
|
||||||
{
|
{
|
||||||
|
|
|
@ -145,7 +145,7 @@ namespace bgfx
|
||||||
|
|
||||||
memcpy(buffer, _data, _size);
|
memcpy(buffer, _data, _size);
|
||||||
|
|
||||||
m_ptr->Unlock();
|
DX_CHECK(m_ptr->Unlock() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy()
|
void destroy()
|
||||||
|
@ -185,7 +185,7 @@ namespace bgfx
|
||||||
|
|
||||||
memcpy(buffer, _data, _size);
|
memcpy(buffer, _data, _size);
|
||||||
|
|
||||||
m_ptr->Unlock();
|
DX_CHECK(m_ptr->Unlock() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy()
|
void destroy()
|
||||||
|
|
|
@ -1703,7 +1703,9 @@ namespace bgfx
|
||||||
|
|
||||||
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
|
||||||
{
|
{
|
||||||
uint32_t numVertices = _numIndices*4/6;
|
const uint32_t numVertices = _numIndices*4/6;
|
||||||
|
if (0 < numVertices)
|
||||||
|
{
|
||||||
m_indexBuffers[_blitter.m_ib->handle.idx].update(0, _numIndices*2, _blitter.m_ib->data);
|
m_indexBuffers[_blitter.m_ib->handle.idx].update(0, _numIndices*2, _blitter.m_ib->data);
|
||||||
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data);
|
m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data);
|
||||||
|
|
||||||
|
@ -1722,6 +1724,7 @@ namespace bgfx
|
||||||
, (void*)0
|
, (void*)0
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateResolution(const Resolution& _resolution)
|
void updateResolution(const Resolution& _resolution)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue