Vulkan: Depth / stencil attachments bug fixes

I found a couple of bugs trying to enable polygon offset render states.

This is just pre-work to get to a better state.

Bug:angleproject:2353

Change-Id: If6af949a09af1340e870afb627ae427d01c6e77c
Reviewed-on: https://chromium-review.googlesource.com/975631
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 69f0e77..ca9f724 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -143,8 +143,9 @@
         // We only support packed depth/stencil, not separate.
         ASSERT(!(clearDepth && clearStencil) || mState.getDepthStencilAttachment());
 
-        const VkImageAspectFlags aspectFlags = (clearDepth ? VK_IMAGE_ASPECT_DEPTH_BIT : 0) |
-                                               (clearDepth ? VK_IMAGE_ASPECT_STENCIL_BIT : 0);
+        const VkImageAspectFlags aspectFlags =
+            (depthAttachment ? VK_IMAGE_ASPECT_DEPTH_BIT : 0) |
+            (stencilAttachment ? VK_IMAGE_ASPECT_STENCIL_BIT : 0);
 
         RenderTargetVk *renderTarget = mRenderTargetCache.getDepthStencil();
         renderTarget->resource->onWriteResource(writingNode, currentSerial);