diff options
-rw-r--r-- | indra/llrender/llcubemap.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llgl.h | 2 | ||||
-rw-r--r-- | indra/llrender/llimagegl.cpp | 74 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 10 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 11 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.h | 1 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 71 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/transform/binormalV.glsl | 4 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 1 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 12 |
14 files changed, 78 insertions, 126 deletions
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 32e4c0d18e..362452d837 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -81,7 +81,7 @@ void LLCubeMap::initGL() { U32 texname = 0; - LLImageGL::generateTextures(LLTexUnit::TT_CUBE_MAP, 1, &texname); + LLImageGL::generateTextures(LLTexUnit::TT_CUBE_MAP, GL_RGB8, 1, &texname); for (int i = 0; i < 6; i++) { diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index c26b75eff7..964495a3ab 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -419,7 +419,7 @@ public: virtual void updateGL() = 0; }; -const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000; //1 ms +const U32 FENCE_WAIT_TIME_NANOSECONDS = 1000; //1 ms class LLGLFence { diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 2d3762135a..bb585cc49c 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -51,7 +51,7 @@ S32 LLImageGL::sGlobalTextureMemoryInBytes = 0; S32 LLImageGL::sBoundTextureMemoryInBytes = 0; S32 LLImageGL::sCurBoundTextureMemory = 0; S32 LLImageGL::sCount = 0; -std::list<U32> LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE]; +LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE]; U32 LLImageGL::sCurTexName = 1; BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; @@ -766,6 +766,9 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) if (gGLManager.mHasFramebufferObject) { + gGL.getTexUnit(0)->unbind(mBindTarget); + gGL.getTexUnit(0)->bind(this); + glGenerateMipmap(LLTexUnit::getInternalType(mBindTarget)); } } @@ -1094,14 +1097,24 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ } // static -void LLImageGL::generateTextures(LLTexUnit::eTextureType type, S32 numTextures, U32 *textures) +void LLImageGL::generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures) { + bool empty = true; + + dead_texturelist_t::iterator iter = sDeadTextureList[type].find(format); + + if (iter != sDeadTextureList[type].end()) + { + empty = iter->second.empty(); + } + for (S32 i = 0; i < numTextures; ++i) { - if (!sDeadTextureList[type].empty()) + if (!empty) { - textures[i] = sDeadTextureList[type].front(); - sDeadTextureList[type].pop_front(); + textures[i] = iter->second.front(); + iter->second.pop_front(); + empty = iter->second.empty(); } else { @@ -1111,28 +1124,35 @@ void LLImageGL::generateTextures(LLTexUnit::eTextureType type, S32 numTextures, } // static -void LLImageGL::deleteTextures(LLTexUnit::eTextureType type, S32 numTextures, U32 *textures, bool immediate) +void LLImageGL::deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures, bool immediate) { if (gGLManager.mInited) { - for (S32 i = 0; i < numTextures; ++i) - { //remove texture from VRAM by setting its size to zero - gGL.getTexUnit(0)->bindManual(type, textures[i]); + if (format == 0) + { //unknown internal format, not safe to reuse + glDeleteTextures(numTextures, textures); + } + else + { + for (S32 i = 0; i < numTextures; ++i) + { //remove texture from VRAM by setting its size to zero + gGL.getTexUnit(0)->bindManual(type, textures[i]); - if (type == LLTexUnit::TT_CUBE_MAP) - { - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - } - else - { - glTexImage2D(LLTexUnit::getInternalType(type), 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + if (type == LLTexUnit::TT_CUBE_MAP) + { + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else + { + glTexImage2D(LLTexUnit::getInternalType(type), 0, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + sDeadTextureList[type][format].push_back(textures[i]); } - sDeadTextureList[type].push_back(textures[i]); } } @@ -1264,11 +1284,11 @@ BOOL LLImageGL::createGLTexture() if(mTexName) { - LLImageGL::deleteTextures(mBindTarget, 1, (reinterpret_cast<GLuint*>(&mTexName))) ; + LLImageGL::deleteTextures(mBindTarget, mFormatInternal, 1, (reinterpret_cast<GLuint*>(&mTexName))) ; } - LLImageGL::generateTextures(mBindTarget, 1, &mTexName); + LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); stop_glerror(); if (!mTexName) { @@ -1381,7 +1401,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } else { - LLImageGL::generateTextures(mBindTarget, 1, &mTexName); + LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); stop_glerror(); { llverify(gGL.getTexUnit(0)->bind(this)); @@ -1431,7 +1451,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ decTextureCounter(mTextureMemory, mComponents, mCategory) ; } - LLImageGL::deleteTextures(mBindTarget,1, &old_name); + LLImageGL::deleteTextures(mBindTarget, mFormatInternal, 1, &old_name); stop_glerror(); } @@ -1608,7 +1628,7 @@ void LLImageGL::destroyGLTexture() mTextureMemory = 0; } - LLImageGL::deleteTextures(mBindTarget, 1, &mTexName); + LLImageGL::deleteTextures(mBindTarget, mFormatInternal, 1, &mTexName); mTexName = 0; mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. mGLTextureCreated = FALSE ; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 8c9cea111e..34efafb015 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -46,11 +46,15 @@ class LLImageGL : public LLRefCount friend class LLTexUnit; public: static U32 sCurTexName; - static std::list<U32> sDeadTextureList[LLTexUnit::TT_NONE]; + + //previously used but now available texture names + // sDeadTextureList[<usage>][<internal format>] + typedef std::map<U32, std::list<U32> > dead_texturelist_t; + static dead_texturelist_t sDeadTextureList[LLTexUnit::TT_NONE]; // These 2 functions replace glGenTextures() and glDeleteTextures() - static void generateTextures(LLTexUnit::eTextureType type, S32 numTextures, U32 *textures); - static void deleteTextures(LLTexUnit::eTextureType type, S32 numTextures, U32 *textures, bool immediate = false); + static void generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures); + static void deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures, bool immediate = false); static void deleteDeadTextures(); // Size calculation diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index f0dd6f3bd6..ced6b013ec 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -55,7 +55,6 @@ bool LLRenderTarget::sUseFBO = false; LLRenderTarget::LLRenderTarget() : mResX(0), mResY(0), - mTex(0), mFBO(0), mDepth(0), mStencil(0), @@ -135,7 +134,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) } U32 tex; - LLImageGL::generateTextures(mUsage, 1, &tex); + LLImageGL::generateTextures(mUsage, color_fmt, 1, &tex); gGL.getTexUnit(0)->bindManual(mUsage, tex); stop_glerror(); @@ -193,6 +192,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) } mTex.push_back(tex); + mInternalFormat.push_back(color_fmt); if (gDebugGL) { //bind and unbind to validate target @@ -217,7 +217,7 @@ bool LLRenderTarget::allocateDepth() } else { - LLImageGL::generateTextures(mUsage, 1, &mDepth); + LLImageGL::generateTextures(mUsage, GL_DEPTH_COMPONENT24, 1, &mDepth); gGL.getTexUnit(0)->bindManual(mUsage, mDepth); U32 internal_type = LLTexUnit::getInternalType(mUsage); @@ -294,7 +294,7 @@ void LLRenderTarget::release() } else { - LLImageGL::deleteTextures(mUsage, 1, &mDepth, true); + LLImageGL::deleteTextures(mUsage, 0, 1, &mDepth, true); stop_glerror(); } mDepth = 0; @@ -326,8 +326,9 @@ void LLRenderTarget::release() if (mTex.size() > 0) { sBytesAllocated -= mResX*mResY*4*mTex.size(); - LLImageGL::deleteTextures(mUsage, mTex.size(), &mTex[0], true); + LLImageGL::deleteTextures(mUsage, mInternalFormat[0], mTex.size(), &mTex[0], true); mTex.clear(); + mInternalFormat.clear(); } mResX = mResY = 0; diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 2735ab21c5..8360458840 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -142,6 +142,7 @@ protected: U32 mResX; U32 mResY; std::vector<U32> mTex; + std::vector<U32> mInternalFormat; U32 mFBO; U32 mDepth; bool mStencil; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index ca7c9deff2..f4bf744e3c 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -38,8 +38,6 @@ #include "llglslshader.h" #include "llmemory.h" -#define LL_VBO_POOLING 1 - //Next Highest Power Of Two //helper function, returns first number > v that is a power of 2, or v if v is already a power of 2 U32 nhpo2(U32 v) @@ -165,33 +163,24 @@ LLVBOPool::LLVBOPool(U32 vboUsage, U32 vboType) std::fill(mMissCount.begin(), mMissCount.end(), 0); } -static LLFastTimer::DeclareTimer FTM_VBO_GEN_BUFFER("gen buffers"); -static LLFastTimer::DeclareTimer FTM_VBO_BUFFER_DATA("glBufferData"); - - volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) { llassert(vbo_block_size(size) == size); volatile U8* ret = NULL; -#if LL_VBO_POOLING - U32 i = vbo_block_index(size); if (mFreeList.size() <= i) { mFreeList.resize(i+1); - mMissCount.resize(i+1); } if (mFreeList[i].empty() || for_seed) { //make a new buffer - { - LLFastTimer t(FTM_VBO_GEN_BUFFER); - name = genBuffer(); - } + name = genBuffer(); + glBindBufferARB(mType, name); if (!for_seed && i < LL_VBO_POOL_SEED_COUNT) @@ -215,7 +204,6 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) } else { //always use a true hint of static draw when allocating non-client-backed buffers - LLFastTimer t(FTM_VBO_BUFFER_DATA); glBufferDataARB(mType, size, 0, GL_STATIC_DRAW_ARB); } @@ -256,33 +244,6 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) mFreeList[i].pop_front(); } -#else //no pooling - - glGenBuffersARB(1, &name); - glBindBufferARB(mType, name); - - if (mType == GL_ARRAY_BUFFER_ARB) - { - LLVertexBuffer::sAllocatedBytes += size; - } - else - { - LLVertexBuffer::sAllocatedIndexBytes += size; - } - - if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) - { - glBufferDataARB(mType, size, 0, mUsage); - ret = (U8*) ll_aligned_malloc_16(size); - } - else - { //always use a true hint of static draw when allocating non-client-backed buffers - glBufferDataARB(mType, size, 0, GL_STATIC_DRAW_ARB); - } - - glBindBufferARB(mType, 0); - -#endif return ret; } @@ -291,33 +252,6 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size) { llassert(vbo_block_size(size) == size); -#if 0 && LL_VBO_POOLING - - U32 i = vbo_block_index(size); - - llassert(mFreeList.size() > i); - - Record rec; - rec.mGLName = name; - rec.mClientData = buffer; - - if (buffer == NULL) - { - glDeleteBuffersARB(1, &rec.mGLName); - } - else - { - if (mType == GL_ARRAY_BUFFER_ARB) - { - sBytesPooled += size; - } - else - { - sIndexBytesPooled += size; - } - mFreeList[i].push_back(rec); - } -#else //no pooling deleteBuffer(name); ll_aligned_free_16((U8*) buffer); @@ -329,7 +263,6 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size) { LLVertexBuffer::sAllocatedIndexBytes -= size; } -#endif } void LLVBOPool::seedPool() diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 01683e58a1..3b782c16a4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7852,7 +7852,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderDebugNormalScale</key> <map> diff --git a/indra/newview/app_settings/shaders/class1/transform/binormalV.glsl b/indra/newview/app_settings/shaders/class1/transform/binormalV.glsl index b4aab0f3ca..44f1aa34a0 100644 --- a/indra/newview/app_settings/shaders/class1/transform/binormalV.glsl +++ b/indra/newview/app_settings/shaders/class1/transform/binormalV.glsl @@ -27,10 +27,10 @@ uniform mat3 normal_matrix; ATTRIBUTE vec3 binormal; -VARYING vec3 binormal_out; +VARYING vec4 binormal_out; void main() { - binormal_out = normal_matrix * binormal; + binormal_out = vec4(normal_matrix * binormal, 0.0); } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b362fa340c..40d2157e28 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -396,7 +396,6 @@ mCalculateBtn(NULL) sInstance = this; mLastMouseX = 0; mLastMouseY = 0; - mGLName = 0; mStatusLock = new LLMutex(NULL); mModelPreview = NULL; @@ -538,11 +537,6 @@ LLFloaterModelPreview::~LLFloaterModelPreview() delete mModelPreview; } - if (mGLName) - { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, &mGLName ); - } - delete mStatusLock; mStatusLock = NULL; } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 64324854a5..981f9b0f72 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -256,7 +256,6 @@ protected: S32 mLastMouseX; S32 mLastMouseY; LLRect mPreviewRect; - U32 mGLName; static S32 sUploadAmount; std::set<LLPointer<DecompRequest> > mCurRequest; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 083ad622cd..cbb818a304 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -896,7 +896,7 @@ void LLVOAvatar::deleteLayerSetCaches(bool clearAll) } if (mBakedTextureDatas[i].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); mBakedTextureDatas[i].mMaskTexName = 0 ; } } @@ -7394,7 +7394,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture } U32 gl_name; - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, 1, &gl_name ); + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &gl_name ); stop_glerror(); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); @@ -7431,7 +7431,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture maskData->mLastDiscardLevel = discard_level; if (self->mBakedTextureDatas[baked_index].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); } self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name; found_texture_id = true; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b6d4d6b56f..fcfa0b7d15 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2605,7 +2605,7 @@ void LLVOAvatarSelf::deleteScratchTextures() namep; namep = sScratchTexNames.getNextData() ) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, (U32 *)namep ); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, 1, (U32 *)namep ); stop_glerror(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index aff3b3fb26..dac9b95dc6 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1046,19 +1046,19 @@ void LLPipeline::releaseGLBuffers() if (mNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, &mNoiseMap); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mNoiseMap); mNoiseMap = 0; } if (mTrueNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, &mTrueNoiseMap); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mTrueNoiseMap); mTrueNoiseMap = 0; } if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 1, &mLightFunc); + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R8, 1, &mLightFunc); mLightFunc = 0; } @@ -1149,7 +1149,7 @@ void LLPipeline::createGLBuffers() noise[i].mV[2] = ll_frand()*scaler+1.f-scaler/2.f; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, 1, &mNoiseMap); + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB, GL_FLOAT, noise, false); @@ -1165,7 +1165,7 @@ void LLPipeline::createGLBuffers() noise[i] = ll_frand()*2.0-1.0; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, 1, &mTrueNoiseMap); + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mTrueNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mTrueNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB,GL_FLOAT, noise, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); @@ -1201,7 +1201,7 @@ void LLPipeline::createGLBuffers() } } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, 1, &mLightFunc); + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_R8, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R8, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, lg, false); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); |