summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 20:30:51 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 20:30:51 +0000
commit2cb1fa9f537b92908693eddc4489c38ab3318225 (patch)
treea013d5d4c7b79ededaf0589a73f503f96092bcba /gpu/command_buffer
parentf1917ed6945d79a12fe45957c46584dfe8771dbb (diff)
downloadchromium_src-2cb1fa9f537b92908693eddc4489c38ab3318225.zip
chromium_src-2cb1fa9f537b92908693eddc4489c38ab3318225.tar.gz
chromium_src-2cb1fa9f537b92908693eddc4489c38ab3318225.tar.bz2
Revert 47182 - 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: enable_shader_translation=1.
Review URL: http://codereview.chromium.org/1988011 TBR=alokp@chromium.org Review URL: http://codereview.chromium.org/2082004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index ef3eec0..5fa47fc 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -32,7 +32,13 @@
#include "gpu/command_buffer/service/shader_manager.h"
#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
#if !defined(GL_DEPTH24_STENCIL8)
#define GL_DEPTH24_STENCIL8 0x88F0
@@ -1427,7 +1433,7 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context,
// mailing list archives.
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
-#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER) && !defined(UNIT_TEST)
+#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
// Initialize GLSL ES to GLSL translator.
if (!ShInitialize()) {
DLOG(ERROR) << "Could not initialize GLSL translator.";
@@ -1785,7 +1791,7 @@ void GLES2DecoderImpl::Destroy() {
default_context_.reset();
}
-#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) && !defined(UNIT_TEST)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
// Terminate GLSL translator.
ShFinalize();
@@ -2933,7 +2939,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) && !defined(UNIT_TEST)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
#if defined(GLES2_GPU_SERVICE_TRANSLATE_SHADER)
int dbg_options = 0;
EShLanguage language = info->shader_type() == GL_VERTEX_SHADER ?
@@ -2953,7 +2959,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;
}
@@ -2964,7 +2970,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) && !defined(UNIT_TEST)
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
#ifdef GLES2_GPU_SERVICE_TRANSLATE_SHADER
ShDestruct(compiler);
#endif // GLES2_GPU_SERVICE_TRANSLATE_SHADER