Commit 8bd42c20 authored by zmo's avatar zmo Committed by Commit bot

ASSERT each linkProgram leads to empty cache in ProgramInfoManager.

The current mechanism is to clean all cache, which is very misleading.

Everytime we call LinkProgram, we simply delete the Program in the map,
getting rid of all cahces, and create a new Program.

BUG=429053
TEST=gpu_unittests
R=bajones@chromium.org

Review URL: https://codereview.chromium.org/933393003

Cr-Commit-Position: refs/heads/master@{#316937}
parent aada8ca5
...@@ -332,11 +332,10 @@ void ProgramInfoManager::Program::UpdateES2(const std::vector<int8>& result) { ...@@ -332,11 +332,10 @@ void ProgramInfoManager::Program::UpdateES2(const std::vector<int8>& result) {
if (!link_status_) { if (!link_status_) {
return; return;
} }
attrib_infos_.clear(); DCHECK_EQ(0u, attrib_infos_.size());
uniform_infos_.clear(); DCHECK_EQ(0u, uniform_infos_.size());
frag_data_locations_.clear(); DCHECK_EQ(0, max_attrib_name_length_);
max_attrib_name_length_ = 0; DCHECK_EQ(0, max_uniform_name_length_);
max_uniform_name_length_ = 0;
const ProgramInput* inputs = LocalGetAs<const ProgramInput*>( const ProgramInput* inputs = LocalGetAs<const ProgramInput*>(
result, sizeof(*header), result, sizeof(*header),
sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms)); sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms));
...@@ -382,8 +381,8 @@ void ProgramInfoManager::Program::UpdateES3UniformBlocks( ...@@ -382,8 +381,8 @@ void ProgramInfoManager::Program::UpdateES3UniformBlocks(
// This should only happen on a lost context. // This should only happen on a lost context.
return; return;
} }
uniform_blocks_.clear(); DCHECK_EQ(0u, uniform_blocks_.size());
active_uniform_block_max_name_length_ = 0; DCHECK_EQ(0u, active_uniform_block_max_name_length_);
// |result| comes from GPU process. We consider it trusted data. Therefore, // |result| comes from GPU process. We consider it trusted data. Therefore,
// no need to check for overflows as the GPU side did the checks already. // no need to check for overflows as the GPU side did the checks already.
...@@ -453,7 +452,7 @@ void ProgramInfoManager::Program::UpdateES3Uniformsiv( ...@@ -453,7 +452,7 @@ void ProgramInfoManager::Program::UpdateES3Uniformsiv(
// This should only happen on a lost context. // This should only happen on a lost context.
return; return;
} }
uniforms_es3_.clear(); DCHECK_EQ(0u, uniforms_es3_.size());
// |result| comes from GPU process. We consider it trusted data. Therefore, // |result| comes from GPU process. We consider it trusted data. Therefore,
// no need to check for overflows as the GPU side did the checks already. // no need to check for overflows as the GPU side did the checks already.
...@@ -495,8 +494,8 @@ void ProgramInfoManager::Program::UpdateES3TransformFeedbackVaryings( ...@@ -495,8 +494,8 @@ void ProgramInfoManager::Program::UpdateES3TransformFeedbackVaryings(
// This should only happen on a lost context. // This should only happen on a lost context.
return; return;
} }
transform_feedback_varyings_.clear(); DCHECK_EQ(0u, transform_feedback_varyings_.size());
transform_feedback_varying_max_length_ = 0; DCHECK_EQ(0u, transform_feedback_varying_max_length_);
// |result| comes from GPU process. We consider it trusted data. Therefore, // |result| comes from GPU process. We consider it trusted data. Therefore,
// no need to check for overflows as the GPU side did the checks already. // no need to check for overflows as the GPU side did the checks already.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment