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

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: add assert_not_reached and add missing space 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..68cc4c758a6a217fdad755fad2d4846557757c46 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,12 @@ GLenum WebGLRenderbufferAttachment::type() const
return WebGLTexture::getValidTypeForInternalFormat(m_renderbuffer->internalFormat());
}
+bool WebGLRenderbufferAttachment::isCubeComplete() const
+{
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachment {
public:
static WebGLFramebuffer::WebGLAttachment* create(WebGLTexture*, GLenum target, GLint level, GLint layer);
@@ -157,6 +164,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 +262,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 +463,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";
+ 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