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

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

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 | « no previous file | gpu/command_buffer/common/gles2_cmd_utils.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.h
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h
index 71b05770ddb16c977dd0ad52413473baceaceca1..f6bb501b49c7c14c95f37faf0cdcdf57b447c44c 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils.h
@@ -59,6 +59,19 @@ class GLES2_UTILS_EXPORT GLES2Util {
public:
static const int kNumFaces = 6;
+ // Bits returned by GetChannelsForFormat
+ enum ChannelBits {
+ kRed = 0x1,
+ kGreen = 0x2,
+ kBlue = 0x4,
+ kAlpha = 0x8,
+ kDepth = 0x10000,
+ kStencil = 0x20000,
+
+ kRGB = kRed | kGreen | kBlue,
+ kRGBA = kRGB | kAlpha
+ };
+
struct EnumToString {
uint32 value;
const char* name;
@@ -106,13 +119,13 @@ class GLES2_UTILS_EXPORT GLES2Util {
static uint32 IndexToGLFaceTarget(int index);
- // Returns a bitmask for the channels the given format supports where
- // 0x1 is red
- // 0x2 is green
- // 0x4 is blue
- // 0x8 is alpha
+ // Returns a bitmask for the channels the given format supports.
+ // See ChannelBits.
static uint32 GetChannelsForFormat(int format);
+ // Returns a bitmask for the channels the given attachment type needs.
+ static uint32 GetChannelsNeededForAttachmentType(int type);
+
static bool IsNPOT(uint32 value) {
return value > 0 && (value & (value - 1)) != 0;
}
« no previous file with comments | « no previous file | gpu/command_buffer/common/gles2_cmd_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698