summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 19:14:06 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 19:14:06 +0000
commitbc10076cb2c38dddee1f702c5cbaa724f122be2c (patch)
treeb0b1baa37fa6498bf970fc1f4c7f73345551de73
parent95ff077352e9cf1f78b79b2aa86e5675cbafae1d (diff)
downloadchromium_src-bc10076cb2c38dddee1f702c5cbaa724f122be2c.zip
chromium_src-bc10076cb2c38dddee1f702c5cbaa724f122be2c.tar.gz
chromium_src-bc10076cb2c38dddee1f702c5cbaa724f122be2c.tar.bz2
Landing revision 47182 again: Added dependency on ANGLE for all platforms now that it compiles on mac and linx. Also added a GYP flag 'enable_shader_translation'. To enable shader translation define env variable: GYP_DEFINES="enable_shader_translation=1".
Review URL: http://codereview.chromium.org/2134002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47295 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc13
-rw-r--r--gpu/gpu.gyp56
2 files changed, 22 insertions, 47 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 63f8626..d193c1e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -33,9 +33,6 @@
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/GLES2/gles2_command_buffer.h"
-// TODO(alokp): Remove GLES2_GPU_SERVICE_TRANSLATE_SHADER guard
-// as soon as translator is ready.
-//#define GLES2_GPU_SERVICE_TRANSLATE_SHADER
#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
#endif // GLES2_GPU_SERVICE_TRANSLATE_SHADER
@@ -1458,7 +1455,7 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context,
// mailing list archives.
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
-#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
+#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER) && !defined(UNIT_TEST)
// Initialize GLSL ES to GLSL translator.
if (!ShInitialize()) {
DLOG(ERROR) << "Could not initialize GLSL translator.";
@@ -1816,7 +1813,7 @@ void GLES2DecoderImpl::Destroy() {
default_context_.reset();
}
-#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) && !defined(UNIT_TEST)
#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
// Terminate GLSL translator.
ShFinalize();
@@ -3069,7 +3066,7 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
// Translate GL ES 2.0 shader to Desktop GL shader and pass that to
// glShaderSource and then glCompileShader.
const char* shader_src = info->source().c_str();
-#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) && !defined(UNIT_TEST)
#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
int dbg_options = 0;
EShLanguage language = info->shader_type() == GL_VERTEX_SHADER ?
@@ -3089,7 +3086,7 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
dbg_options)) {
// TODO(alokp): Ask gman where to set compile-status and info-log.
// May be add member variables to ShaderManager::ShaderInfo?
- const char* info_log = ShGetInfoLog(compiler);
+ //const char* info_log = ShGetInfoLog(compiler);
ShDestruct(compiler);
return;
}
@@ -3101,7 +3098,7 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
glShaderSource(info->service_id(), 1, &shader_src, NULL);
glCompileShader(info->service_id());
-#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) && !defined(UNIT_TEST)
#ifdef GLES2_GPU_SERVICE_TRANSLATE_SHADER
ShDestruct(compiler);
#endif // GLES2_GPU_SERVICE_TRANSLATE_SHADER
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index dc2c87b..b52d1fe 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -25,6 +25,9 @@
'command_buffer/service/gl_utils.h',
'command_buffer/service/gpu_processor.h',
'command_buffer/service/gpu_processor.cc',
+ 'command_buffer/service/gpu_processor_linux.cc',
+ 'command_buffer/service/gpu_processor_mac.cc',
+ 'command_buffer/service/gpu_processor_win.cc',
'command_buffer/service/gpu_processor_mock.h',
'command_buffer/service/id_manager.h',
'command_buffer/service/id_manager.cc',
@@ -37,29 +40,7 @@
'command_buffer/service/texture_manager.h',
'command_buffer/service/texture_manager.cc',
],
- 'conditions': [
- ['OS == "linux"',
- {
- 'gpu_service_source_files': [
- 'command_buffer/service/gpu_processor_linux.cc',
- ],
- },
- ],
- ['OS == "win"',
- {
- 'gpu_service_source_files': [
- 'command_buffer/service/gpu_processor_win.cc',
- ],
- },
- ],
- ['OS == "mac"',
- {
- 'gpu_service_source_files': [
- 'command_buffer/service/gpu_processor_mac.cc',
- ],
- },
- ],
- ],
+ 'enable_shader_translation%': 0,
},
'targets': [
{
@@ -284,22 +265,19 @@
'<@(gpu_service_source_files)',
],
'conditions': [
- ['OS == "linux"',
- {
- 'dependencies': [
- '../build/linux/system.gyp:gtk',
- ],
- },
- ],
- #TODO(alokp): Remove os-conditional when translator_glsl starts
- #compiling on all platforms.
- ['OS == "win"',
- {
- 'dependencies': [
- '../third_party/angle/src/build_angle.gyp:translator_glsl',
- ],
- },
- ],
+ ['OS == "linux"', {
+ 'dependencies': [
+ '../build/linux/system.gyp:gtk',
+ ],
+ }],
+ ['enable_shader_translation==1', {
+ 'defines': [
+ 'GLES2_GPU_SERVICE_TRANSLATE_SHADER',
+ ],
+ 'dependencies': [
+ '../third_party/angle/src/build_angle.gyp:translator_glsl',
+ ],
+ }],
],
},
{