diff options
| -rw-r--r-- | indra/llrender/llcubemaparray.cpp | 6 | ||||
| -rw-r--r-- | indra/llrender/llimagegl.cpp | 12 | ||||
| -rw-r--r-- | indra/llrender/llimagegl.h | 8 | 
3 files changed, 22 insertions, 4 deletions
| diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index ed0ad07dc0..4f8d4015b6 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -42,6 +42,8 @@  //#pragma optimize("", off) +using namespace LLImageGLMemory; +  // MUST match order of OpenGL face-layers  GLenum LLCubeMapArray::sTargets[6] =  { @@ -128,6 +130,8 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us      U32 mip = 0; +    free_cur_tex_image(); +      while (resolution >= 1)      {          glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, resolution, resolution, count * 6, 0, @@ -141,6 +145,8 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us          ++mip;      } +    alloc_tex_image(resolution * 6, resolution, format); +      mImage->setAddressMode(LLTexUnit::TAM_CLAMP);      if (use_mips) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index ed729f64e3..bdc9ec5c94 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -63,7 +63,7 @@ static U64 sTextureBytes = 0;  // track a texture alloc on the currently bound texture.  // asserts that no currently tracked alloc exists -static void alloc_tex_image(U32 width, U32 height, U32 pixformat) +void LLImageGLMemory::alloc_tex_image(U32 width, U32 height, U32 pixformat)  {      U32 texUnit = gGL.getCurrentTexUnitIndex();      U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture(); @@ -81,7 +81,7 @@ static void alloc_tex_image(U32 width, U32 height, U32 pixformat)  }  // track texture free on given texName -static void free_tex_image(U32 texName) +void LLImageGLMemory::free_tex_image(U32 texName)  {      sTexMemMutex.lock();      auto iter = sTextureAllocs.find(texName); @@ -98,7 +98,7 @@ static void free_tex_image(U32 texName)  }  // track texture free on given texNames -static void free_tex_images(U32 count, const U32* texNames) +void LLImageGLMemory::free_tex_images(U32 count, const U32* texNames)  {      for (int i = 0; i < count; ++i)      { @@ -107,13 +107,15 @@ static void free_tex_images(U32 count, const U32* texNames)  }  // track texture free on currently bound texture -static void free_cur_tex_image() +void LLImageGLMemory::free_cur_tex_image()  {      U32 texUnit = gGL.getCurrentTexUnitIndex();      U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture();      free_tex_image(texName);  } +using namespace LLImageGLMemory; +  // static   U64 LLImageGL::getTextureBytesAllocated()  { @@ -289,6 +291,8 @@ S32 LLImageGL::dataFormatBits(S32 dataformat)      case GL_SRGB_ALPHA:						        return 32;      case GL_BGRA:								    return 32;		// Used for QuickTime media textures on the Mac      case GL_DEPTH_COMPONENT:                        return 24; +    case GL_RGB16F:                                 return 48; +    case GL_RGBA16F:                                return 64;      default:          LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL;          return 0; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 60fa1258b6..18187734f1 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -47,6 +47,14 @@ class LLWindow;  #define BYTES_TO_MEGA_BYTES(x) ((x) >> 20)  #define MEGA_BYTES_TO_BYTES(x) ((x) << 20) +namespace LLImageGLMemory +{ +    void alloc_tex_image(U32 width, U32 height, U32 pixformat); +    void free_tex_image(U32 texName); +    void free_tex_images(U32 count, const U32* texNames); +    void free_cur_tex_image(); +} +  //============================================================================  class LLImageGL : public LLRefCount  { | 
