Vulkan: enable the rest of dEQP tests in fbo.render.*
Vulkan does not support separate depth and stencil attachments.
Adding this check to checkStatus skips the relevant tests to that.
There was also a bug in FramebufferVk::clear where we were not
checking the number of bits for depth/stencil attachments before
setting the aspects for clearing.
Bug: angleproject:2597
Change-Id: Iabe9f77a51fc7aca08b8faf3cecc3df9f99a7f1e
Reviewed-on: https://chromium-review.googlesource.com/1107847
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index a86da49..e879569 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -176,11 +176,10 @@
const VkClearDepthStencilValue &clearDepthStencilValue =
contextVk->getClearDepthStencilValue().depthStencil;
- const VkImageAspectFlags aspectFlags =
- (depthAttachment ? VK_IMAGE_ASPECT_DEPTH_BIT : 0) |
- (stencilAttachment ? VK_IMAGE_ASPECT_STENCIL_BIT : 0);
-
RenderTargetVk *renderTarget = mRenderTargetCache.getDepthStencil();
+ const angle::Format &format = renderTarget->getImageFormat().textureFormat();
+ const VkImageAspectFlags aspectFlags = vk::GetDepthStencilAspectFlags(format);
+
vk::ImageHelper *image = renderTarget->getImageForWrite(currentSerial, this);
image->clearDepthStencil(aspectFlags, clearDepthStencilValue, commandBuffer);
}
@@ -342,6 +341,13 @@
bool FramebufferVk::checkStatus(const gl::Context *context) const
{
+ // if we have both a depth and stencil buffer, they must refer to the same object
+ // since we only support packed_depth_stencil and not separate depth and stencil
+ if (mState.hasSeparateDepthAndStencilAttachments())
+ {
+ return false;
+ }
+
return true;
}