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

Unified Diff: gpu/perftests/texture_upload_perftest.cc

Issue 1022923002: gpu: Benchmark GL_RED instead of GL_LUMINANCE on OpenGL ES3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/perftests/texture_upload_perftest.cc
diff --git a/gpu/perftests/texture_upload_perftest.cc b/gpu/perftests/texture_upload_perftest.cc
index add6343e2aa57213fe583b3d5a2a249671b53573..421108497ed3614f50d64e0d82902f40d28b4513 100644
--- a/gpu/perftests/texture_upload_perftest.cc
+++ b/gpu/perftests/texture_upload_perftest.cc
@@ -20,14 +20,15 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_enums.h"
#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_version_info.h"
#include "ui/gl/gpu_timing.h"
#include "ui/gl/scoped_make_current.h"
namespace gpu {
namespace {
-const int kUploadPerfWarmupRuns = 10;
-const int kUploadPerfTestRuns = 100;
+const int kUploadPerfWarmupRuns = 5;
+const int kUploadPerfTestRuns = 30;
#define SHADER(Src) #Src
@@ -126,7 +127,7 @@ bool CompareBufferToRGBABuffer(GLenum format,
case GL_LUMINANCE: // (L_t, L_t, L_t, 1)
expected[1] = pixels[pixels_index];
expected[2] = pixels[pixels_index];
- case GL_RED_EXT: // (R_t, 0, 0, 1)n
+ case GL_RED: // (R_t, 0, 0, 1)
expected[0] = pixels[pixels_index];
expected[3] = 255;
break;
@@ -386,17 +387,21 @@ TEST_F(TextureUploadPerfTest, glTexImage2d) {
int sizes[] = {21, 128, 256, 512, 1024};
std::vector<GLenum> formats;
formats.push_back(GL_RGBA);
- // Used by default for ResourceProvider::yuv_resource_format_.
- formats.push_back(GL_LUMINANCE);
+
+ if (!gl_context_->GetVersionInfo()->is_es3) {
+ // Used by default for ResourceProvider::yuv_resource_format_.
+ formats.push_back(GL_LUMINANCE);
+ }
ui::ScopedMakeCurrent smc(gl_context_.get(), surface_.get());
- bool has_texture_rg = gl_context_->HasExtension("GL_EXT_texture_rg") ||
- gl_context_->HasExtension("GL_ARB_texture_rg");
+ const bool has_texture_rg = gl_context_->GetVersionInfo()->is_es3 ||
+ gl_context_->HasExtension("GL_EXT_texture_rg") ||
+ gl_context_->HasExtension("GL_ARB_texture_rg");
if (has_texture_rg) {
// Used as ResourceProvider::yuv_resource_format_ if
// {ARB,EXT}_texture_rg are available.
- formats.push_back(GL_RED_EXT);
+ formats.push_back(GL_RED);
}
for (int side : sizes) {
ASSERT_GE(fbo_size_.width(), side);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698