diff options
author | Jacek Antonelli | 2008-12-12 23:24:52 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-12 23:25:00 -0600 |
commit | d1345838c6e36c35dbe3a6b683eb8ffe274b024a (patch) | |
tree | 5e727fcabbd5cf0337c11192bfe4db6191c7b044 /linden/indra/llrender | |
parent | Second Life viewer sources 1.22.2-RC (diff) | |
download | meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.zip meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.gz meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.bz2 meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.xz |
Second Life viewer sources 1.22.3-RC
Diffstat (limited to 'linden/indra/llrender')
-rw-r--r-- | linden/indra/llrender/llimagegl.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llrender/llrender.cpp | 24 | ||||
-rw-r--r-- | linden/indra/llrender/llrender.h | 11 |
3 files changed, 20 insertions, 17 deletions
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index a41b931..9a392d7 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp | |||
@@ -748,7 +748,7 @@ BOOL LLImageGL::setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S3 | |||
748 | // Copy sub image from frame buffer | 748 | // Copy sub image from frame buffer |
749 | BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height) | 749 | BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height) |
750 | { | 750 | { |
751 | if (gGL.getTexUnit(0)->bind(this)) | 751 | if (gGL.getTexUnit(0)->bind(this, true)) |
752 | { | 752 | { |
753 | glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); | 753 | glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); |
754 | mInitialized = true; | 754 | mInitialized = true; |
diff --git a/linden/indra/llrender/llrender.cpp b/linden/indra/llrender/llrender.cpp index a15f44a..fcd76d4 100644 --- a/linden/indra/llrender/llrender.cpp +++ b/linden/indra/llrender/llrender.cpp | |||
@@ -175,7 +175,7 @@ void LLTexUnit::disable(void) | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | bool LLTexUnit::bind(const LLImageGL* texture) | 178 | bool LLTexUnit::bind(const LLImageGL* texture, bool forceBind) |
179 | { | 179 | { |
180 | if (mIndex < 0) return false; | 180 | if (mIndex < 0) return false; |
181 | 181 | ||
@@ -183,29 +183,27 @@ bool LLTexUnit::bind(const LLImageGL* texture) | |||
183 | 183 | ||
184 | if (texture == NULL) | 184 | if (texture == NULL) |
185 | { | 185 | { |
186 | return texture->bindError(mIndex); | 186 | llwarns << "NULL LLTexUnit::bind texture" << llendl; |
187 | return false; | ||
187 | } | 188 | } |
188 | 189 | ||
189 | if (!texture->isInitialized()) | 190 | if (!texture->isInitialized() && !forceBind) |
190 | { | 191 | { |
191 | return texture->bindDefaultImage(mIndex); | 192 | return texture->bindDefaultImage(mIndex); |
192 | } | 193 | } |
194 | |||
193 | if (!texture->getTexName()) //if texture does not exist | 195 | if (!texture->getTexName()) //if texture does not exist |
194 | { | 196 | { |
195 | return texture->bindDefaultImage(mIndex); | 197 | return texture->bindDefaultImage(mIndex); |
196 | } | 198 | } |
197 | 199 | ||
198 | // Disabled caching of binding state. | 200 | // Disabled caching of binding state. |
199 | if (texture != NULL) | 201 | activate(); |
200 | { | 202 | enable(texture->getTarget()); |
201 | activate(); | 203 | mCurrTexture = texture->getTexName(); |
202 | enable(texture->getTarget()); | 204 | glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); |
203 | mCurrTexture = texture->getTexName(); | 205 | texture->updateBindStats(); |
204 | glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); | 206 | return true; |
205 | texture->updateBindStats(); | ||
206 | return true; | ||
207 | } | ||
208 | return false; | ||
209 | } | 207 | } |
210 | 208 | ||
211 | bool LLTexUnit::bind(LLCubeMap* cubeMap) | 209 | bool LLTexUnit::bind(LLCubeMap* cubeMap) |
diff --git a/linden/indra/llrender/llrender.h b/linden/indra/llrender/llrender.h index 8c648f3..7dcb504 100644 --- a/linden/indra/llrender/llrender.h +++ b/linden/indra/llrender/llrender.h | |||
@@ -135,12 +135,17 @@ public: | |||
135 | // Disables the current texture unit | 135 | // Disables the current texture unit |
136 | void disable(void); | 136 | void disable(void); |
137 | 137 | ||
138 | // Binds the LLImageGL to this texture unit (automatically enables the unit for the LLImageGL's texture type) | 138 | // Binds the LLImageGL to this texture unit |
139 | bool bind(const LLImageGL* texture); | 139 | // (automatically enables the unit for the LLImageGL's texture type) |
140 | // Binds a cubemap to this texture unit (automatically enables the texture unit for cubemaps) | 140 | bool bind(const LLImageGL* texture, bool forceBind = false); |
141 | |||
142 | // Binds a cubemap to this texture unit | ||
143 | // (automatically enables the texture unit for cubemaps) | ||
141 | bool bind(LLCubeMap* cubeMap); | 144 | bool bind(LLCubeMap* cubeMap); |
145 | |||
142 | // Binds a render target to this texture unit (automatically enables the texture unit for the RT's texture type) | 146 | // Binds a render target to this texture unit (automatically enables the texture unit for the RT's texture type) |
143 | bool bind(LLRenderTarget * renderTarget, bool bindDepth = false); | 147 | bool bind(LLRenderTarget * renderTarget, bool bindDepth = false); |
148 | |||
144 | // Manually binds a texture to the texture unit (automatically enables the tex unit for the given texture type) | 149 | // Manually binds a texture to the texture unit (automatically enables the tex unit for the given texture type) |
145 | bool bindManual(eTextureType type, U32 texture); | 150 | bool bindManual(eTextureType type, U32 texture); |
146 | 151 | ||