*/
RenderInstruction& At( BufferIndex bufferIndex, size_t index );
+ /**
+ * Discard the current container index
+ * @param bufferIndex to reset
+ */
+ void DiscardCurrentInstruction( BufferIndex bufferIndex );
+
private:
unsigned int mIndex[ 2 ]; ///< count of the elements that have been added
GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
mImpl->context.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
- mImpl->UpdateTrackers();
-
//Notify RenderGeometries that rendering has finished
for ( auto&& iter : mImpl->geometryContainer )
{
}
}
+ mImpl->UpdateTrackers();
+
// If this frame was rendered due to instructions existing, we mark this so we know to clear the next frame.
mImpl->lastFrameWasRendered = haveInstructions;
RenderInstruction& instruction = instructions.GetNextInstruction( updateBufferIndex );
renderTask.PrepareRenderInstruction( instruction, updateBufferIndex );
bool viewMatrixHasNotChanged = !renderTask.ViewMatrixUpdated();
+ bool isRenderListAdded = false;
const Matrix& viewMatrix = renderTask.GetViewMatrix( updateBufferIndex );
SceneGraph::Camera& camera = renderTask.GetCamera();
// We only use the clipping version of the sort comparitor if any clipping nodes exist within the RenderList.
SortRenderItems( updateBufferIndex, *renderList, layer, hasClippingNodes );
}
+
+ isRenderListAdded = true;
}
if( !layer.overlayRenderables.Empty() )
// Clipping hierarchy is irrelevant when sorting overlay items, so we specify using the non-clipping version of the sort comparitor.
SortRenderItems( updateBufferIndex, *renderList, layer, false );
}
+
+ isRenderListAdded = true;
}
}
// Inform the render instruction that all renderers have been added and this frame is complete.
instruction.UpdateCompleted();
-}
+ if( !isRenderListAdded && !instruction.mIsClearColorSet )
+ {
+ instructions.DiscardCurrentInstruction( updateBufferIndex );
+ }
+}
} // SceneGraph