summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/program_manager.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 18:54:41 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 18:54:41 +0000
commite518616f8e5f78485c144591d2c78da6bf2ad175 (patch)
treea1cf7d34b42610e8851e96144a713bfa927ef185 /gpu/command_buffer/service/program_manager.cc
parent3014c2191c848afd47e9528deea70e54708ea0aa (diff)
downloadchromium_src-e518616f8e5f78485c144591d2c78da6bf2ad175.zip
chromium_src-e518616f8e5f78485c144591d2c78da6bf2ad175.tar.gz
chromium_src-e518616f8e5f78485c144591d2c78da6bf2ad175.tar.bz2
Changes required to get glValidateProgram to work
correctly. TEST=unit tests and conformance tests. BUG=none Review URL: http://codereview.chromium.org/2725006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/program_manager.cc')
-rw-r--r--gpu/command_buffer/service/program_manager.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 2dcb368..66605b3 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -39,6 +39,15 @@ void ProgramManager::ProgramInfo::Reset() {
sampler_indices_.clear();
attrib_location_to_index_map_.clear();
uniform_location_to_index_map_.clear();
+ UpdateLogInfo();
+}
+
+void ProgramManager::ProgramInfo::UpdateLogInfo() {
+ GLint len = 0;
+ glGetProgramiv(service_id_, GL_INFO_LOG_LENGTH, &len);
+ scoped_array<char> temp(new char[len]);
+ glGetProgramInfoLog(service_id_, len, &len, temp.get());
+ set_log_info(std::string(temp.get(), len));
}
void ProgramManager::ProgramInfo::Update() {
@@ -261,6 +270,17 @@ void ProgramManager::ProgramInfo::GetProgramiv(GLenum pname, GLint* params) {
case GL_LINK_STATUS:
*params = valid_;
break;
+ case GL_INFO_LOG_LENGTH:
+ // Notice +1 to accomodate NULL terminator.
+ *params = log_info_.size() + 1;
+ break;
+ case GL_VALIDATE_STATUS:
+ if (!CanLink()) {
+ *params = GL_FALSE;
+ } else {
+ glGetProgramiv(service_id_, pname, params);
+ }
+ break;
default:
glGetProgramiv(service_id_, pname, params);
break;
@@ -280,7 +300,7 @@ void ProgramManager::ProgramInfo::DetachShader(
bool ProgramManager::ProgramInfo::CanLink() const {
for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- if (!attached_shaders_[ii]) {
+ if (!attached_shaders_[ii] || !attached_shaders_[ii]->IsValid()) {
return false;
}
}