Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp

Issue 1465173002: Check framebuffer texture attachments are cube complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 348c02d7aaea6707c807c203935003bae30bace7..6a44cef61f1d4c3fce8ad888de7b7b43766df3f5 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp
@@ -50,6 +50,7 @@ private:
GLsizei height() const override;
GLenum format() const override;
GLenum type() const override;
+ bool isCubeComplete() const override;
WebGLSharedObject* object() const override;
bool isSharedObject(WebGLSharedObject*) const override;
bool valid() const override;
@@ -143,6 +144,11 @@ GLenum WebGLRenderbufferAttachment::type() const
return WebGLTexture::getValidTypeForInternalFormat(m_renderbuffer->internalFormat());
}
+bool WebGLRenderbufferAttachment::isCubeComplete() const
+{
+ return false;
zmo 2015/11/23 19:40:44 Maybe ASSERT_NOT_REACHED() here?
qiankun 2015/11/24 04:11:42 Done.
+}
+
class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachment {
public:
static WebGLFramebuffer::WebGLAttachment* create(WebGLTexture*, GLenum target, GLint level, GLint layer);
@@ -157,6 +163,7 @@ private:
GLsizei height() const override;
GLenum format() const override;
GLenum type() const override;
+ bool isCubeComplete() const override;
WebGLSharedObject* object() const override;
bool isSharedObject(WebGLSharedObject*) const override;
bool valid() const override;
@@ -254,6 +261,11 @@ GLenum WebGLTextureAttachment::type() const
return m_texture->getType(m_target, m_level);
}
+bool WebGLTextureAttachment::isCubeComplete() const
+{
+ return m_texture->isCubeComplete();
+}
+
bool isColorRenderable(GLenum internalformat, bool includesFloat)
{
switch (internalformat) {
@@ -450,6 +462,12 @@ bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GLe
*reason = "attachment has a 0 dimension";
return false;
}
+
+ if (attachedObject->object()->isTexture() && !attachedObject->isCubeComplete()) {
+ *reason ="attachment is not cube complete";
Ken Russell (switch to Gerrit) 2015/11/24 00:37:03 Add space after =.
qiankun 2015/11/24 04:11:43 Done.
+ return false;
+ }
+
return true;
}
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h ('k') | third_party/WebKit/Source/modules/webgl/WebGLTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698