Skip to content

VMSVGA: coalesce DX11 readbacks and skip unchanged updates#744

Draft
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/vmsvga-dx11-readback-coalesce
Draft

VMSVGA: coalesce DX11 readbacks and skip unchanged updates#744
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/vmsvga-dx11-readback-coalesce

Conversation

@moreaki

@moreaki moreaki commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Reduce VMSVGA DX11 screen-output readback work in three related places:

  • Merge a newly queued screen rectangle into a compatible pending rectangle for the current readback fence.
  • Copy only the union of the current fence's dirty rectangles from the B8G8R8X8 screen texture into its staging texture.
  • Compare the mapped B8G8R8X8 rows with the host buffer and suppress the output-target sequence increment and host screen update when no bytes changed.

The I420 conversion/readback path remains full-frame and always reports changed output.

Scope

This is a draft performance candidate, not part of the minimal functional Retina/HiDPI enablement tracked by #742. It should remain draft—and should be closed if an isolated current-main A/B comparison does not show a repeatable benefit.

The patch intentionally keeps the existing readback-fence ordering, fixed eight-entry update queue, output-target conversion, and vmsvgaR3UpdateScreen delivery path.

Benchmark source

The validation tool is the fixed dxmtbench functional/performance harness. Performance samples are admissible only after the same run passes its browser framebuffer, guest screenshot, host presentation/signature, launch, and graphics-log gates.

Validation

  • git diff --check: passed.
  • Full clean Darwin/Arm64 build from current origin/main at this minimized patch tip: pending in the pinned comparison build.
  • Static fence audit: rectangles already covered by an in-flight readback are not merged with new work; only entries tagged with the current readback fence are eligible.
  • Static format audit: B8G8R8X8 uses bounded partial copies and byte comparisons; I420 preserves the original full conversion/copy behavior.
  • Runtime correctness and isolated performance A/B at 3840x2160: pending.

Earlier manual measurements covered a combined local patch stack and are not evidence for this PR.

Refs #742.

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 8, 2026
@moreaki
moreaki marked this pull request as ready for review July 8, 2026 08:09
@moreaki
moreaki marked this pull request as draft July 9, 2026 08:49
Merge bounded pending screen rectangles before starting a readback, copy only the dirty area for the B8G8R8X8 target, and suppress host updates when the readback bytes are unchanged. Keep the full-frame I420 conversion path unchanged.

Signed-off-by: Roberto Nibali <rnibali@gmail.com>
@moreaki
moreaki force-pushed the agent/vmsvga-dx11-readback-coalesce branch from f6e0f8d to 73d8a5b Compare July 16, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant