common: align each display's atlas offset for direct scanout
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 22s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / module (push) Failing after 18s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / host-linux (push) Failing after 21s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 22s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / module (push) Failing after 18s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / host-linux (push) Failing after 21s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
The alignment argument only rounded up the atlas width, so a display's X offset was an arbitrary running sum of the widths before it. A consumer pointing display hardware at one display's region needs that region's base address 256 byte aligned, and with unaligned offsets some displays would land on legal addresses and some would not — giving the fast path to only some monitors, which is worse than uniform slowness because the difference is hard to diagnose. Each display's X offset is now aligned as well, and the candidate shelf widths account for the padding so they still describe shelves that can hold the set. Both capture backends pass an alignment derived from their pixel size. Costs nothing for common resolutions: 3840, 2560 and 1920 are all multiples of 64. Only unusual widths pad at all — a 2160 wide portrait display grows the atlas by 16 pixels. Also documents the consumer contract: the alignment guarantee, frame lifetime under the two deep queue and one second subscriber timeout, and that damage is in packed frame coordinates.
This commit is contained in:
1 parent
fc0c2cfc37
commit
5e2fd18b5c
6 files changed
+149
-7
No files matched your search
@@ -276,7 +276,8 @@ haveDisplays:
|
||||
this->srcY[i] = info[i].y;
|
||||
}
|
||||
|
||||
if (!lgDisplaysPack(info, count, 1, this->displays,
|
||||
// BGRA is 4 bytes per pixel; align so a consumer can scan out from the atlas
|
||||
if (!lgDisplaysPack(info, count, LG_DISPLAY_ALIGN_PIXELS(4), this->displays,
|
||||
&this->atlasWidth, &this->atlasHeight,
|
||||
&this->desktopWidth, &this->desktopHeight))
|
||||
{
|
||||
|
||||
@@ -434,8 +434,23 @@ static bool dxgi_initMultiMonitor(void)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Align each display so a consumer can point display hardware straight at
|
||||
* its region of the atlas rather than copying it out. */
|
||||
unsigned bpp;
|
||||
switch(this->dxgiSrcFormat)
|
||||
{
|
||||
case DXGI_FORMAT_R16G16B16A16_FLOAT:
|
||||
bpp = 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
bpp = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned atlasWidth, atlasHeight, desktopWidth, desktopHeight;
|
||||
if (!lgDisplaysPack(info, count, 1, this->displays,
|
||||
if (!lgDisplaysPack(info, count, LG_DISPLAY_ALIGN_PIXELS(bpp),
|
||||
this->displays,
|
||||
&atlasWidth, &atlasHeight, &desktopWidth, &desktopHeight))
|
||||
{
|
||||
DEBUG_WARN("Failed to pack %u outputs, capturing a single display", count);
|
||||
|
||||
Reference in new issue
Block a user