Commit 02edc79d authored by geofflang's avatar geofflang Committed by Commit bot

Revert of WebGL 2: generate appropriate error for different dimensions of...

Revert of WebGL 2: generate appropriate error for different dimensions of images attached to fbo (patchset #1 id:1 of https://codereview.chromium.org/1549393002/ )

Reason for revert:
This broke the WebglConformance.conformance2_rendering_draw_buffers test on mac.

Original issue's description:
> WebGL 2: generate appropriate error for different dimensions of images attached to fbo.
> This change fixed the bug in framebuffer-object-attachment.html
>
> BUG=295792
> TEST=conformance2/renderbuffers/framebuffer-object-attachment.html
>
> Committed: https://crrev.com/23cf53ece33a651b28a1d87e57f02a14f22d3c3d
> Cr-Commit-Position: refs/heads/master@{#367053}

TBR=kbr@chromium.org,zmo@chromium.org,bajones@chromium.org,qiankun.miao@intel.com,yunchao.he@intel.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=295792

Review URL: https://codereview.chromium.org/1555543002

Cr-Commit-Position: refs/heads/master@{#367070}
parent 36388503
......@@ -46,7 +46,6 @@ private:
GLsizei width() const override;
GLsizei height() const override;
GLsizei depth() const override;
GLenum format() const override;
GLenum type() const override;
bool isCubeComplete() const override;
......@@ -86,11 +85,6 @@ GLsizei WebGLRenderbufferAttachment::height() const
return m_renderbuffer->height();
}
GLsizei WebGLRenderbufferAttachment::depth() const
{
return 1;
}
GLenum WebGLRenderbufferAttachment::format() const
{
GLenum format = m_renderbuffer->internalFormat();
......@@ -166,7 +160,6 @@ private:
GLsizei width() const override;
GLsizei height() const override;
GLsizei depth() const override;
GLenum format() const override;
GLenum type() const override;
bool isCubeComplete() const override;
......@@ -212,11 +205,6 @@ GLsizei WebGLTextureAttachment::height() const
return m_texture->getHeight(m_target, m_level);
}
GLsizei WebGLTextureAttachment::depth() const
{
return m_texture->getDepth(m_target, m_level);
}
GLenum WebGLTextureAttachment::format() const
{
return m_texture->getInternalFormat(m_target, m_level);
......@@ -551,7 +539,7 @@ GLenum WebGLFramebuffer::colorBufferFormat() const
GLenum WebGLFramebuffer::checkStatus(const char** reason) const
{
unsigned count = 0;
GLsizei width = 0, height = 0, depth = 0;
GLsizei width = 0, height = 0;
WebGLAttachment* depthAttachment = nullptr;
WebGLAttachment* stencilAttachment = nullptr;
WebGLAttachment* depthStencilAttachment = nullptr;
......@@ -579,18 +567,15 @@ GLenum WebGLFramebuffer::checkStatus(const char** reason) const
depthStencilAttachment = attachment;
break;
}
// Note: In GLES 3, images for a framebuffer need not to have the same dimensions to be framebuffer complete.
// However, in Direct3D 11, on top of which OpenGL ES 3 behavior is emulated in Windows, all render targets
// must have the same size in all dimensions. In order to have consistent WebGL 2 behaviors across platforms,
// we generate FRAMEBUFFER_INCOMPLETE_DIMENSIONS in this situation.
if (!count) {
width = attachment->width();
height = attachment->height();
depth = attachment->depth();
} else {
if (width != attachment->width() || height != attachment->height() || depth != attachment->depth()) {
*reason = "attachments do not have the same dimensions";
return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
if (!isWebGL2OrHigher) {
if (!count) {
width = attachment->width();
height = attachment->height();
} else {
if (width != attachment->width() || height != attachment->height()) {
*reason = "attachments do not have the same dimensions";
return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
}
}
}
++count;
......
......@@ -43,7 +43,6 @@ public:
virtual GLsizei width() const = 0;
virtual GLsizei height() const = 0;
virtual GLsizei depth() const = 0;
virtual GLenum format() const = 0;
// For texture attachment, type() returns the type of the attached texture.
// For renderbuffer attachment, the type of the renderbuffer may vary with GL implementation.
......
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