Move unsupported depth stencil check to FramebufferD3D.
BUG=angleproject:885
Change-Id: I0abc674e365d2b5b65d23e2abf741a02a1146cdd
Reviewed-on: https://chromium-review.googlesource.com/268311
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 6e7b0ece..3344281 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -320,6 +320,14 @@
GLenum FramebufferD3D::checkStatus() 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 (mData.getDepthAttachment() != nullptr && mData.getStencilAttachment() != nullptr &&
+ mData.getDepthStencilAttachment() == nullptr)
+ {
+ return GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+
// D3D11 does not allow for overlapping RenderTargetViews, so ensure uniqueness
const auto &colorAttachments = mData.getColorAttachments();
for (size_t colorAttachment = 0; colorAttachment < colorAttachments.size(); colorAttachment++)