зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1706510 - If no frontbuffer, reuse BindDefaultFBForRead. r=lsalzman
Don't bind mDefaultFB->mFB directly, since it might be multisampled. Differential Revision: https://phabricator.services.mozilla.com/D112881
This commit is contained in:
Родитель
d27126e56f
Коммит
2ec500123f
|
@ -991,13 +991,6 @@ bool WebGLContext::FrontBufferSnapshotInto(Range<uint8_t> dest) {
|
||||||
if (!IsWebGL2()) {
|
if (!IsWebGL2()) {
|
||||||
fbTarget = LOCAL_GL_FRAMEBUFFER;
|
fbTarget = LOCAL_GL_FRAMEBUFFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl->fBindFramebuffer(fbTarget,
|
|
||||||
front->mFb ? front->mFb->mFB : mDefaultFB->mFB);
|
|
||||||
if (pboWas) {
|
|
||||||
BindBuffer(LOCAL_GL_PIXEL_PACK_BUFFER, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto reset2 = MakeScopeExit([&] {
|
auto reset2 = MakeScopeExit([&] {
|
||||||
DoBindFB(readFbWas, fbTarget);
|
DoBindFB(readFbWas, fbTarget);
|
||||||
if (pboWas) {
|
if (pboWas) {
|
||||||
|
@ -1005,6 +998,20 @@ bool WebGLContext::FrontBufferSnapshotInto(Range<uint8_t> dest) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (front->mFb) {
|
||||||
|
gl->fBindFramebuffer(fbTarget, front->mFb->mFB);
|
||||||
|
} else {
|
||||||
|
if (!BindDefaultFBForRead()) {
|
||||||
|
gfxCriticalError() << "BindDefaultFBForRead failed";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pboWas) {
|
||||||
|
BindBuffer(LOCAL_GL_PIXEL_PACK_BUFFER, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -
|
||||||
|
|
||||||
const auto& size = front->mDesc.size;
|
const auto& size = front->mDesc.size;
|
||||||
const size_t stride = size.width * 4;
|
const size_t stride = size.width * 4;
|
||||||
MOZ_ASSERT(dest.length() == stride * size.height);
|
MOZ_ASSERT(dest.length() == stride * size.height);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче