|
@@ -234,6 +234,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|
|
|
|
|
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
|
|
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(Swizzle32_Upload);
|
|
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);
|
|
@@ -241,6 +242,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(SwizzleNull_Upload);
|
|
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB, 0, bufSize, pDL->getBits(0) );
|
|
glBufferSubData(GL_PIXEL_UNPACK_BUFFER_ARB, 0, bufSize, pDL->getBits(0) );
|
|
}
|
|
}
|
|
|
|
|
|
@@ -262,6 +264,7 @@ static void _slowTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|
|
|
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(GFXGLTextureManager_loadTexture);
|
|
GFXGLTextureObject *texture = static_cast<GFXGLTextureObject*>(aTexture);
|
|
GFXGLTextureObject *texture = static_cast<GFXGLTextureObject*>(aTexture);
|
|
|
|
|
|
AssertFatal(texture->getBinding() == GL_TEXTURE_1D || texture->getBinding() == GL_TEXTURE_2D,
|
|
AssertFatal(texture->getBinding() == GL_TEXTURE_1D || texture->getBinding() == GL_TEXTURE_2D,
|
|
@@ -291,6 +294,8 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
|
|
|
|
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(GFXGLTextureManager_loadTextureDDS);
|
|
|
|
+
|
|
AssertFatal(!(dds->mFormat == GFXFormatDXT2 || dds->mFormat == GFXFormatDXT4), "GFXGLTextureManager::_loadTexture - OpenGL does not support DXT2 or DXT4 compressed textures");
|
|
AssertFatal(!(dds->mFormat == GFXFormatDXT2 || dds->mFormat == GFXFormatDXT4), "GFXGLTextureManager::_loadTexture - OpenGL does not support DXT2 or DXT4 compressed textures");
|
|
GFXGLTextureObject* texture = static_cast<GFXGLTextureObject*>(aTexture);
|
|
GFXGLTextureObject* texture = static_cast<GFXGLTextureObject*>(aTexture);
|
|
|
|
|
|
@@ -307,6 +312,8 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|
|
|
|
|
for(U32 i = 0; i < numMips; i++)
|
|
for(U32 i = 0; i < numMips; i++)
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(GFXGLTexMan_loadSurface);
|
|
|
|
+
|
|
if(isCompressedFormat(dds->mFormat))
|
|
if(isCompressedFormat(dds->mFormat))
|
|
{
|
|
{
|
|
if((!isPow2(dds->getWidth()) || !isPow2(dds->getHeight())) && GFX->getCardProfiler()->queryProfile("GL::Workaround::noCompressedNPoTTextures"))
|
|
if((!isPow2(dds->getWidth()) || !isPow2(dds->getHeight())) && GFX->getCardProfiler()->queryProfile("GL::Workaround::noCompressedNPoTTextures"))
|
|
@@ -343,6 +350,7 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|
|
|
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, void *raw)
|
|
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, void *raw)
|
|
{
|
|
{
|
|
|
|
+ PROFILE_SCOPE(GFXGLTextureManager_loadTextureRaw);
|
|
if(aTexture->getDepth() < 1)
|
|
if(aTexture->getDepth() < 1)
|
|
return false;
|
|
return false;
|
|
|
|
|