Closed Bug 1683993 Opened 5 years ago Closed 5 years ago

gfx.webrender.debug.texture-cache does not work with the native compositor

Categories

(Core :: Graphics: WebRender, defect)

All
macOS
defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: mstange, Assigned: mstange)

Details

Attachments

(3 files)

Flipping gfx.webrender.debug.texture-cache to true does not show the texture cache on screen, on macOS. Instead it seems to result in corrupted rendering.

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED

If you turn off the compositor does it work?

Yes it does, and it doesn't cause corrupted rendering.

With compositor on, the profiler overlay and the epochs overlay render correctly. But when the texture-cache or render-targets prefs are set, the other overlays disappear and rendering is corrupted. I'll check which call causes the breakage.

(In reply to Markus Stange [:mstange] from comment #2)

Yes it does, and it doesn't cause corrupted rendering.

Nevermind, the corrupted rendering is independent of whether the compositor is used.

However, the corruption only occurs with the Intel driver. When I use the AMD GPU, no corruption occurs. I think this is due to a driver bug with clears. We clear discarded items in the texture cache but only if the texture cache debugging pref is enabled. We also clear new texture cache textures upon creation. If I comment out the new-texture clear, the corruption stops.

I have filed bug 1685144 about the driver-specific corruption.

Let's make this bug only about the "native compositor" part.

There are two main bugs here:

Summary: gfx.webrender.debug.texture-cache does not work on macOS → gfx.webrender.debug.texture-cache does not work with the native compositor

render_impl() calls draw_frame(). We were drawing the debug overlays in both
functions, so the overlays were rendered twice.
This patch removes the drawing in draw_frame() and keeps the one in render_impl().

For anything that uses the debug renderer, such as the "epochs" overlay, this
means that the drawing commands were appended twice, and then all commands were
executed at the end of render_impl().
Comparing the "epochs" debug overlay with and without this change, this patch
noticeable]y reduces its opacity from "extra opaque" (due to double drawing) to
"normal translucency".

Also, when the native compositor was used, any debug drawing in draw_frame()
that wasn't using the debug renderer didn't actually work, because it wasn't
going into the debug overlay surface - only render_impl() correctly binds the
debug overlay surface when the native compositor is used.

This fixes upside-down drawing when the native compositor is used.

Depends on D100962

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/1e959ac06d64 Stop double-drawing debug overlays. r=kvark https://hg.mozilla.org/integration/autoland/rev/b417ddc07d24 Forward debug overlay DrawTarget into do_debug_blit so that device.blit_render_target targets the correct framebuffer when the native compositor is used. r=kvark https://hg.mozilla.org/integration/autoland/rev/2eb5b5fade1b Convert do_debug_blit() to use origin-top-left coordinates and convert to FramebufferPixel coordinates correctly. r=kvark
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: