зеркало из https://github.com/mozilla/gecko-dev.git
b=1009960, teach ScopedBindFramebuffer about spilt read/draw framebuffers; r=bjacob
This commit is contained in:
Родитель
1148a891c7
Коммит
7b45e7e0d5
|
@ -52,7 +52,12 @@ ScopedGLState::UnwrapImpl()
|
|||
void
|
||||
ScopedBindFramebuffer::Init()
|
||||
{
|
||||
mOldFB = mGL->GetFB();
|
||||
if (mGL->IsSupported(GLFeature::framebuffer_blit)) {
|
||||
mOldReadFB = mGL->GetReadFB();
|
||||
mOldDrawFB = mGL->GetDrawFB();
|
||||
} else {
|
||||
mOldReadFB = mOldDrawFB = mGL->GetFB();
|
||||
}
|
||||
}
|
||||
|
||||
ScopedBindFramebuffer::ScopedBindFramebuffer(GLContext* aGL)
|
||||
|
@ -74,7 +79,12 @@ ScopedBindFramebuffer::UnwrapImpl()
|
|||
// Check that we're not falling out of scope after the current context changed.
|
||||
MOZ_ASSERT(mGL->IsCurrent());
|
||||
|
||||
mGL->BindFB(mOldFB);
|
||||
if (mOldReadFB == mOldDrawFB) {
|
||||
mGL->BindFB(mOldDrawFB);
|
||||
} else {
|
||||
mGL->BindDrawFB(mOldDrawFB);
|
||||
mGL->BindReadFB(mOldReadFB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ struct ScopedBindFramebuffer
|
|||
friend struct ScopedGLWrapper<ScopedBindFramebuffer>;
|
||||
|
||||
protected:
|
||||
GLuint mOldFB;
|
||||
GLuint mOldReadFB;
|
||||
GLuint mOldDrawFB;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
|
Загрузка…
Ссылка в новой задаче