mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1687265 - clear out old SWGL framebuffer after frame ends. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D102493
This commit is contained in:
parent
54a8c3feb4
commit
8f06a347bd
@ -579,12 +579,14 @@ bool RenderCompositorNativeSWGL::InitDefaultFramebuffer(
|
||||
|
||||
void RenderCompositorNativeSWGL::CancelFrame() {
|
||||
if (mNativeLayerForEntireWindow && mLayerTarget) {
|
||||
wr_swgl_init_default_framebuffer(mContext, 0, 0, 0, 0, 0, nullptr);
|
||||
UnmapNativeLayer();
|
||||
}
|
||||
}
|
||||
|
||||
void RenderCompositorNativeSWGL::DoSwap() {
|
||||
if (mNativeLayerForEntireWindow && mLayerTarget) {
|
||||
wr_swgl_init_default_framebuffer(mContext, 0, 0, 0, 0, 0, nullptr);
|
||||
UnmapNativeLayer();
|
||||
}
|
||||
}
|
||||
|
@ -151,6 +151,9 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) {
|
||||
if (!mDT) {
|
||||
return;
|
||||
}
|
||||
// Clear out the old framebuffer in case something tries to access it after
|
||||
// the frame.
|
||||
wr_swgl_init_default_framebuffer(mContext, 0, 0, 0, 0, 0, nullptr);
|
||||
// If we have a draw target at this point, mapping must have succeeded.
|
||||
MOZ_ASSERT(mMappedData != nullptr);
|
||||
if (mSurface) {
|
||||
|
@ -648,7 +648,7 @@ struct Texture {
|
||||
// otherwise change too much...
|
||||
size_t max_stride = max(buf_stride, aligned_stride(buf_bpp * min_width));
|
||||
size_t size = max_stride * max(height, min_height) * max(depth, 1);
|
||||
if (!buf || size > buf_size) {
|
||||
if ((!buf && size > 0) || size > buf_size) {
|
||||
// Allocate with a SIMD register-sized tail of padding at the end so we
|
||||
// can safely read or write past the end of the texture with SIMD ops.
|
||||
// Currently only the flat Z-buffer texture needs this padding due to
|
||||
|
Loading…
x
Reference in New Issue
Block a user