mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Fix GLCircularVolatileBuffer incorrect binding.
This commit is contained in:
parent
7097ce6466
commit
d49018df63
2 changed files with 16 additions and 9 deletions
|
|
@ -143,7 +143,7 @@ public:
|
||||||
{
|
{
|
||||||
glGenBuffers(1, &mBufferName);
|
glGenBuffers(1, &mBufferName);
|
||||||
|
|
||||||
PRESERVE_VERTEX_BUFFER();
|
PRESERVE_BUFFER( mBinding );
|
||||||
glBindBuffer(mBinding, mBufferName);
|
glBindBuffer(mBinding, mBufferName);
|
||||||
|
|
||||||
const U32 cSizeInMB = 10;
|
const U32 cSizeInMB = 10;
|
||||||
|
|
@ -195,11 +195,11 @@ public:
|
||||||
}
|
}
|
||||||
else if( GFXGL->glUseMap() )
|
else if( GFXGL->glUseMap() )
|
||||||
{
|
{
|
||||||
PRESERVE_VERTEX_BUFFER();
|
PRESERVE_BUFFER( mBinding );
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, mBufferName);
|
glBindBuffer(mBinding, mBufferName);
|
||||||
|
|
||||||
const GLbitfield access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT;
|
const GLbitfield access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT;
|
||||||
outPtr = glMapBufferRange(GL_ARRAY_BUFFER, outOffset, size, access);
|
outPtr = glMapBufferRange(mBinding, outOffset, size, access);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -224,15 +224,15 @@ public:
|
||||||
}
|
}
|
||||||
else if( GFXGL->glUseMap() )
|
else if( GFXGL->glUseMap() )
|
||||||
{
|
{
|
||||||
PRESERVE_VERTEX_BUFFER();
|
PRESERVE_BUFFER( mBinding );
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, mBufferName);
|
glBindBuffer(mBinding, mBufferName);
|
||||||
|
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
glUnmapBuffer(mBinding);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PRESERVE_VERTEX_BUFFER();
|
PRESERVE_BUFFER( mBinding );
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, mBufferName);
|
glBindBuffer(mBinding, mBufferName);
|
||||||
|
|
||||||
glBufferSubData( mBinding, _getBufferData.mOffset, _getBufferData.mSize, mFrameAllocator.getlockedPtr() );
|
glBufferSubData( mBinding, _getBufferData.mOffset, _getBufferData.mSize, mFrameAllocator.getlockedPtr() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,13 @@ GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_ARRAY_BUFFER, GL_ARR
|
||||||
#define PRESERVE_INDEX_BUFFER() \
|
#define PRESERVE_INDEX_BUFFER() \
|
||||||
GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_ELEMENT_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindBuffer)
|
GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_ELEMENT_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindBuffer)
|
||||||
|
|
||||||
|
#define _GET_BUFFER_BINDING( BINDING ) \
|
||||||
|
BINDING == GL_ARRAY_BUFFER ? GL_ARRAY_BUFFER_BINDING : ( BINDING == GL_ELEMENT_ARRAY_BUFFER ? GL_ELEMENT_ARRAY_BUFFER_BINDING : 0 )
|
||||||
|
|
||||||
|
/// Helper macro to preserve the current element array binding.
|
||||||
|
#define PRESERVE_BUFFER( BINDING ) \
|
||||||
|
GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (BINDING, _GET_BUFFER_BINDING(BINDING), (GFXGLPreserveInteger::BindFn)glBindBuffer)
|
||||||
|
|
||||||
/// ASSERT: Never call glActiveTexture for a "bind to modify" or in a PRESERVER_TEXTURE MACRO scope.
|
/// ASSERT: Never call glActiveTexture for a "bind to modify" or in a PRESERVER_TEXTURE MACRO scope.
|
||||||
|
|
||||||
/// Helper macro to preserve the current 1D texture binding.
|
/// Helper macro to preserve the current 1D texture binding.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue