aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYahan Zhou <yahan@google.com>2022-06-09 12:50:43 -0700
committerYahan Zhou <yahan@google.com>2022-06-09 15:10:43 -0700
commit48fdca93e7d1c8d183baf0bf5c83aefa2ef9fd83 (patch)
tree9f7f106a27c82511f9d18d72a0e734bea084e698
parentac9dace35eeb6d30afbfc0ea064aaf112e2d14da (diff)
downloadgoldfish-opengl-48fdca93e7d1c8d183baf0bf5c83aefa2ef9fd83.tar.gz
Clean up RBO destroy code and fix regression
Bug: 235127206 Test: dEQP-GLES3.functional.fbo.api#invalid_rbo_attachments Merged-In: I0d5784a28df097b506840daec1bfbad7fe542dd0 Change-Id: I0d5784a28df097b506840daec1bfbad7fe542dd0
-rw-r--r--shared/OpenglCodecCommon/GLClientState.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/shared/OpenglCodecCommon/GLClientState.cpp b/shared/OpenglCodecCommon/GLClientState.cpp
index 852f36ae..3e32bbfb 100644
--- a/shared/OpenglCodecCommon/GLClientState.cpp
+++ b/shared/OpenglCodecCommon/GLClientState.cpp
@@ -2101,7 +2101,6 @@ void GLClientState::addRenderbuffers(GLsizei n, GLuint* renderbuffers) {
}
void GLClientState::removeRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
- std::vector<std::shared_ptr<RboProps>> to_remove;
bool unbindCurrent = false;
{
RenderbufferInfo::ScopedView view(mRboState.rboData);
@@ -2111,18 +2110,12 @@ void GLClientState::removeRenderbuffers(GLsizei n, const GLuint* renderbuffers)
if (!rboPtr) {
continue;
}
- to_remove.push_back(rboPtr);
+ unbindCurrent |=
+ (mRboState.boundRenderbuffer == rboPtr);
setFboCompletenessDirtyForRbo(rboPtr);
+ view.remove(renderbuffers[i]);
}
}
-
- for (size_t i = 0; i < to_remove.size(); i++) {
- if (mRboState.boundRenderbuffer == to_remove[i]) {
- unbindCurrent = true;
- break;
- }
- view.remove(to_remove[i]->id);
- }
}
if (unbindCurrent) {