Index: third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
index 4eeaa89566d14da3876eb791002d6ed9f2555805..ccd6d8caaf99ad3548c4e5d3c4e10b6760fbda4e 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
@@ -46,7 +46,6 @@ |
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 @@ |
return m_renderbuffer->height(); |
} |
-GLsizei WebGLRenderbufferAttachment::depth() const |
-{ |
- return 1; |
-} |
- |
GLenum WebGLRenderbufferAttachment::format() const |
{ |
GLenum format = m_renderbuffer->internalFormat(); |
@@ -166,7 +160,6 @@ |
GLsizei width() const override; |
GLsizei height() const override; |
- GLsizei depth() const override; |
GLenum format() const override; |
GLenum type() const override; |
bool isCubeComplete() const override; |
@@ -210,11 +203,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 |
@@ -551,7 +539,7 @@ |
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 @@ |
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; |