Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: gpu/command_buffer/service/program_manager.cc

Issue 2158793006: program_manager::CheckPacking, sends full sh::ShaderVariable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/program_manager.cc
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index daaa68c95dcf487b23ea9894a9d8dd1ef50abe91..50d9f42802c18f539db5ada5a4997c01f71f84d7 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -1862,7 +1862,7 @@ bool Program::CheckVaryingsPacking(
const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map());
const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map());
- std::map<std::string, ShVariableInfo> combined_map;
+ std::map<std::string, const sh::ShaderVariable*> combined_map;
for (const auto& key_value : *fragment_varyings) {
if (!key_value.second.staticUse && option == kCountOnlyStaticallyUsed)
@@ -1876,26 +1876,18 @@ bool Program::CheckVaryingsPacking(
continue;
}
- ShVariableInfo var;
- var.type = static_cast<sh::GLenum>(key_value.second.type);
- var.size = std::max(1u, key_value.second.arraySize);
- combined_map[key_value.first] = var;
+ combined_map[key_value.first] = &key_value.second;
}
if (combined_map.size() == 0)
return true;
- std::unique_ptr<ShVariableInfo[]> variables(
- new ShVariableInfo[combined_map.size()]);
- size_t index = 0;
+ std::vector<sh::ShaderVariable> variables;
for (const auto& key_value : combined_map) {
- variables[index].type = key_value.second.type;
- variables[index].size = key_value.second.size;
- ++index;
+ variables.push_back(*key_value.second);
}
return ShCheckVariablesWithinPackingLimits(
static_cast<int>(manager_->max_varying_vectors()),
- variables.get(),
- combined_map.size());
+ variables);
}
void Program::GetProgramInfo(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698