From 1d86dcd846ed5ea7734df507d15adf057cb2ebd0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 8 Jul 2019 10:10:22 -0700 Subject: SL-10625 another shot across the bow Move dynamic texture update (which does local back readback work) to just before swap which may keep the Intel driver from tripping on its own shoelaces and is also subjectively faster for bakes. --- indra/newview/lldynamictexture.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fa9a0712fa..5e283f7cd0 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -213,7 +213,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() sNumRenders = 0; if (gGLManager.mIsDisabled || LLPipeline::sMemAllocationThrottled) { - return TRUE; + return FALSE; } bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; @@ -248,7 +248,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() result = TRUE; sNumRenders++; } - gGL.flush(); + //gGL.flush(); LLVertexBuffer::unbind(); dynamicTexture->postRender(result); @@ -261,6 +261,8 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gPipeline.mWaterDis.flush(); } + gGL.flush(); + return ret; } -- cgit v1.2.3 From 946da4e507dd00e6e7a9e465d38494bcafe4f652 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2019 15:04:48 -0700 Subject: SL-10761 Add work-around for broken intel drivers which can't use glReadPixels from RGBA FBOs to get alpha without locking up. --- indra/newview/lldynamictexture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 5e283f7cd0..e1f41a9bd7 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -240,6 +240,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gDepthDirty = TRUE; gGL.color4f(1,1,1,1); + dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mWaterDis : nullptr); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; if (dynamicTexture->render()) @@ -250,7 +251,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() } //gGL.flush(); LLVertexBuffer::unbind(); - + dynamicTexture->setBoundTarget(nullptr); dynamicTexture->postRender(result); } } -- cgit v1.2.3 From dc7aa170b80bb7d3f7725b5bddce08ff2da5a7a7 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2019 14:12:37 -0700 Subject: SL-11610 Give bake its own RT to avoid issues with sharing the water distortion map. Use glFinish to insure RTs will be complete. --- indra/newview/lldynamictexture.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index e1f41a9bd7..13d539b55f 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -129,7 +129,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) llassert(mFullHeight <= 512); llassert(mFullWidth <= 512); - if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) + if (gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI) { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -216,11 +216,12 @@ BOOL LLViewerDynamicTexture::updateAllInstances() return FALSE; } - bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI; if (use_fbo) { - gPipeline.mWaterDis.bindTarget(); + gPipeline.mBake.bindTarget(); + gPipeline.mBake.clear(); } LLGLSLShader::bindNoShader(); @@ -240,7 +241,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gDepthDirty = TRUE; gGL.color4f(1,1,1,1); - dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mWaterDis : nullptr); + dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mBake : nullptr); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; if (dynamicTexture->render()) @@ -257,9 +258,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances() } } + glFinish(); + if (use_fbo) { - gPipeline.mWaterDis.flush(); + gPipeline.mBake.flush(); } gGL.flush(); -- cgit v1.2.3 From 1529c16201d332ce7bbff5c3637737ca58277eb9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 24 Jul 2019 10:53:04 -0700 Subject: SL-11610 Revert attempted fix for 10625. --- indra/newview/lldynamictexture.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 13d539b55f..fa9a0712fa 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -129,7 +129,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) llassert(mFullHeight <= 512); llassert(mFullWidth <= 512); - if (gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI) + if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -213,15 +213,14 @@ BOOL LLViewerDynamicTexture::updateAllInstances() sNumRenders = 0; if (gGLManager.mIsDisabled || LLPipeline::sMemAllocationThrottled) { - return FALSE; + return TRUE; } - bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; if (use_fbo) { - gPipeline.mBake.bindTarget(); - gPipeline.mBake.clear(); + gPipeline.mWaterDis.bindTarget(); } LLGLSLShader::bindNoShader(); @@ -241,7 +240,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gDepthDirty = TRUE; gGL.color4f(1,1,1,1); - dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mBake : nullptr); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; if (dynamicTexture->render()) @@ -250,23 +248,19 @@ BOOL LLViewerDynamicTexture::updateAllInstances() result = TRUE; sNumRenders++; } - //gGL.flush(); + gGL.flush(); LLVertexBuffer::unbind(); - dynamicTexture->setBoundTarget(nullptr); + dynamicTexture->postRender(result); } } } - glFinish(); - if (use_fbo) { - gPipeline.mBake.flush(); + gPipeline.mWaterDis.flush(); } - gGL.flush(); - return ret; } -- cgit v1.2.3 From 41ede77744489c2a2d32849ea457bcbea516a588 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 24 Jul 2019 12:52:24 -0700 Subject: SL-10625 --- indra/newview/lldynamictexture.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fa9a0712fa..f9b4df679b 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -129,7 +129,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) llassert(mFullHeight <= 512); llassert(mFullWidth <= 512); - if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) + if (gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete()) { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -216,11 +216,12 @@ BOOL LLViewerDynamicTexture::updateAllInstances() return TRUE; } - bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mBake.isComplete(); if (use_fbo) { - gPipeline.mWaterDis.bindTarget(); + gPipeline.mBake.bindTarget(); + gPipeline.mBake.clear(); } LLGLSLShader::bindNoShader(); @@ -240,6 +241,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gDepthDirty = TRUE; gGL.color4f(1,1,1,1); + dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mBake : nullptr); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; if (dynamicTexture->render()) @@ -250,7 +252,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() } gGL.flush(); LLVertexBuffer::unbind(); - + dynamicTexture->setBoundTarget(nullptr); dynamicTexture->postRender(result); } } @@ -258,9 +260,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (use_fbo) { - gPipeline.mWaterDis.flush(); + gPipeline.mBake.flush(); } + gGL.flush(); + return ret; } -- cgit v1.2.3