[graphite] Add extraResourceRefs before adding commands to cmdBuffer.

In some cases we fail while trying add commands from the Recording.
However, we've already added some commands that use resources, and
some of those might be in the fExtraResourcesRefs list and so haven't
had their commandBufferRefs incremented. Hence when we tear down the
Recorder after failing to add the Recording, it will shutdown the
ResourceCache and delete those resources since they don't have a
commandBufferRef. Trying to subsequently end the command buffer in
this state (necessary prior to deleting it) makes the Vulkan validator
very unhappy. The solution is to track the extraResourceRefs before
trying to add commands.

Bug: b/277583609
Change-Id: Iaad66a3d3ab7f764a405964564ffb3e7336805c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/703680
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
1 file changed