Debian Codegraph @

Source/Core/VideoBackends/D3DCommon/D3DCommon.h

raw symbols SCIP
1 // Copyright 2019 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <d3dcompiler.h>
7 #include <dxgiformat.h>
8 #include <string>
9 #include <vector>
10 #include <wrl/client.h>
11
12 #include "Common/CommonTypes.h"
13
14 struct IDXGIFactory;
15
16 enum class AbstractTextureFormat : u32;
17
18 namespace D3DCommon
19 {
20 // Loading dxgi.dll and d3dcompiler.dll
21 bool LoadLibraries();
22 void UnloadLibraries();
23
24 // Returns a list of D3D device names.
25 std::vector<std::string> GetAdapterNames();
26
27 // Helper function which creates a DXGI factory.
28 Microsoft::WRL::ComPtr<IDXGIFactory> CreateDXGIFactory(bool debug_device);
29
30 // Globally-accessible D3DCompiler function.
31 extern pD3DCompile d3d_compile;
32
33 // Helpers for texture format conversion.
34 DXGI_FORMAT GetDXGIFormatForAbstractFormat(AbstractTextureFormat format, bool typeless);
35 DXGI_FORMAT GetSRVFormatForAbstractFormat(AbstractTextureFormat format);
36 DXGI_FORMAT GetRTVFormatForAbstractFormat(AbstractTextureFormat format, bool integer);
37 DXGI_FORMAT GetDSVFormatForAbstractFormat(AbstractTextureFormat format);
38 AbstractTextureFormat GetAbstractFormatForDXGIFormat(DXGI_FORMAT format);
39
40 // This function will assign a name to the given resource.
41 // The DirectX debug layer will make it easier to identify resources that way,
42 // e.g. when listing up all resources who have unreleased references.
43 void SetDebugObjectName(IUnknown* resource, std::string_view name);
44 } // namespace D3DCommon