Remove redundant FBO query methods.
Several query methods simply wrapped a NULL check with a default
return value. Most of these safety checks were unnecessary.
BUG=angle:660
Change-Id: I0ac6897f06be082c8efab8721920d1b51ba999ee
Reviewed-on: https://chromium-review.googlesource.com/205606
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp b/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
index b9e7404..646bd9b 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
@@ -816,20 +816,13 @@
for (unsigned int colorAttachment = 0; colorAttachment < gl::IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++)
{
const GLenum drawBufferState = framebuffer->getDrawBufferState(colorAttachment);
+ gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(colorAttachment);
- if (framebuffer->getColorbufferType(colorAttachment) != GL_NONE && drawBufferState != GL_NONE)
+ if (colorbuffer && drawBufferState != GL_NONE)
{
// the draw buffer must be either "none", "back" for the default buffer or the same index as this color (in order)
ASSERT(drawBufferState == GL_BACK || drawBufferState == (GL_COLOR_ATTACHMENT0_EXT + colorAttachment));
- gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(colorAttachment);
-
- if (!colorbuffer)
- {
- ERR("render target pointer unexpectedly null.");
- return false;
- }
-
// check for zero-sized default framebuffer, which is a special case.
// in this case we do not wish to modify any state and just silently return false.
// this will not report any gl error but will cause the calling method to return.
@@ -869,31 +862,16 @@
}
// Get the depth stencil render buffer and serials
- gl::FramebufferAttachment *depthStencil = NULL;
+ gl::FramebufferAttachment *depthStencil = framebuffer->getDepthbuffer();
unsigned int depthbufferSerial = 0;
unsigned int stencilbufferSerial = 0;
- if (framebuffer->getDepthbufferType() != GL_NONE)
+ if (depthStencil)
{
- depthStencil = framebuffer->getDepthbuffer();
- if (!depthStencil)
- {
- ERR("Depth stencil pointer unexpectedly null.");
- SafeRelease(framebufferRTVs);
- return false;
- }
-
depthbufferSerial = depthStencil->getSerial();
}
- else if (framebuffer->getStencilbufferType() != GL_NONE)
+ else if (framebuffer->getStencilbuffer())
{
depthStencil = framebuffer->getStencilbuffer();
- if (!depthStencil)
- {
- ERR("Depth stencil pointer unexpectedly null.");
- SafeRelease(framebufferRTVs);
- return false;
- }
-
stencilbufferSerial = depthStencil->getSerial();
}
@@ -3349,20 +3327,20 @@
gl::FramebufferAttachment *attachment = framebuffer->getColorbuffer(colorAttachment);
if (attachment && attachment->isTexture())
{
- invalidateFBOAttachmentSwizzles(attachment, framebuffer->getColorbufferMipLevel(colorAttachment));
+ invalidateFBOAttachmentSwizzles(attachment, attachment->mipLevel());
}
}
gl::FramebufferAttachment *depthAttachment = framebuffer->getDepthbuffer();
if (depthAttachment && depthAttachment->isTexture())
{
- invalidateFBOAttachmentSwizzles(depthAttachment, framebuffer->getDepthbufferMipLevel());
+ invalidateFBOAttachmentSwizzles(depthAttachment, depthAttachment->mipLevel());
}
gl::FramebufferAttachment *stencilAttachment = framebuffer->getStencilbuffer();
if (stencilAttachment && stencilAttachment->isTexture())
{
- invalidateFBOAttachmentSwizzles(stencilAttachment, framebuffer->getStencilbufferMipLevel());
+ invalidateFBOAttachmentSwizzles(stencilAttachment, stencilAttachment->mipLevel());
}
}