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

Unified Diff: gpu/perftests/texture_upload_perftest.cc

Issue 1011503002: Set GLSL "precision" only if using OpenGL ES. (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 89e901aea0839719b6eb76a2c07ba0875fdeba14..add6343e2aa57213fe583b3d5a2a249671b53573 100644
--- a/gpu/perftests/texture_upload_perftest.cc
+++ b/gpu/perftests/texture_upload_perftest.cc
@@ -44,9 +44,12 @@ SHADER(
v_texCoord = a_texCoord;
}
);
-const char kFragmentShader[] =
+const char kShaderDefaultFloatPrecision[] =
SHADER(
precision mediump float;
+);
+const char kFragmentShader[] =
+SHADER(
uniform sampler2D a_texture;
varying vec2 v_texCoord;
void main() {
@@ -187,7 +190,12 @@ class TextureUploadPerfTest : public testing::Test {
// Prepare a simple program and a vertex buffer that will be
// used to draw a quad on the offscreen surface.
vertex_shader_ = LoadShader(GL_VERTEX_SHADER, kVertexShader);
- fragment_shader_ = LoadShader(GL_FRAGMENT_SHADER, kFragmentShader);
+
+ bool is_gles = gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2;
+ fragment_shader_ = LoadShader(
+ GL_FRAGMENT_SHADER,
+ base::StringPrintf("%s%s", is_gles ? kShaderDefaultFloatPrecision : "",
+ kFragmentShader).c_str());
program_object_ = glCreateProgram();
CHECK_NE(0u, program_object_);
« 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