diff options
author | Dave Parks <davep@lindenlab.com> | 2021-10-21 21:19:48 +0000 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2021-10-21 21:19:48 +0000 |
commit | e774bffb28a71730792931aeb1ed6a46d3cfe67b (patch) | |
tree | d82248f9fc0678fb5e6e3c39f5d0011707b0a86c /indra/llrender/llimagegl.h | |
parent | 6ecf8f2c01dc90c26a8a0ccbd11abc2241debfa9 (diff) |
SL-16202 Fix for textures appearing black or flashing white due to optimization bugs.
Diffstat (limited to 'indra/llrender/llimagegl.h')
-rw-r--r-- | indra/llrender/llimagegl.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 8e9b483c2d..da626a1093 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -37,6 +37,8 @@ #include "llunits.h" #include "llthreadsafequeue.h" #include "llrender.h" +#include "workqueue.h" + class LLTextureAtlas ; class LLWindow; @@ -50,7 +52,7 @@ class LLImageGL : public LLRefCount, public LLTrace::MemTrackable<LLImageGL> public: // These 2 functions replace glGenTextures() and glDeleteTextures() static void generateTextures(S32 numTextures, U32 *textures); - static void deleteTextures(S32 numTextures, U32 *textures); + static void deleteTextures(S32 numTextures, const U32 *textures); static void deleteDeadTextures(); // Size calculation @@ -110,7 +112,7 @@ public: S32 category = sMaxCategories-1); BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0); void setImage(const LLImageRaw* imageraw); - BOOL setImage(const U8* data_in, BOOL data_hasmips = FALSE); + BOOL setImage(const U8* data_in, BOOL data_hasmips = FALSE, S32 usename = 0); BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE); BOOL setSubImage(const U8* datap, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE); BOOL setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height); @@ -210,8 +212,9 @@ private: bool mGLTextureCreated ; LLGLuint mTexName; + LLGLuint mNewTexName = 0; // tex name set by background thread to be applied in main thread U16 mWidth; - U16 mHeight; + U16 mHeight; S8 mCurrentDiscardLevel; S8 mDiscardLevelInAtlas; @@ -319,8 +322,11 @@ public: void run() override; - LLThreadSafeQueue<std::function<void()>> mFunctionQueue; - LLThreadSafeQueue<std::function<void()>> mCallbackQueue; + // Work Queue for background thread + LL::WorkQueue mFunctionQueue; + + // Work Queue for main thread (run from updateClass) + LL::WorkQueue mCallbackQueue; LLWindow* mWindow; void* mContext; |