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.meow-7.2.2
parent
9f2148cc1f
commit
1d86dcd846
|
|
@ -1579,9 +1579,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
// GPUs tend to be very uptight about memory alignment as the DMA used to convey
|
||||
// said data to the card works better when well-aligned so plain old default-aligned heap mem is a no-no
|
||||
//new U8[width * height];
|
||||
size_t mem_size = (width * height);
|
||||
size_t rem = (mem_size & 0x3F);
|
||||
mem_size += rem > 0 ? (mem_size + (32 - rem)) : 0;
|
||||
size_t bytes_per_pixel = 1; // unsigned byte alpha channel only...
|
||||
size_t row_size = (width + 3) & ~0x3; // OpenGL 4-byte row align (even for things < 4 bpp...)
|
||||
size_t pixels = (row_size * height);
|
||||
size_t mem_size = pixels * bytes_per_pixel;
|
||||
|
||||
alpha_data = (U8*)ll_aligned_malloc_32(mem_size);
|
||||
|
||||
|
|
@ -1590,7 +1591,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
bool skip_readback = LLRender::sNsightDebugSupport; // nSight doesn't support use of glReadPixels
|
||||
|
||||
// SL-10625 and neither does Intel in many cases
|
||||
skip_readback = skip_readback || gGLManager.mIsIntel;
|
||||
skip_readback = skip_readback;// || gGLManager.mIsIntel;
|
||||
|
||||
if (!skip_readback)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -406,9 +406,9 @@ void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL t
|
|||
}
|
||||
}
|
||||
|
||||
void LLRenderPass::renderTexture(U32 type, U32 mask)
|
||||
void LLRenderPass::renderTexture(U32 type, U32 mask, BOOL batch_textures)
|
||||
{
|
||||
pushBatches(type, mask, TRUE);
|
||||
pushBatches(type, mask, batch_textures);
|
||||
}
|
||||
|
||||
void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture, BOOL batch_textures)
|
||||
|
|
@ -461,6 +461,11 @@ void LLRenderPass::applyModelMatrix(const LLDrawInfo& params)
|
|||
|
||||
void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures)
|
||||
{
|
||||
if (!params.mCount)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
applyModelMatrix(params);
|
||||
|
||||
bool tex_setup = false;
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ public:
|
|||
virtual void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE);
|
||||
virtual void renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE);
|
||||
virtual void renderGroups(U32 type, U32 mask, BOOL texture = TRUE);
|
||||
virtual void renderTexture(U32 type, U32 mask);
|
||||
virtual void renderTexture(U32 type, U32 mask, BOOL batch_textures = TRUE);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,9 +130,6 @@ void display_startup()
|
|||
|
||||
gPipeline.updateGL();
|
||||
|
||||
// Update images?
|
||||
//gImageList.updateImages(0.01f);
|
||||
|
||||
// Written as branch to appease GCC which doesn't like different
|
||||
// pointer types across ternary ops
|
||||
//
|
||||
|
|
@ -149,11 +146,6 @@ void display_startup()
|
|||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
|
||||
if (frame_count++ > 1) // make sure we have rendered a frame first
|
||||
{
|
||||
LLViewerDynamicTexture::updateAllInstances();
|
||||
}
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
|
||||
|
|
@ -595,18 +587,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
// Actually push all of our triangles to the screen.
|
||||
//
|
||||
|
||||
// do render-to-texture stuff here
|
||||
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES))
|
||||
{
|
||||
LLAppViewer::instance()->pingMainloopTimeout("Display:DynamicTextures");
|
||||
LL_RECORD_BLOCK_TIME(FTM_UPDATE_DYNAMIC_TEXTURES);
|
||||
if (LLViewerDynamicTexture::updateAllInstances())
|
||||
{
|
||||
gGL.setColorMask(true, true);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
gViewerWindow->setup3DViewport();
|
||||
|
||||
gPipeline.resetFrameStats(); // Reset per-frame statistics.
|
||||
|
|
@ -1037,10 +1017,26 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
if (!for_snapshot)
|
||||
{
|
||||
render_ui();
|
||||
}
|
||||
|
||||
// do render-to-texture stuff here
|
||||
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES))
|
||||
{
|
||||
LLAppViewer::instance()->pingMainloopTimeout("Display:DynamicTextures");
|
||||
LL_RECORD_BLOCK_TIME(FTM_UPDATE_DYNAMIC_TEXTURES);
|
||||
if (LLViewerDynamicTexture::updateAllInstances())
|
||||
{
|
||||
gGL.setColorMask(true, true);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI");
|
||||
if (!for_snapshot)
|
||||
{
|
||||
swap();
|
||||
}
|
||||
|
||||
|
||||
LLSpatialGroup::sNoDelete = FALSE;
|
||||
gPipeline.clearReferences();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue