Ignore container layer batches that don't have an intermediate surface. (bug 1377936, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Wed, 05 Jul 2017 15:39:46 -0700
changeset 367550 092cf837ffea606ba5c7129566596ce9cb706a30
parent 367549 26efbaef8509fb11be96b34a1c2734d3b0029391
child 367551 a199c96110ca7116ae45e5f97ddaab7ad8dd10f7
push id32137
push usercbook@mozilla.com
push dateThu, 06 Jul 2017 09:18:21 +0000
treeherdermozilla-central@018b3829d0a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1377936
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Ignore container layer batches that don't have an intermediate surface. (bug 1377936, r=mattwoodrow)
gfx/layers/mlgpu/RenderPassMLGPU.cpp
--- a/gfx/layers/mlgpu/RenderPassMLGPU.cpp
+++ b/gfx/layers/mlgpu/RenderPassMLGPU.cpp
@@ -343,16 +343,20 @@ ShaderRenderPass::SetupPSBuffer0(float a
 
   MaskInformation cb(aOpacity, HasMask());
   return mDevice->GetSharedPSBuffer()->Allocate(&mPSBuffer0, cb);
 }
 
 void
 ShaderRenderPass::ExecuteRendering()
 {
+  if (mVertices.IsEmpty() && mInstances.IsEmpty()) {
+    return;
+  }
+
   mDevice->SetPSConstantBuffer(0, &mPSBuffer0);
   if (MaskOperation* mask = GetMask()) {
     mDevice->SetPSTexture(kMaskLayerTextureSlot, mask->GetTexture());
     mDevice->SetSamplerMode(kMaskSamplerSlot, SamplerMode::LinearClampToZero);
   }
 
   SetupPipeline();
 
@@ -876,16 +880,20 @@ RenderViewPass::AddToPass(LayerMLGPU* aL
 {
   // We bake in the layer ahead of time, which also guarantees the blend mode
   // is baked in, as well as the geometry requirement.
   if (mAssignedLayer != aLayer) {
     return false;
   }
 
   mSource = mAssignedLayer->GetRenderTarget();
+  if (!mSource) {
+    return false;
+  }
+
   mParentView = aInfo.view;
 
   Txn txn(this);
 
   IntPoint offset = mAssignedLayer->GetTargetOffset();
   IntSize size = mAssignedLayer->GetTargetSize();
 
   // Clamp the visible region to the texture size.