mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
replaces GL_PIXEL_UNPACK_BUFFER_ARB with GL_PIXEL_UNPACK_BUFFER
This commit is contained in:
parent
6caafc9844
commit
30f0a9c5f9
2 changed files with 8 additions and 8 deletions
|
|
@ -228,20 +228,20 @@ void GFXGLTextureManager::innerCreateTexture( GFXGLTextureObject *retTex,
|
||||||
|
|
||||||
static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
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();
|
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)
|
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
|
||||||
{
|
{
|
||||||
FrameAllocatorMarker mem;
|
FrameAllocatorMarker mem;
|
||||||
U8* pboMemory = (U8*)mem.alloc(bufSize);
|
U8* pboMemory = (U8*)mem.alloc(bufSize);
|
||||||
GFX->getDeviceSwizzle32()->ToBuffer(pboMemory, pDL->getBits(0), 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
|
else
|
||||||
{
|
{
|
||||||
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)
|
if(texture->getBinding() == GL_TEXTURE_2D)
|
||||||
|
|
@ -249,7 +249,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
||||||
else
|
else
|
||||||
glTexSubImage1D(texture->getBinding(), 0, 0, (pDL->getWidth(0) > 1 ? pDL->getWidth(0) : pDL->getHeight(0)), GFXGLTextureFormat[pDL->getFormat()], GFXGLTextureType[pDL->getFormat()], NULL);
|
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)
|
static void _slowTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,8 @@ void GFXGLTextureObject::unlock(U32 mipLevel)
|
||||||
|
|
||||||
PRESERVE_TEXTURE(mBinding);
|
PRESERVE_TEXTURE(mBinding);
|
||||||
glBindTexture(mBinding, mHandle);
|
glBindTexture(mBinding, mHandle);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, mBuffer);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mBuffer);
|
||||||
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, (mLockedRectRect.extent.x + 1) * (mLockedRectRect.extent.y + 1) * mBytesPerTexel, mFrameAllocatorPtr, GL_STREAM_DRAW);
|
glBufferData(GL_PIXEL_UNPACK_BUFFER, (mLockedRectRect.extent.x + 1) * (mLockedRectRect.extent.y + 1) * mBytesPerTexel, mFrameAllocatorPtr, GL_STREAM_DRAW);
|
||||||
|
|
||||||
if(mBinding == GL_TEXTURE_2D)
|
if(mBinding == GL_TEXTURE_2D)
|
||||||
glTexSubImage2D(mBinding, mipLevel, mLockedRectRect.point.x, mLockedRectRect.point.y,
|
glTexSubImage2D(mBinding, mipLevel, mLockedRectRect.point.x, mLockedRectRect.point.y,
|
||||||
|
|
@ -108,7 +108,7 @@ void GFXGLTextureObject::unlock(U32 mipLevel)
|
||||||
glTexSubImage1D(mBinding, mipLevel, (mLockedRectRect.point.x > 1 ? mLockedRectRect.point.x : mLockedRectRect.point.y),
|
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);
|
(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;
|
mLockedRect.bits = NULL;
|
||||||
#if TORQUE_DEBUG
|
#if TORQUE_DEBUG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue