Open Bug 1688273 Opened 4 years ago Updated 6 months ago

Test number of pixels drawn

Categories

(Core :: Graphics: WebRender, task, P3)

task

Tracking

()

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

There should be a way to write a graphics reftest (or something like a reftest) that asserts that no more than a certain number of pixels are drawn in the process of painting a frame.

Many of the patches we're landing for Software WebRender performance improvements are landed without tests, since they have no effect on the rendered result, only the speed with which it's produced. But SWWR's behavior is deterministic, and it already has code to count the number of pixels it draws, so it should be possible to write a regression test that asserts that a given frame can be painted with no more than a given number of pixels drawn.

Such tests should draw at a fixed resolution, to avoid being affected by pixel density or other scaling factors. But ideally, the bounds on the work could be expressed, not in pixels, but in terms of the area of the primitives involved, so that the test would be resolution-independent.

It's true that new optimizations sometimes roll back the benefits of prior optimizations. But when that occurs, it's better to know about it and deliberately choose to accept the regression than to have no indication that anything has changed. A strict 'no-regression' policy would probably be unreasonable, since the mere presence of a test is not evidence of the importance to users of the optimization it's checking for. But developers could include adjustments of other tests' bounds in their patches, and the tradeoffs could be evaluated as part of the review process. This could be guided by team policies.

(idea due to JeffM)

SWGL already supports the GL_SAMPLES_PASSED query, and WebRender consults it.

Severity: -- → N/A
Priority: -- → P3
Blocks: wr-todos
You need to log in before you can comment on or make changes to this bug.