Vulkan: Merge append/beginWriteResource.

The new API is named 'recordCommands'.

These two APIs were basically doing the same thing. We don't need to
have an understanding of creating a new graph node to know that we
want to record some Vulkan commands to a command buffer. The prior
design was actually masking a bug where we would allow appending
commands to a command graph node that had already started a render
pass. Fix this by adding a render pass check to recordCommands.

Also removes 'hasStartedWriteResource' since this method wasn't used
anywhere.

Also renames 'onResourceChanged' to 'finishCurrentCommands'.

Bug: angleproject:2828
Change-Id: I00bd5b893fcfc37172b6c1706cb2f5fc57e79f54
Reviewed-on: https://chromium-review.googlesource.com/1235654
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/CommandGraph.h b/src/libANGLE/renderer/vulkan/CommandGraph.h
index 16a7d15..2ac17ef 100644
--- a/src/libANGLE/renderer/vulkan/CommandGraph.h
+++ b/src/libANGLE/renderer/vulkan/CommandGraph.h
@@ -125,15 +125,8 @@
   protected:
     // Allocates a write node via getNewWriteNode and returns a started command buffer.
     // The started command buffer will render outside of a RenderPass.
-    angle::Result beginWriteResource(Context *context, CommandBuffer **commandBufferOut);
-
-    // Check if we have started writing outside a RenderPass.
-    bool hasStartedWriteResource() const;
-
-    // Starts rendering to an existing command buffer for the resource.
-    // The started command buffer will render outside of a RenderPass.
-    // Calls beginWriteResource if we have not yet started writing.
-    angle::Result appendWriteResource(Context *context, CommandBuffer **commandBufferOut);
+    // Will append to an existing command buffer/graph node if possible.
+    angle::Result recordCommands(Context *context, CommandBuffer **commandBufferOut);
 
     // Begins a command buffer on the current graph node for in-RenderPass rendering.
     // Currently only called from FramebufferVk::getCommandBufferForDraw.
@@ -152,7 +145,7 @@
     const gl::Rectangle &getRenderPassRenderArea() const;
 
     // Called when 'this' object changes, but we'd like to start a new command buffer later.
-    void onResourceChanged(RendererVk *renderer);
+    void finishCurrentCommands(RendererVk *renderer);
 
     // Get the current queue serial for this resource. Only used to release resources.
     Serial getStoredQueueSerial() const;