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

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

Issue 1403483002: Update CopyTexImage2D to do internal format validation in ES3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unsigned integer format Created 5 years, 2 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
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 b6533a29cdd18dce7bb8224bcc0582128ad7748b..aa048c08782ddddb557e1fdedf8b4759c9b0f42d 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -1210,6 +1210,39 @@ bool GLES2Util::IsIntegerFormat(uint32_t internal_format) {
IsSignedIntegerFormat(internal_format));
}
+// static
+bool GLES2Util::IsFloatFormat(uint32_t internal_format) {
+ switch (internal_format) {
+ case GL_R16F:
+ case GL_R32F:
+ case GL_RG16F:
+ case GL_RG32F:
+ case GL_R11F_G11F_B10F:
+ case GL_RGB16F:
+ case GL_RGB32F:
+ case GL_RGBA16F:
+ case GL_RGBA32F:
+ case GL_DEPTH_COMPONENT32F:
+ case GL_DEPTH32F_STENCIL8:
Zhenyao Mo 2015/10/13 01:19:31 I think you only need to include color formats.
qiankun 2015/10/13 14:28:01 Done.
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+bool GLES2Util::IsSRGBFormat(uint32_t internal_format) {
+ switch (internal_format) {
+ case GL_SRGB8:
+ case GL_SRGB8_ALPHA8:
+ case GL_COMPRESSED_SRGB8_ETC2:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
Zhenyao Mo 2015/10/13 01:19:32 I don't think you need to include compressed forma
qiankun 2015/10/13 14:28:01 Done.
+ return true;
+ default:
+ return false;
+ }
+}
namespace {

Powered by Google App Engine
This is Rietveld 408576698