Commit a7ff3a48 by Nicolas Capens

Allow 0x0 dimension default framebuffers.

Bug 23041739 Change-Id: I1bec1fa05e8cf81864f8c0c2f49cf9c8093de5e0 Reviewed-on: https://swiftshader-review.googlesource.com/3934Reviewed-by: 's avatarGreg Hartman <ghartman@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent b602f0dc
...@@ -252,7 +252,7 @@ namespace gl ...@@ -252,7 +252,7 @@ namespace gl
Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{ {
if(width == 0 || height == 0 || height > OUTLINE_RESOLUTION) if(height > OUTLINE_RESOLUTION)
{ {
ERR("Invalid parameters: %dx%d", width, height); ERR("Invalid parameters: %dx%d", width, height);
return 0; return 0;
......
...@@ -210,7 +210,7 @@ namespace es1 ...@@ -210,7 +210,7 @@ namespace es1
egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{ {
if(width == 0 || height == 0 || height > OUTLINE_RESOLUTION) if(height > OUTLINE_RESOLUTION)
{ {
ERR("Invalid parameters: %dx%d", width, height); ERR("Invalid parameters: %dx%d", width, height);
return 0; return 0;
......
...@@ -455,12 +455,4 @@ DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuf ...@@ -455,12 +455,4 @@ DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuf
mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER_OES : GL_NONE_OES; mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER_OES : GL_NONE_OES;
} }
GLenum DefaultFramebuffer::completeness()
{
// The default framebuffer should always be complete
ASSERT(Framebuffer::completeness() == GL_FRAMEBUFFER_COMPLETE_OES);
return GL_FRAMEBUFFER_COMPLETE_OES;
}
} }
...@@ -83,8 +83,6 @@ class DefaultFramebuffer : public Framebuffer ...@@ -83,8 +83,6 @@ class DefaultFramebuffer : public Framebuffer
{ {
public: public:
DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil); DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil);
virtual GLenum completeness();
}; };
} }
......
...@@ -794,7 +794,7 @@ egl::Image *createBackBuffer(int width, int height, const egl::Config *config) ...@@ -794,7 +794,7 @@ egl::Image *createBackBuffer(int width, int height, const egl::Config *config)
egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{ {
if(width == 0 || height == 0 || height > OUTLINE_RESOLUTION) if(height > OUTLINE_RESOLUTION)
{ {
ERR("Invalid parameters: %dx%d", width, height); ERR("Invalid parameters: %dx%d", width, height);
return 0; return 0;
......
...@@ -219,7 +219,7 @@ namespace es2 ...@@ -219,7 +219,7 @@ namespace es2
egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{ {
if(width == 0 || height == 0 || height > OUTLINE_RESOLUTION) if(height > OUTLINE_RESOLUTION)
{ {
ERR("Invalid parameters: %dx%d", width, height); ERR("Invalid parameters: %dx%d", width, height);
return 0; return 0;
......
...@@ -507,12 +507,4 @@ DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuf ...@@ -507,12 +507,4 @@ DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuf
mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER : GL_NONE; mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER : GL_NONE;
} }
GLenum DefaultFramebuffer::completeness()
{
// The default framebuffer should always be complete
ASSERT(Framebuffer::completeness() == GL_FRAMEBUFFER_COMPLETE);
return GL_FRAMEBUFFER_COMPLETE;
}
} }
...@@ -89,8 +89,6 @@ class DefaultFramebuffer : public Framebuffer ...@@ -89,8 +89,6 @@ class DefaultFramebuffer : public Framebuffer
{ {
public: public:
DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil); DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil);
virtual GLenum completeness();
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment