mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Merge pull request #1519 from Azaezel/alpha41/openglCleanups
misc opengl cleanups
This commit is contained in:
commit
214b72ca7d
1 changed files with 9 additions and 12 deletions
|
|
@ -451,20 +451,15 @@ GFXPrimitiveBuffer *GFXGLDevice::allocPrimitiveBuffer( U32 numIndices, U32 numPr
|
||||||
|
|
||||||
void GFXGLDevice::setVertexStream( U32 stream, GFXVertexBuffer *buffer )
|
void GFXGLDevice::setVertexStream( U32 stream, GFXVertexBuffer *buffer )
|
||||||
{
|
{
|
||||||
AssertFatal(stream <= 1, "GFXGLDevice::setVertexStream only support 2 stream (0: data, 1: instancing)");
|
// Reset the state the old VB required, then set the state the new VB requires.
|
||||||
|
if (mCurrentVB[stream])
|
||||||
//if(mCurrentVB[stream] != buffer)
|
|
||||||
{
|
{
|
||||||
// Reset the state the old VB required, then set the state the new VB requires.
|
mCurrentVB[stream]->finish();
|
||||||
if( mCurrentVB[stream] )
|
|
||||||
{
|
|
||||||
mCurrentVB[stream]->finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
mCurrentVB[stream] = static_cast<GFXGLVertexBuffer*>( buffer );
|
|
||||||
|
|
||||||
mNeedUpdateVertexAttrib = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mCurrentVB[stream] = static_cast<GFXGLVertexBuffer*>(buffer);
|
||||||
|
|
||||||
|
mNeedUpdateVertexAttrib = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GFXGLDevice::setVertexStreamFrequency( U32 stream, U32 frequency )
|
void GFXGLDevice::setVertexStreamFrequency( U32 stream, U32 frequency )
|
||||||
|
|
@ -511,6 +506,8 @@ void GFXGLDevice::endSceneInternal()
|
||||||
{
|
{
|
||||||
// nothing to do for opengl
|
// nothing to do for opengl
|
||||||
mCanCurrentlyRender = false;
|
mCanCurrentlyRender = false;
|
||||||
|
mVolatileVBs.clear();
|
||||||
|
mVolatilePBs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GFXGLDevice::copyResource(GFXTextureObject* pDst, GFXCubemap* pSrc, const U32 face)
|
void GFXGLDevice::copyResource(GFXTextureObject* pDst, GFXCubemap* pSrc, const U32 face)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue