1 /* Copyright (C) 2010-2020 The RetroArch team
3 * ---------------------------------------------------------------------------------------------
4 * The following license statement only applies to this libretro API header (libretro_d3d.h)
5 * ---------------------------------------------------------------------------------------------
7 * Permission is hereby granted, free of charge,
8 * to any person obtaining a copy of this software and associated documentation files (the
10 * to deal in the Software without restriction, including without limitation the rights to
11 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so, subject to the following
15 * The above copyright notice and this permission notice shall be included in all copies or
16 * substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #ifndef LIBRETRO_DIRECT3D_H__
28 #define LIBRETRO_DIRECT3D_H__
35 #include <d3dcompiler.h>
37 #define RETRO_HW_RENDER_INTERFACE_D3D11_VERSION 1
39 struct retro_hw_render_interface_d3d11
41 /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11. */
42 enum retro_hw_render_interface_type interface_type;
43 /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11_VERSION. */
44 unsigned interface_version;
46 /* Opaque handle to the d3d11 backend in the frontend
47 * which must be passed along to all function pointers
52 ID3D11DeviceContext *context;
53 D3D_FEATURE_LEVEL featureLevel;
54 pD3DCompile D3DCompile;
62 #include <d3dcompiler.h>
64 #define RETRO_HW_RENDER_INTERFACE_D3D12_VERSION 1
66 struct retro_hw_render_interface_d3d12
68 /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12. */
69 enum retro_hw_render_interface_type interface_type;
70 /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12_VERSION. */
71 unsigned interface_version;
73 /* Opaque handle to the d3d12 backend in the frontend
74 * which must be passed along to all function pointers
79 ID3D12CommandQueue *queue;
80 pD3DCompile D3DCompile;
81 D3D12_RESOURCE_STATES required_state;
82 void (*set_texture)(void* handle, ID3D12Resource* texture, DXGI_FORMAT format);
87 #endif /* LIBRETRO_DIRECT3D_H__ */