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

Unified Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 9732010: Check that attachments are the correct type for the attachment type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months 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
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_utils.cc
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 23e0ac43426070507f8232da6d5e392d87930734..7f75d3b808a6c3d11fad5a01cadbb9f7859fe9eb 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -543,21 +543,49 @@ uint32 GLES2Util::IndexToGLFaceTarget(int index) {
uint32 GLES2Util::GetChannelsForFormat(int format) {
switch (format) {
case GL_ALPHA:
- return 0x0008;
+ case GL_ALPHA16F_EXT:
+ case GL_ALPHA32F_EXT:
+ return kAlpha;
case GL_LUMINANCE:
- return 0x0007;
+ return kRGB;
case GL_LUMINANCE_ALPHA:
- return 0x000F;
+ return kRGBA;
case GL_RGB:
case GL_RGB8_OES:
case GL_RGB565:
- return 0x0007;
+ case GL_RGB16F_EXT:
+ case GL_RGB32F_EXT:
+ return kRGB;
case GL_BGRA_EXT:
+ case GL_BGRA8_EXT:
+ case GL_RGBA16F_EXT:
+ case GL_RGBA32F_EXT:
case GL_RGBA:
case GL_RGBA8_OES:
case GL_RGBA4:
case GL_RGB5_A1:
- return 0x000F;
+ return kRGBA;
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT:
+ return kDepth;
+ case GL_STENCIL_INDEX8:
+ return kStencil;
+ case GL_DEPTH_STENCIL_OES:
+ case GL_DEPTH24_STENCIL8_OES:
+ return kDepth | kStencil;
+ default:
+ return 0x0000;
+ }
+}
+
+uint32 GLES2Util::GetChannelsNeededForAttachmentType(int type) {
+ switch (type) {
+ case GL_COLOR_ATTACHMENT0:
+ return kRGBA;
+ case GL_DEPTH_ATTACHMENT:
+ return kDepth;
+ case GL_STENCIL_ATTACHMENT:
+ return kStencil;
default:
return 0x0000;
}
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698