From 3b932c27b7b1009ef404da5a7e0613d9cd3e7bf5 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 3 Jan 2019 00:35:38 +0200 Subject: SL-10288 Mesh uploader changes from Firestorm --- indra/newview/lldynamictexture.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fa9a0712fa..af6977d3cd 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,11 +125,17 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { - //only images up to 512x512 are supported - llassert(mFullHeight <= 512); - llassert(mFullWidth <= 512); + // changes to support higher resolution rendering in the preview + ////only images up to 512x512 are supported + //llassert(mFullHeight <= 512); + //llassert(mFullWidth <= 512); + gPipeline.allocatePhysicsBuffer(); + llassert(mFullWidth <= static_cast(gPipeline.mPhysicsDisplay.getWidth())); + llassert(mFullHeight <= static_cast(gPipeline.mPhysicsDisplay.getHeight())); - if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) +// if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) + if (gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI) +// { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -215,14 +221,15 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { return TRUE; } - - bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; - + // changes to support higher resolution rendering in the preview + // bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI; if (use_fbo) { - gPipeline.mWaterDis.bindTarget(); +// gPipeline.mWaterDis.bindTarget(); + gPipeline.mPhysicsDisplay.bindTarget(); } - + // LLGLSLShader::bindNoShader(); LLVertexBuffer::unbind(); @@ -258,7 +265,10 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (use_fbo) { - gPipeline.mWaterDis.flush(); + // changes to support higher resolution rendering in the preview + // gPipeline.mWaterDis.flush(); + gPipeline.mPhysicsDisplay.flush(); + // } return ret; -- cgit v1.2.3 From dd3a3693729cc700872a6e94e0ae4898cf25c3fb Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 3 Jan 2019 14:30:01 +0200 Subject: SL-10288 comments cleanup --- indra/newview/lldynamictexture.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index af6977d3cd..e180d91461 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,17 +125,11 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { - // changes to support higher resolution rendering in the preview - ////only images up to 512x512 are supported - //llassert(mFullHeight <= 512); - //llassert(mFullWidth <= 512); gPipeline.allocatePhysicsBuffer(); llassert(mFullWidth <= static_cast(gPipeline.mPhysicsDisplay.getWidth())); llassert(mFullHeight <= static_cast(gPipeline.mPhysicsDisplay.getHeight())); -// if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) if (gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI) -// { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -221,15 +215,13 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { return TRUE; } - // changes to support higher resolution rendering in the preview - // bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI; if (use_fbo) { -// gPipeline.mWaterDis.bindTarget(); gPipeline.mPhysicsDisplay.bindTarget(); } - // + LLGLSLShader::bindNoShader(); LLVertexBuffer::unbind(); @@ -265,10 +257,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (use_fbo) { - // changes to support higher resolution rendering in the preview - // gPipeline.mWaterDis.flush(); gPipeline.mPhysicsDisplay.flush(); - // } return ret; -- cgit v1.2.3