diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2023-04-04 10:46:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 10:46:29 -0700 |
commit | b28971e4bf8cb41ea9eecead2b5676720355e30b (patch) | |
tree | 94099c321b0b3865bf2480cf8284fb5800354a8a /indra | |
parent | 698966f8e7ddcc0b123a83d7c4e381778f8cd8ab (diff) | |
parent | dda6402893a83b770d5022bf775f9cd9b0d93755 (diff) |
Merge pull request #145 from secondlife/SL-19331
SL-19331: Partially revert code trim in LLViewerMediaImpl
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 969f0a3594..aae3bd7f25 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2965,15 +2965,16 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA; LLMutexLock lock(&mLock); // don't allow media source tear-down during update - const LLGLuint tex_name = media_tex->getGLTexture() ? media_tex->getGLTexture()->getTexName() : (LLGLuint)0; - if (!tex_name) - { - llassert(false); - return; - } - // wrap "data" in an LLImageRaw but do NOT make a copy LLPointer<LLImageRaw> raw = new LLImageRaw(data, media_tex->getWidth(), media_tex->getHeight(), media_tex->getComponents(), true); + + // *NOTE: Recreating the GL texture each media update may seem wasteful + // (note the texture creation in preMediaTexUpdate), however, it apparently + // prevents GL calls from blocking, due to poor bookkeeping of state of + // updated textures by the OpenGL implementation. + // Allocate GL texture based on LLImageRaw but do NOT copy to GL + LLGLuint tex_name = 0; + media_tex->createGLTexture(0, raw, 0, TRUE, LLGLTexture::OTHER, true, &tex_name); // copy just the subimage covered by the image raw to GL media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name); |