summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/d3d11_helpers.h
Commit message (Collapse)AuthorAgeFilesLines
* d3d11: disable IDXGIInfoQueue usage if dxgidebug.h is incompleteKacper Michajłow2024-04-191-0/+5
| | | | Older MinGW-w64 doesn't define IDXGIInfoQueue in dxgidebug.h.
* d3d11: use IDXGIInfoQueue instead ID3D11InfoQueueKacper Michajłow2024-04-191-0/+8
| | | | | | | | | DXGI debug interface encapsulate multiple message queues, which allows to get validation not only for D3D11 calls, but also DXGI ones. Also this makes leak detector not report self debug interface as alive like it was before. And same as with validation, it has ability to detect more alive objects, not being limited to D3D11.
* d3d11: add mp_get_dxgi_output_descKacper Michajłow2024-03-171-0/+3
|
* various: avoid function pointer castsKacper Michajłow2024-02-281-3/+1
| | | | | | | | | | | | | The opt validator functions are casted to generic validator, which has erased type for value. Calling function by pointer of different definition is an UB. Avoid that by generating wrapper function that does proper argument type conversion and calls validator function. Type erased functions have mangled type in the name. Fixes UBSAN failures on Clang 17, which enabled fsanitize=function by default.
* csputils: replace mp_colorspace with pl_color_spaceKacper Michajłow2024-01-221-2/+2
|
* d3d11: expose mp_get_dxgi_adapter and mp_dxgi_validate_adapterKacper Michajłow2023-11-221-0/+8
| | | | To be able to reuse them in other parts of code.
* d3d11: rename d3d11 adapter to DXGI adapterKacper Michajłow2023-11-221-3/+3
| | | | There is nothing d3d11 about those adapters.
* vo_gpu/d3d11: add support for configuring swap chain color spaceJan Ekström2019-10-301-0/+6
| | | | | | | | | | | | | | | | By default utilizes the color space of the desktop on which the swap chain is located. If a specific value is defined, it will be instead be utilized. Enables configuration of the PQ color space (BT.2020 primaries, PQ transfer function) for HDR. Additionally, signals the swap chain color space to the renderer, so that the render looks correct without having to specify target-trc or target-prim manually. Due to all of the APIs being Win10+ only, will only work starting with Windows 10.
* vo_gpu/d3d11: add helpers for getting names for DXGI formats & CSPsJan Ekström2019-10-301-0/+6
| | | | | Additionally, define the few enum values that are currently missing in mingw-w64 headers.
* vo_gpu/d3d11: fixup adapter selection by switching it all to bstrJan Ekström2019-10-151-1/+1
| | | | | I did ponder if I should have done this right away, and it seems like not doing it at first was a mistake.
* vo_gpu/d3d11: add support for configuring swap chain formatJan Ekström2019-10-131-0/+1
| | | | | | | 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.
* vo_gpu/d3d11: add adapter name validation and listing with "help"Jan Ekström2019-09-291-0/+4
| | | | Not the prettiest way to get it done, but seems to work.
* vo_gpu/d3d11: add an option for the adapter nameJan Ekström2019-09-291-0/+5
| | | | Set it from the adapter name in the d3d11 options.
* vo_gpu: d3d11: implement tex_download()James Ross-Gowan2018-02-131-2/+0
| | | | | | | This allows the new GPU screenshot functionality introduced in 9f595f3a80ee to work with the D3D11 backend. It replaces the old window screenshot functionality, which was shared between D3D11 and ANGLE. The old code can be removed, since it's not needed by ANGLE anymore either.
* vo_gpu: move d3d11_screenshot to shared codeJames Ross-Gowan2017-11-071-0/+4
| | | | This can be used by the ANGLE backend and ra_d3d11.
* vo_gpu: d3d11: initial implementationJames Ross-Gowan2017-11-071-0/+79
This is a new RA/vo_gpu backend that uses Direct3D 11. The GLSL generated by vo_gpu is cross-compiled to HLSL with SPIRV-Cross. What works: - All of mpv's internal shaders should work, including compute shaders. - Some external shaders have been tested and work, including RAVU and adaptive-sharpen. - Non-dumb mode works, even on very old hardware. Most features work at feature level 9_3 and all features work at feature level 10_0. Some features also work at feature level 9_1 and 9_2, but without high-bit- depth FBOs, it's not very useful. (Hardware this old is probably not fast enough for advanced features anyway.) Note: This is more compatible than ANGLE, which requires 9_3 to work at all (GLES 2.0,) and 10_1 for non-dumb-mode (GLES 3.0.) - Hardware decoding with D3D11VA, including decoding of 10-bit formats without truncation to 8-bit. What doesn't work / can be improved: - PBO upload and direct rendering does not work yet. Direct rendering requires persistent-mapped PBOs because the decoder needs to be able to read data from images that have already been decoded and uploaded. Unfortunately, it seems like persistent-mapped PBOs are fundamentally incompatible with D3D11, which requires all resources to use driver- managed memory and requires memory to be unmapped (and hence pointers to be invalidated) when a resource is used in a draw or copy operation. However it might be possible to use D3D11's limited multithreading capabilities to emulate some features of PBOs, like asynchronous texture uploading. - The blit() and clear() operations don't have equivalents in the D3D11 API that handle all cases, so in most cases, they have to be emulated with a shader. This is currently done inside ra_d3d11, but ideally it would be done in generic code, so it can take advantage of mpv's shader generation utilities. - SPIRV-Cross is used through a NIH C-compatible wrapper library, since it does not expose a C interface itself. The library is available here: https://github.com/rossy/crossc - The D3D11 context could be made to support more modern DXGI features in future. For example, it should be possible to add support for high-bit-depth and HDR output with DXGI 1.5/1.6.