Commit 74e98f6c by Qin Jiajia Committed by Commit Bot

Use highestUsed() instead of size()

Bug: angleproject:3548 Change-Id: Idd273cdfff5f175399dcc46bd40db52d6f4163b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666909Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
parent 3b225597
......@@ -1800,8 +1800,8 @@ void StateManager11::unsetConflictingSRVs(gl::PipelineType pipeline,
auto *currentSRVs = getSRVCache(shaderType);
gl::PipelineType conflictPipeline = gl::GetPipelineType(shaderType);
bool foundOne = false;
for (size_t resourceIndex = 0; resourceIndex < currentSRVs->size(); ++resourceIndex)
size_t count = std::min(currentSRVs->size(), currentSRVs->highestUsed());
for (size_t resourceIndex = 0; resourceIndex < count; ++resourceIndex)
{
auto &record = (*currentSRVs)[resourceIndex];
......@@ -1839,7 +1839,8 @@ void StateManager11::unsetConflictingUAVs(gl::PipelineType pipeline,
bool foundOne = false;
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
for (size_t resourceIndex = 0; resourceIndex < mCurComputeUAVs.size(); ++resourceIndex)
size_t count = std::min(mCurComputeUAVs.size(), mCurComputeUAVs.highestUsed());
for (size_t resourceIndex = 0; resourceIndex < count; ++resourceIndex)
{
auto &record = mCurComputeUAVs[resourceIndex];
......
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