Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
display.h File Reference

Declarations for the Windows display backend. More...

#include <d3d11.h>
#include <d3d11_4.h>
#include <d3dcommon.h>
#include <dwmapi.h>
#include <dxgi.h>
#include <dxgi1_6.h>
#include <Unknwn.h>
#include <winrt/windows.graphics.capture.h>
#include "src/platform/common.h"
#include "src/utility.h"
#include "src/video.h"
Include dependency graph for display.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  platf::dxgi::display_base_t::_D3DKMT_CLOSEADAPTER
 Win32 D3DKMT adapter-close request structure. More...
struct  platf::dxgi::display_base_t::_D3DKMT_OPENADAPTERFROMLUID
 Win32 D3DKMT adapter-open request structure. More...
struct  platf::dxgi::display_base_t::_D3DKMT_QUERYADAPTERINFO
 Win32 D3DKMT adapter information query. More...
struct  platf::dxgi::display_base_t::_D3DKMT_WDDM_2_7_CAPS
 Win32 D3DKMT WDDM 2.7 capability flags. More...
struct  platf::dxgi::cursor_t
 Cursor position and visibility for the current capture frame. More...
class  platf::dxgi::display_base_t
 Shared D3D11/DXGI state used by Windows display capture backends. More...
class  platf::dxgi::display_ddup_ram_t
class  platf::dxgi::display_ddup_vram_t
class  platf::dxgi::display_ram_t
class  platf::dxgi::display_vram_t
class  platf::dxgi::display_wgc_ram_t
class  platf::dxgi::display_wgc_vram_t
class  platf::dxgi::duplication_t
class  platf::dxgi::gpu_cursor_t
 GPU resources used to render a captured cursor shape. More...
class  platf::dxgi::wgc_capture_t

Typedefs

using platf::dxgi::adapter_t = util::safe_ptr<IDXGIAdapter1, &Release<IDXGIAdapter1>>
 Owning COM pointer for a DXGI display adapter.
using platf::dxgi::blend_t = util::safe_ptr<ID3D11BlendState, &Release<ID3D11BlendState>>
 Owning COM pointer for a D3D11 blend state.
using platf::dxgi::blob_t = util::safe_ptr<ID3DBlob, &Release<ID3DBlob>>
 Owning COM pointer for a compiled shader bytecode blob.
using platf::dxgi::buf_t = util::safe_ptr<ID3D11Buffer, &Release<ID3D11Buffer>>
 Owning COM pointer for a D3D11 buffer.
using platf::dxgi::video::ctx_t = util::safe_ptr<ID3D11VideoContext, &Release<ID3D11VideoContext>>
 Owning COM pointer for the D3D11 video context interface.
using platf::dxgi::depth_stencil_state_t = util::safe_ptr<ID3D11DepthStencilState, &Release<ID3D11DepthStencilState>>
 D3D depth-stencil state handle type.
using platf::dxgi::depth_stencil_view_t = util::safe_ptr<ID3D11DepthStencilView, &Release<ID3D11DepthStencilView>>
 Owning COM pointer for a D3D11 depth-stencil view.
using platf::dxgi::device1_t = util::safe_ptr<ID3D11Device1, &Release<ID3D11Device1>>
 Owning COM pointer for the D3D11.1 device interface.
using platf::dxgi::device_ctx_t = util::safe_ptr<ID3D11DeviceContext, &Release<ID3D11DeviceContext>>
 Owning COM pointer for the immediate D3D11 device context.
using platf::dxgi::device_t = util::safe_ptr<ID3D11Device, &Release<ID3D11Device>>
 Owning COM pointer for the D3D11 device used by capture and conversion.
using platf::dxgi::video::device_t = util::safe_ptr<ID3D11VideoDevice, &Release<ID3D11VideoDevice>>
 Owning COM pointer for the D3D11 video device interface.
using platf::dxgi::dup_t = util::safe_ptr<IDXGIOutputDuplication, &Release<IDXGIOutputDuplication>>
 Owning COM pointer for the DXGI desktop duplication session.
using platf::dxgi::dxgi1_t = util::safe_ptr<IDXGIDevice1, &Release<IDXGIDevice1>>
 Owning COM pointer for a DXGI 1.1 device interface.
using platf::dxgi::dxgi_t = util::safe_ptr<IDXGIDevice, &Release<IDXGIDevice>>
 Owning COM pointer for a DXGI device interface.
using platf::dxgi::factory1_t = util::safe_ptr<IDXGIFactory1, &Release<IDXGIFactory1>>
 Owning COM pointer for the DXGI factory used to enumerate adapters.
using platf::dxgi::input_layout_t = util::safe_ptr<ID3D11InputLayout, &Release<ID3D11InputLayout>>
 Owning COM pointer for a D3D11 input layout.
using platf::dxgi::keyed_mutex_t = util::safe_ptr<IDXGIKeyedMutex, &Release<IDXGIKeyedMutex>>
 Owning COM pointer for a keyed mutex on a shared DXGI resource.
using platf::dxgi::multithread_t = util::safe_ptr<ID3D11Multithread, &Release<ID3D11Multithread>>
 Owning COM pointer for the D3D11 multithread-protection interface.
using platf::dxgi::output1_t = util::safe_ptr<IDXGIOutput1, &Release<IDXGIOutput1>>
 Owning COM pointer for a DXGI output that supports duplication.
using platf::dxgi::output5_t = util::safe_ptr<IDXGIOutput5, &Release<IDXGIOutput5>>
 Owning COM pointer for a DXGI output with HDR metadata support.
using platf::dxgi::output6_t = util::safe_ptr<IDXGIOutput6, &Release<IDXGIOutput6>>
 Owning COM pointer for a DXGI output with modern display descriptors.
using platf::dxgi::output_t = util::safe_ptr<IDXGIOutput, &Release<IDXGIOutput>>
 Owning COM pointer for a DXGI output.
using platf::dxgi::video::processor_enum_t = util::safe_ptr<ID3D11VideoProcessorEnumerator, &Release<ID3D11VideoProcessorEnumerator>>
 Owning COM pointer for a video processor capability enumerator.
using platf::dxgi::video::processor_in_t = util::safe_ptr<ID3D11VideoProcessorInputView, &Release<ID3D11VideoProcessorInputView>>
 Owning COM pointer for a video processor input view.
using platf::dxgi::video::processor_out_t = util::safe_ptr<ID3D11VideoProcessorOutputView, &Release<ID3D11VideoProcessorOutputView>>
 Owning COM pointer for a video processor output view.
using platf::dxgi::video::processor_t = util::safe_ptr<ID3D11VideoProcessor, &Release<ID3D11VideoProcessor>>
 Owning COM pointer for a D3D11 video processor.
using platf::dxgi::ps_t = util::safe_ptr<ID3D11PixelShader, &Release<ID3D11PixelShader>>
 Owning COM pointer for a D3D11 pixel shader.
using platf::dxgi::raster_state_t = util::safe_ptr<ID3D11RasterizerState, &Release<ID3D11RasterizerState>>
 D3D rasterizer state handle type.
using platf::dxgi::render_target_t = util::safe_ptr<ID3D11RenderTargetView, &Release<ID3D11RenderTargetView>>
 Owning COM pointer for a D3D11 render-target view.
using platf::dxgi::resource1_t = util::safe_ptr<IDXGIResource1, &Release<IDXGIResource1>>
 Owning COM pointer for the DXGI 1.1 resource sharing interface.
using platf::dxgi::resource_t = util::safe_ptr<IDXGIResource, &Release<IDXGIResource>>
 Owning COM pointer for the DXGI resource view of a shared texture.
using platf::dxgi::sampler_state_t = util::safe_ptr<ID3D11SamplerState, &Release<ID3D11SamplerState>>
 D3D sampler state handle type.
using platf::dxgi::shader_res_t = util::safe_ptr<ID3D11ShaderResourceView, &Release<ID3D11ShaderResourceView>>
 Owning COM pointer for a D3D11 shader-resource view.
using platf::dxgi::texture1d_t = util::safe_ptr<ID3D11Texture1D, &Release<ID3D11Texture1D>>
 Owning COM pointer for a D3D11 1D texture.
using platf::dxgi::texture2d_t = util::safe_ptr<ID3D11Texture2D, &Release<ID3D11Texture2D>>
 Owning COM pointer for a D3D11 2D texture.
using platf::dxgi::vs_t = util::safe_ptr<ID3D11VertexShader, &Release<ID3D11VertexShader>>
 Owning COM pointer for a D3D11 vertex shader.

Enumerations

enum class  platf::dxgi::fp16_transfer_e { linear , perceptual_quantizer , gamma_encoded }
 Transfer handling applied by the shaders that convert FP16 captures. More...

Functions

template<class T>
void platf::dxgi::Release (T *dxgi)
 Release the COM or platform reference owned by the pointer.
fp16_transfer_e platf::dxgi::select_fp16_transfer (DXGI_FORMAT format, bool hdr, bool gamma_encoded_sdr)
 Select the transfer handling for FP16 capture conversion.

Variables

auto constexpr platf::dxgi::D3D11_CREATE_DEVICE_FLAGS = 0
 Protocol or platform constant for d3 d11 create device flags.
const std::array< const char *, 133 > platf::dxgi::format_str
 Diagnostic names indexed by DXGI_FORMAT.

Detailed Description

Declarations for the Windows display backend.

Enumeration Type Documentation

◆ fp16_transfer_e

enum class platf::dxgi::fp16_transfer_e
strong

Transfer handling applied by the shaders that convert FP16 captures.

Enumerator
linear 

Linear scRGB input; apply the sRGB curve.

perceptual_quantizer 

Linear scRGB input; encode with the Rec. 2100 PQ curve.

gamma_encoded 

Input is already sRGB gamma-encoded; apply no transfer curve.

Function Documentation

◆ Release()

template<class T>
void platf::dxgi::Release ( T * dxgi)

Release the COM or platform reference owned by the pointer.

Parameters
dxgiDXGI object whose COM reference should be released.

◆ select_fp16_transfer()

fp16_transfer_e platf::dxgi::select_fp16_transfer ( DXGI_FORMAT format,
bool hdr,
bool gamma_encoded_sdr )

Select the transfer handling for FP16 capture conversion.

HDR displays use the PQ shaders when the output format has them and the linear shaders otherwise, regardless of gamma_encoded_sdr. SDR displays use the linear shaders unless the fp16_sdr_gamma_encoded option is enabled, in which case no transfer curve is applied.

Parameters
formatOutput surface format of the encoder.
hdrWhether the display uses an HDR (ST 2084) color space.
gamma_encoded_sdrWhether the fp16_sdr_gamma_encoded option is enabled.
Returns
Transfer handling for the FP16 conversion shaders.

Variable Documentation

◆ format_str

const std::array< const char *, 133 > platf::dxgi::format_str

Diagnostic names indexed by DXGI_FORMAT.

Names for DXGI_FORMAT values used in diagnostic logging.