Commit 29a4abf9 by Jamie Madill

D3D11: Fix bug with static vertex attributes.

In some specific cases after binding a zero size buffer we could end up trying to use a buffer storage that was no longer valid. Fix this by ensuring we don't flush dirty bits when we have an early exit due to a zero size buffer. Bug: chromium:1107433 Change-Id: I9db560e8dd3699abed2bb7fe6d91060148ba1817 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2343405Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent af5b008a
...@@ -250,8 +250,6 @@ angle::Result VertexArray11::updateDirtyAttribs(const gl::Context *context, ...@@ -250,8 +250,6 @@ angle::Result VertexArray11::updateDirtyAttribs(const gl::Context *context,
for (size_t dirtyAttribIndex : activeDirtyAttribs) for (size_t dirtyAttribIndex : activeDirtyAttribs)
{ {
mAttribsToTranslate.reset(dirtyAttribIndex);
auto *translatedAttrib = &mTranslatedAttribs[dirtyAttribIndex]; auto *translatedAttrib = &mTranslatedAttribs[dirtyAttribIndex];
const auto &currentValue = glState.getVertexAttribCurrentValue(dirtyAttribIndex); const auto &currentValue = glState.getVertexAttribCurrentValue(dirtyAttribIndex);
...@@ -279,6 +277,9 @@ angle::Result VertexArray11::updateDirtyAttribs(const gl::Context *context, ...@@ -279,6 +277,9 @@ angle::Result VertexArray11::updateDirtyAttribs(const gl::Context *context,
UNREACHABLE(); UNREACHABLE();
break; break;
} }
// Make sure we reset the dirty bit after the switch because STATIC can early exit.
mAttribsToTranslate.reset(dirtyAttribIndex);
} }
return angle::Result::Continue; return angle::Result::Continue;
......
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