Permalink
Browse files

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
  • Loading branch information...
1 parent 26cb6c6 commit 39ba4f01104e6935a2446fd7166ef29344a44149 gman@chromium.org committed Mar 26, 2012
@@ -29,6 +29,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_switches.h"
#include "ui/gfx/gl/gl_context.h"
@@ -681,15 +682,19 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
// Propagate relevant command line switches.
static const char* const kSwitchNames[] = {
+ switches::kCompileShaderAlwaysSucceeds,
switches::kDisableBreakpad,
switches::kDisableGLMultisampling,
switches::kDisableGpuDriverBugWorkarounds,
switches::kDisableGpuSandbox,
switches::kReduceGpuSandbox,
+ switches::kDisableGLSLTranslator,
switches::kDisableGpuVsync,
switches::kDisableGpuWatchdog,
switches::kDisableImageTransportSurface,
switches::kDisableLogging,
+ switches::kEnableGPUCommandLogging,
+ switches::kEnableGPUDebugging,
switches::kEnableGPUServiceLogging,
switches::kEnableLogging,
#if defined(OS_MACOSX)
@@ -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 {
@@ -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;
@@ -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";
@@ -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

0 comments on commit 39ba4f0

Please sign in to comment.