diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 7db8f8b493..2994603a3a 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -66,8 +66,8 @@ #include "../common/d3d_common.h" #include "../common/dxgi_common.h" -#include -#include +#include +#include #include "../common/d3dcompiler_common.h" #ifdef HAVE_SLANG #include "../drivers_shader/slang_process.h" diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index 970e2f8d33..02feb4daaf 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -67,8 +67,8 @@ #include "../common/d3d_common.h" #include "../common/dxgi_common.h" -#include -#include +#include +#include #include "../common/d3dcompiler_common.h" #ifdef HAVE_SLANG #include "../drivers_shader/slang_process.h" diff --git a/libretro-common/include/libretro_d3d.h b/libretro-common/include/libretro_d3d.h index 8e1824323b..c449103a2e 100644 --- a/libretro-common/include/libretro_d3d.h +++ b/libretro-common/include/libretro_d3d.h @@ -30,58 +30,11 @@ #include "libretro.h" #ifdef HAVE_D3D11 - -#include -#include - -#define RETRO_HW_RENDER_INTERFACE_D3D11_VERSION 1 - -struct retro_hw_render_interface_d3d11 -{ - /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11. */ - enum retro_hw_render_interface_type interface_type; - /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11_VERSION. */ - unsigned interface_version; - - /* Opaque handle to the d3d11 backend in the frontend - * which must be passed along to all function pointers - * in this interface. - */ - void* handle; - ID3D11Device *device; - ID3D11DeviceContext *context; - D3D_FEATURE_LEVEL featureLevel; - pD3DCompile D3DCompile; -}; - +#include "libretro_d3d11.h" #endif #ifdef HAVE_D3D12 - -#include -#include - -#define RETRO_HW_RENDER_INTERFACE_D3D12_VERSION 1 - -struct retro_hw_render_interface_d3d12 -{ - /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12. */ - enum retro_hw_render_interface_type interface_type; - /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12_VERSION. */ - unsigned interface_version; - - /* Opaque handle to the d3d12 backend in the frontend - * which must be passed along to all function pointers - * in this interface. - */ - void* handle; - ID3D12Device *device; - ID3D12CommandQueue *queue; - pD3DCompile D3DCompile; - D3D12_RESOURCE_STATES required_state; - void (*set_texture)(void* handle, ID3D12Resource* texture, DXGI_FORMAT format); -}; - +#include "libretro_d3d12.h" #endif #endif /* LIBRETRO_DIRECT3D_H__ */ diff --git a/libretro-common/include/libretro_d3d11.h b/libretro-common/include/libretro_d3d11.h new file mode 100644 index 0000000000..1bb787a71f --- /dev/null +++ b/libretro-common/include/libretro_d3d11.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2010-2020 The RetroArch team + * + * --------------------------------------------------------------------------------------------- + * The following license statement only applies to this libretro API header (libretro_d3d.h) + * --------------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the + * "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef LIBRETRO_DIRECT3D11_H__ +#define LIBRETRO_DIRECT3D11_H__ + +#include +#include + +#define RETRO_HW_RENDER_INTERFACE_D3D11_VERSION 1 + +struct retro_hw_render_interface_d3d11 +{ + /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11. */ + enum retro_hw_render_interface_type interface_type; + /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11_VERSION. */ + unsigned interface_version; + + /* Opaque handle to the d3d11 backend in the frontend + * which must be passed along to all function pointers + * in this interface. + */ + void* handle; + ID3D11Device *device; + ID3D11DeviceContext *context; + D3D_FEATURE_LEVEL featureLevel; + pD3DCompile D3DCompile; +}; + +#endif /* LIBRETRO_DIRECT3D11_H__ */ diff --git a/libretro-common/include/libretro_d3d12.h b/libretro-common/include/libretro_d3d12.h new file mode 100644 index 0000000000..e9d1dd3ed3 --- /dev/null +++ b/libretro-common/include/libretro_d3d12.h @@ -0,0 +1,54 @@ +/* Copyright (C) 2010-2020 The RetroArch team + * + * --------------------------------------------------------------------------------------------- + * The following license statement only applies to this libretro API header (libretro_d3d.h) + * --------------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the + * "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef LIBRETRO_DIRECT3D12_H__ +#define LIBRETRO_DIRECT3D12_H__ + +#include +#include + +#define RETRO_HW_RENDER_INTERFACE_D3D12_VERSION 1 + +struct retro_hw_render_interface_d3d12 +{ + /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12. */ + enum retro_hw_render_interface_type interface_type; + /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D12_VERSION. */ + unsigned interface_version; + + /* Opaque handle to the d3d12 backend in the frontend + * which must be passed along to all function pointers + * in this interface. + */ + void* handle; + ID3D12Device *device; + ID3D12CommandQueue *queue; + pD3DCompile D3DCompile; + D3D12_RESOURCE_STATES required_state; + void (*set_texture)(void* handle, ID3D12Resource* texture, DXGI_FORMAT format); +}; + +#endif /* LIBRETRO_DIRECT3D12_H__ */