diff options
author | dcastagna <dcastagna@chromium.org> | 2015-03-19 16:00:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-19 23:01:05 +0000 |
commit | 2208da11bfcabfa5bf0e05fbe614a04715f08b4d (patch) | |
tree | d63b1ced52e94f45eae3fa79959e2068d15f8f6c /gpu | |
parent | 5f32298dbf36a4c48ef02d18b6acb1f2be759195 (diff) | |
download | chromium_src-2208da11bfcabfa5bf0e05fbe614a04715f08b4d.zip chromium_src-2208da11bfcabfa5bf0e05fbe614a04715f08b4d.tar.gz chromium_src-2208da11bfcabfa5bf0e05fbe614a04715f08b4d.tar.bz2 |
gpu: Benchmark GL_RED instead of GL_LUMINANCE on OpenGL ES3.
This patch tests GL_LUMINANCE only when OpenGL is not ES3
and tests GL_RED when on OpengGL ES3.
This change should allow crrev.com/1022603002 to run on Android perf
bots. Without this patch crrev.com/1022603002 fails on perf bots because
glTextureStorage2D doesn't always accept GL_LUMINANCE8 as
internalformat.
glTextureStorage2D has been added to OpenGL ES3 and it's available
as an extension (GL_{EXT,ARB}_texture_storage) prior to that.
If glTextureStorage2D is availabe via the extension it accepts
GL_LUMINANCE8_EXT as internal format, otherwise it doesn't.
BUG=468748
Review URL: https://codereview.chromium.org/1022923002
Cr-Commit-Position: refs/heads/master@{#321462}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/perftests/texture_upload_perftest.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gpu/perftests/texture_upload_perftest.cc b/gpu/perftests/texture_upload_perftest.cc index add6343..4211084 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); |