Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vo_gpu/d3d11: add support for configuring swap chain output format #7051

Merged
merged 2 commits into from
Oct 13, 2019

Conversation

jeeb
Copy link
Member

@jeeb jeeb commented Oct 12, 2019

First part of getting to color space configuration (HDR and such).

Adds support for configuring the D3D11 swap chain format. For now we have been utilizing 8bit RGBA, but other formats are available, such as 10bit RGB with 2bit alpha, 16bit floating point or 8bit BGRA.

The APIs querying the system output's information is surprisingly new, so the Windows dxgi header check is bumped from dxgi1_2.h to dxgi1_6.h (this is available at the very least on mingw-w64 6.x). The code should still work on Windows 7+, but the system output information will only be available for Windows 10 users at least according to what MSDN says..

Current logic:

  1. If a specific swap chain format is configured, that is utilized.
  2. If any information on the output onto which swap chain is currently linked is not available, picks 8bit RGBA, just as before.
  3. If the information on the output is available, either 8bit RGBA or 10bit RGB with 2bit alpha is utilized, depending on the bit depth.

Additionally, adds @rossy 's fix for the rendering bit depth that I have fixed up somewhat.

Fixes #5237 .

And if backbuffer is not around, return an error value utilized
elsewhere already.
@ghost
Copy link

ghost commented Oct 12, 2019

Seems sane, but I don't know this D3D stuff much.

@jeeb jeeb force-pushed the d3d11_output_format_support branch from bc36c50 to e95d165 Compare October 12, 2019 22:44
Copy link
Member

@rossy rossy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, apart from a few nits.

DOCS/man/options.rst Outdated Show resolved Hide resolved
video/out/gpu/d3d11_helpers.c Outdated Show resolved Hide resolved
video/out/gpu/d3d11_helpers.c Outdated Show resolved Hide resolved
video/out/gpu/d3d11_helpers.c Outdated Show resolved Hide resolved
video/out/gpu/d3d11_helpers.c Outdated Show resolved Hide resolved
@jeeb jeeb force-pushed the d3d11_output_format_support branch from e95d165 to 98ebc00 Compare October 13, 2019 10:17
Query information on the system output most linked to the swap chain,
and either utilize a user-configured format, or either 8bit
RGBA or 10bit RGB with 2bit alpha depending on the system output's
bit depth.
@jeeb jeeb force-pushed the d3d11_output_format_support branch from 98ebc00 to 35f17cf Compare October 13, 2019 10:29
@rossy rossy merged commit 648d785 into mpv-player:master Oct 13, 2019
@jeeb jeeb deleted the d3d11_output_format_support branch October 13, 2019 11:42
@Doofussy2
Copy link

@jeeb @rossy Hi guys. Is HDR10+ metadata also passed, or only HDR10? How can I verify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

native 10 bit output for MS Windows 10 1709 and above (or possibly Windows 7 and above)
3 participants