diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 03:25:10 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 03:25:10 +0000 |
commit | 062c38b3edec6aab91e693273000caa07d653eed (patch) | |
tree | eb84ebee639718546e23b989a17d0a7b0233f9f1 /gpu | |
parent | 9a7656ecaaa0e999ea3465dc1cc108bf4e1cbdc1 (diff) | |
download | chromium_src-062c38b3edec6aab91e693273000caa07d653eed.zip chromium_src-062c38b3edec6aab91e693273000caa07d653eed.tar.gz chromium_src-062c38b3edec6aab91e693273000caa07d653eed.tar.bz2 |
Add cmd line switch to make compileShader always succeed.
This is so we can test WebGL Conformance tests since the
GLSL spec 1.0.17 10.27 says that compileShader can succeed
for bad shaders as long as linkProgram doesn't link.
TEST=ran OpenGL ES 2.0 conformance tests
BUG=110478
R=apatrick@chromium.org
Review URL: http://codereview.chromium.org/9242016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 10 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_switches.cc | 3 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_switches.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 3679126..352d044 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1498,6 +1498,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, bool force_webgl_glsl_validation_; bool derivatives_explicitly_enabled_; + bool compile_shader_always_succeeds_; + #if defined(OS_MACOSX) typedef std::map<GLuint, CFTypeRef> TextureToIOSurfaceMap; TextureToIOSurfaceMap texture_to_io_surface_map_; @@ -1890,7 +1892,8 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) needs_mac_nvidia_driver_workaround_(false), needs_glsl_built_in_function_emulation_(false), force_webgl_glsl_validation_(false), - derivatives_explicitly_enabled_(false) { + derivatives_explicitly_enabled_(false), + compile_shader_always_succeeds_(false) { DCHECK(group); attrib_0_value_.v[0] = 0.0f; @@ -1934,6 +1937,9 @@ bool GLES2DecoderImpl::Initialize( set_debug(true); } + compile_shader_always_succeeds_ = CommandLine::ForCurrentProcess()->HasSwitch( + switches::kCompileShaderAlwaysSucceeds); + // Take ownership of the GLSurface. TODO(apatrick): once the parent / child // context is retired, the decoder should not take an initial surface as // an argument to this function. @@ -5305,7 +5311,7 @@ void GLES2DecoderImpl::DoGetShaderiv( *params = info->source() ? info->source()->size() + 1 : 0; return; case GL_COMPILE_STATUS: - *params = info->IsValid(); + *params = compile_shader_always_succeeds_ ? true : info->IsValid(); return; case GL_INFO_LOG_LENGTH: *params = info->log_info() ? info->log_info()->size() + 1 : 0; diff --git a/gpu/command_buffer/service/gpu_switches.cc b/gpu/command_buffer/service/gpu_switches.cc index 0c6dee5..d79613a 100644 --- a/gpu/command_buffer/service/gpu_switches.cc +++ b/gpu/command_buffer/service/gpu_switches.cc @@ -7,6 +7,9 @@ namespace switches { // Turn on Calling GL Error after every command. +const char kCompileShaderAlwaysSucceeds[] = "compile-shader-always-succeeds"; + +// Turn on Calling GL Error after every command. const char kEnableGPUDebugging[] = "enable-gpu-debugging"; } // namespace switches diff --git a/gpu/command_buffer/service/gpu_switches.h b/gpu/command_buffer/service/gpu_switches.h index 4f30691..82720fa9 100644 --- a/gpu/command_buffer/service/gpu_switches.h +++ b/gpu/command_buffer/service/gpu_switches.h @@ -10,6 +10,7 @@ namespace switches { +extern const char kCompileShaderAlwaysSucceeds[]; extern const char kEnableGPUDebugging[]; } // namespace switches |