Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index c5b670446e81f79ffd5bd6009d5cec68a0751a63..b12dae71a5a632a8f7ed14ba36694b267c6fab0b 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -1362,6 +1362,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, |
| surface_->DeferDraws(); |
| } |
| + void ForceCompileShaderIfPending(ShaderManager::ShaderInfo* info); |
| + |
| // Generate a member function prototype for each command in an automated and |
| // typesafe way. |
| #define GLES2_CMD_OP(name) \ |
| @@ -5126,6 +5128,25 @@ void GLES2DecoderImpl::PerformanceWarning(const std::string& msg) { |
| LogMessage(std::string("PERFORMANCE WARNING: ") + msg); |
| } |
| +void GLES2DecoderImpl::ForceCompileShaderIfPending( |
| + ShaderManager::ShaderInfo* info) { |
| + if (info->compilation_status() == |
| + ShaderManager::ShaderInfo::PENDING_DEFERRED_COMPILE) { |
| + |
| + ShaderTranslator* translator = NULL; |
| + if (use_shader_translator_) { |
| + translator = info->shader_type() == GL_VERTEX_SHADER ? |
| + vertex_translator_.get() : fragment_translator_.get(); |
| + } |
| + // We know there will be know errors, because we only defer compilation on |
|
greggman
2012/07/23 22:13:03
s/know errors/no errors/
dmurph
2012/07/23 22:18:58
Done.
|
| + // shaders that were previously compiled successfully. |
| + program_manager()->ForceCompileShader(info->deferred_compilation_source(), |
| + info, |
| + translator, |
| + feature_info_); |
| + } |
| +} |
| + |
| void GLES2DecoderImpl::CopyRealGLErrorsToWrapper() { |
| GLenum error; |
| while ((error = glGetError()) != GL_NO_ERROR) { |
| @@ -5843,6 +5864,7 @@ void GLES2DecoderImpl::DoGetShaderiv( |
| *params = info->log_info() ? info->log_info()->size() + 1 : 0; |
| return; |
| case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE: |
| + ForceCompileShaderIfPending(info); |
| *params = info->translated_source() ? |
| info->translated_source()->size() + 1 : 0; |
| return; |
| @@ -5880,6 +5902,7 @@ error::Error GLES2DecoderImpl::HandleGetTranslatedShaderSourceANGLE( |
| bucket->SetSize(0); |
| return error::kNoError; |
| } |
| + ForceCompileShaderIfPending(info); |
| bucket->SetFromString(info->translated_source() ? |
| info->translated_source()->c_str() : NULL); |