mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1598 from JeffProgrammer/glpboimprovement
replaces GL_PIXEL_UNPACK_BUFFER_ARB with GL_PIXEL_UNPACK_BUFFER
This commit is contained in:
commit
39961500f4
|
|
@ -228,9 +228,9 @@ void GFXGLTextureManager::innerCreateTexture( GFXGLTextureObject *retTex,
|
|||
|
||||
static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
||||
{
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, texture->getBuffer());
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->getBuffer());
|
||||
U32 bufSize = pDL->getWidth(0) * pDL->getHeight(0) * pDL->getBytesPerPixel();
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, bufSize, NULL, GL_STREAM_DRAW);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, bufSize, NULL, GL_STREAM_DRAW);
|
||||
|
||||
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
|
||||
{
|
||||
|
|
@ -238,12 +238,12 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|||
FrameAllocatorMarker mem;
|
||||
U8* pboMemory = (U8*)mem.alloc(bufSize);
|
||||
GFX->getDeviceSwizzle32()->ToBuffer(pboMemory, pDL->getBits(0), bufSize);
|
||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB, 0, bufSize, pboMemory );
|
||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, bufSize, pboMemory );
|
||||
}
|
||||
else
|
||||
{
|
||||
PROFILE_SCOPE(SwizzleNull_Upload);
|
||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB, 0, bufSize, pDL->getBits(0) );
|
||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, bufSize, pDL->getBits(0) );
|
||||
}
|
||||
|
||||
if(texture->getBinding() == GL_TEXTURE_2D)
|
||||
|
|
@ -251,7 +251,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|||
else
|
||||
glTexSubImage1D(texture->getBinding(), 0, 0, (pDL->getWidth(0) > 1 ? pDL->getWidth(0) : pDL->getHeight(0)), GFXGLTextureFormat[pDL->getFormat()], GFXGLTextureType[pDL->getFormat()], NULL);
|
||||
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
}
|
||||
|
||||
static void _slowTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ void GFXGLTextureObject::unlock(U32 mipLevel)
|
|||
|
||||
PRESERVE_TEXTURE(mBinding);
|
||||
glBindTexture(mBinding, mHandle);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, mBuffer);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, (mLockedRectRect.extent.x + 1) * (mLockedRectRect.extent.y + 1) * mBytesPerTexel, mFrameAllocatorPtr, GL_STREAM_DRAW);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mBuffer);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, (mLockedRectRect.extent.x + 1) * (mLockedRectRect.extent.y + 1) * mBytesPerTexel, mFrameAllocatorPtr, GL_STREAM_DRAW);
|
||||
|
||||
if(mBinding == GL_TEXTURE_2D)
|
||||
glTexSubImage2D(mBinding, mipLevel, mLockedRectRect.point.x, mLockedRectRect.point.y,
|
||||
|
|
@ -111,7 +111,7 @@ void GFXGLTextureObject::unlock(U32 mipLevel)
|
|||
glTexSubImage1D(mBinding, mipLevel, (mLockedRectRect.point.x > 1 ? mLockedRectRect.point.x : mLockedRectRect.point.y),
|
||||
(mLockedRectRect.extent.x > 1 ? mLockedRectRect.extent.x : mLockedRectRect.extent.y), GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], NULL);
|
||||
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
mLockedRect.bits = NULL;
|
||||
#if TORQUE_DEBUG
|
||||
|
|
|
|||
Loading…
Reference in a new issue