Closed Bug 2058080 Opened 3 months ago Closed 3 months ago

Avoid using combined depth stencil buffer if context only requests depth or stencil

Categories

(Core :: Graphics: CanvasWebGL, task)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert, Whiteboard: [fxpe])

Attachments

(1 external file)

If either a depth or stencil buffer is requested, WebGL context creation will create a combined GL_DEPTH24_STENCIL8 buffer (if supported).

On Metal ANGLE, we have observed that this actually results in a Metal buffer of format MTLPixelFormatDepth32Float_Stencil8 rather than MTLPixelFormatDepth24Unorm_Stencil8. (The latter of which is deprecated, and MTLDevice.isDepth24Stencil8PixelFormatSupported returns false on both the Intel and Apple silicon GPUs I tested).

In cases where only a depth buffer or only a stencil buffer is requested, we should avoid using the combined format. This gives us an ~8% performance improvement on glterrain with Metal ANGLE on an Intel Mac. (But still a huge regression versus not using Metal ANGLE)

On Metal ANGLE we have observed a requested GL_DEPTH24_STENCIL8 format
actually results in MTLPixelFormat.depth32Float_Stencil8 being used,
rather than MTLPixelFormat.depth24Unorm_Stencil8. This is because
MTLDevice.isDepth24Stencil8PixelFormatSupported returns false on both
the Intel and Apple silicon GPUs that were tested.

This results in more memory being used, even in cases where no stencil
buffer was actually requested. To avoid this, only use the combined
depth stencil format when both a depth and stencil buffer are actually
requested.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED
Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e90695b590e6 https://hg.mozilla.org/integration/autoland/rev/61b025a529d3 Avoid using combined depth stencil buffer if only depth or stencil buffer is requested. r=gfx-reviewers,nical
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

Perfherder has detected a talos performance change from push 61b025a529d31c346c23d64e3569fe669407ab60.

No action is required from the author; this comment is provided for informational purposes only.

Improvement Test Platform Options Absolute values [old vs new]
9% glterrain (doc) macosx1470-64-shippable e10s fission stylo webrender 1.09 -> 0.99
9% glterrain (doc) macosx1470-64-shippable e10s fission stylo webrender-sw 0.98 -> 0.89
9% glterrain (doc) macosx1470-64-shippable e10s fission stylo webrender 1.08 -> 0.99

Need Help or Information?

If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Keywords: perf-alert

Presumably on native GL the driver also didn't support a 24+8 combined depth+stencil buffer, so was silently using 32+8 too. hence the performance improvement on native GL too

QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: