summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 01:16:00 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 01:16:00 +0000
commit39ba4f01104e6935a2446fd7166ef29344a44149 (patch)
tree97ca3c45a17d08a3ea9a89432350bec9abda8f0b /gpu
parent26cb6c60d8bab0fac7fd885b7edc22ad6f3a4b9b (diff)
downloadchromium_src-39ba4f01104e6935a2446fd7166ef29344a44149.zip
chromium_src-39ba4f01104e6935a2446fd7166ef29344a44149.tar.gz
chromium_src-39ba4f01104e6935a2446fd7166ef29344a44149.tar.bz2
make disable-glsl-translator work again
TEST=none BUG=none Review URL: http://codereview.chromium.org/9812021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc19
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.cc2
-rw-r--r--gpu/command_buffer/service/gpu_switches.cc6
-rw-r--r--gpu/command_buffer/service/gpu_switches.h8
4 files changed, 28 insertions, 7 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6021a84..26c80f2 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1989,7 +1989,9 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
if ((gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 &&
!feature_info_->feature_flags().chromium_webglsl &&
!force_webgl_glsl_validation_) ||
- gfx::GetGLImplementation() == gfx::kGLImplementationMockGL) {
+ gfx::GetGLImplementation() == gfx::kGLImplementationMockGL ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGLSLTranslator)) {
use_shader_translator_ = false;
}
@@ -2018,6 +2020,11 @@ bool GLES2DecoderImpl::Initialize(
set_debug(true);
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGPUCommandLogging)) {
+ set_log_commands(true);
+ }
+
compile_shader_always_succeeds_ = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCompileShaderAlwaysSucceeds);
@@ -3121,7 +3128,9 @@ error::Error GLES2DecoderImpl::DoCommand(
const void* cmd_data) {
error::Error result = error::kNoError;
if (log_commands()) {
- LOG(INFO) << "[" << this << "]" << "cmd: " << GetCommandName(command);
+ // TODO(notme): Change this to a LOG/VLOG that works in release. Tried
+ // LOG(INFO), tried VLOG(1), no luck.
+ LOG(ERROR) << "[" << this << "]" << "cmd: " << GetCommandName(command);
}
unsigned int command_index = command - kStartPoint - 1;
if (command_index < arraysize(g_command_info)) {
@@ -3145,10 +3154,10 @@ error::Error GLES2DecoderImpl::DoCommand(
if (debug()) {
GLenum error;
while ((error = glGetError()) != GL_NO_ERROR) {
+ LOG(ERROR) << "[" << this << "] "
+ << "GL ERROR: " << GLES2Util::GetStringEnum(error) << " : "
+ << GetCommandName(command);
SetGLError(error, "GL error from driver");
- LOG(INFO) << "[" << this << "]"
- << "GL ERROR: " << GLES2Util::GetStringEnum(error) << " : "
- << GetCommandName(command);
}
}
} else {
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index c6500ab..65b357c 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -74,6 +74,8 @@ void GpuScheduler::PutChanged() {
command_buffer_->SetGetOffset(static_cast<int32>(parser_->get()));
if (error::IsError(error)) {
+ LOG(ERROR) << "[" << decoder_ << "] "
+ << "GPU PARSE ERROR: " << error;
command_buffer_->SetContextLostReason(decoder_->GetContextLostReason());
command_buffer_->SetParseError(error);
return;
diff --git a/gpu/command_buffer/service/gpu_switches.cc b/gpu/command_buffer/service/gpu_switches.cc
index d79613a..795df7e1 100644
--- a/gpu/command_buffer/service/gpu_switches.cc
+++ b/gpu/command_buffer/service/gpu_switches.cc
@@ -9,6 +9,12 @@ namespace switches {
// Turn on Calling GL Error after every command.
const char kCompileShaderAlwaysSucceeds[] = "compile-shader-always-succeeds";
+// Disable the GLSL translator.
+const char kDisableGLSLTranslator[] = "disable-glsl-translator";
+
+// Turn on Logging GPU commands.
+const char kEnableGPUCommandLogging[] = "enable-gpu-command-logging";
+
// Turn on Calling GL Error after every command.
const char kEnableGPUDebugging[] = "enable-gpu-debugging";
diff --git a/gpu/command_buffer/service/gpu_switches.h b/gpu/command_buffer/service/gpu_switches.h
index 82720fa9..21e90d6 100644
--- a/gpu/command_buffer/service/gpu_switches.h
+++ b/gpu/command_buffer/service/gpu_switches.h
@@ -8,10 +8,14 @@
#define GPU_COMMAND_BUFFER_SERVICE_GPU_SWITCHES_H_
#pragma once
+#include "gpu/gpu_export.h"
+
namespace switches {
-extern const char kCompileShaderAlwaysSucceeds[];
-extern const char kEnableGPUDebugging[];
+GPU_EXPORT extern const char kCompileShaderAlwaysSucceeds[];
+GPU_EXPORT extern const char kDisableGLSLTranslator[];
+GPU_EXPORT extern const char kEnableGPUCommandLogging[];
+GPU_EXPORT extern const char kEnableGPUDebugging[];
} // namespace switches