mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
FrontendCommon: Mark host display files as final
Libretro has its own display classes now.
This commit is contained in:
parent
4436cd5b58
commit
817c7ef96a
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
namespace FrontendCommon {
|
namespace FrontendCommon {
|
||||||
|
|
||||||
class D3D11HostDisplay : public HostDisplay
|
class D3D11HostDisplay final : public HostDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -25,31 +25,31 @@ public:
|
||||||
D3D11HostDisplay();
|
D3D11HostDisplay();
|
||||||
~D3D11HostDisplay();
|
~D3D11HostDisplay();
|
||||||
|
|
||||||
virtual RenderAPI GetRenderAPI() const override;
|
RenderAPI GetRenderAPI() const override;
|
||||||
virtual void* GetRenderDevice() const override;
|
void* GetRenderDevice() const override;
|
||||||
virtual void* GetRenderContext() const override;
|
void* GetRenderContext() const override;
|
||||||
|
|
||||||
virtual bool HasRenderDevice() const override;
|
bool HasRenderDevice() const override;
|
||||||
virtual bool HasRenderSurface() const override;
|
bool HasRenderSurface() const override;
|
||||||
|
|
||||||
virtual bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual void DestroyRenderDevice() override;
|
void DestroyRenderDevice() override;
|
||||||
|
|
||||||
virtual bool MakeRenderContextCurrent() override;
|
bool MakeRenderContextCurrent() override;
|
||||||
virtual bool DoneRenderContextCurrent() override;
|
bool DoneRenderContextCurrent() override;
|
||||||
|
|
||||||
virtual bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||||
virtual void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||||
virtual bool SupportsFullscreen() const override;
|
bool SupportsFullscreen() const override;
|
||||||
virtual bool IsFullscreen() override;
|
bool IsFullscreen() override;
|
||||||
virtual bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||||
virtual AdapterAndModeList GetAdapterAndModeList() override;
|
AdapterAndModeList GetAdapterAndModeList() override;
|
||||||
virtual void DestroyRenderSurface() override;
|
void DestroyRenderSurface() override;
|
||||||
|
|
||||||
virtual bool SetPostProcessingChain(const std::string_view& config) override;
|
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||||
|
|
||||||
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
||||||
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
||||||
|
@ -65,10 +65,10 @@ public:
|
||||||
|
|
||||||
bool GetHostRefreshRate(float* refresh_rate) override;
|
bool GetHostRefreshRate(float* refresh_rate) override;
|
||||||
|
|
||||||
virtual void SetVSync(bool enabled) override;
|
void SetVSync(bool enabled) override;
|
||||||
|
|
||||||
virtual bool Render() override;
|
bool Render() override;
|
||||||
virtual bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
||||||
HostDisplayPixelFormat* out_format) override;
|
HostDisplayPixelFormat* out_format) override;
|
||||||
|
|
||||||
static AdapterAndModeList StaticGetAdapterAndModeList();
|
static AdapterAndModeList StaticGetAdapterAndModeList();
|
||||||
|
@ -78,12 +78,12 @@ protected:
|
||||||
|
|
||||||
static AdapterAndModeList GetAdapterAndModeList(IDXGIFactory* dxgi_factory);
|
static AdapterAndModeList GetAdapterAndModeList(IDXGIFactory* dxgi_factory);
|
||||||
|
|
||||||
virtual bool CreateResources() override;
|
bool CreateResources() override;
|
||||||
virtual void DestroyResources() override;
|
void DestroyResources() override;
|
||||||
|
|
||||||
virtual bool CreateImGuiContext() override;
|
bool CreateImGuiContext() override;
|
||||||
virtual void DestroyImGuiContext() override;
|
void DestroyImGuiContext() override;
|
||||||
virtual bool UpdateImGuiFontTexture() override;
|
bool UpdateImGuiFontTexture() override;
|
||||||
|
|
||||||
bool CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode);
|
bool CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode);
|
||||||
bool CreateSwapChainRTV();
|
bool CreateSwapChainRTV();
|
||||||
|
@ -108,8 +108,8 @@ protected:
|
||||||
bool CheckPostProcessingRenderTargets(u32 target_width, u32 target_height);
|
bool CheckPostProcessingRenderTargets(u32 target_width, u32 target_height);
|
||||||
void ApplyPostProcessingChain(ID3D11RenderTargetView* final_target, s32 final_left, s32 final_top, s32 final_width,
|
void ApplyPostProcessingChain(ID3D11RenderTargetView* final_target, s32 final_left, s32 final_top, s32 final_width,
|
||||||
s32 final_height, void* texture_handle, u32 texture_width, s32 texture_height,
|
s32 final_height, void* texture_handle, u32 texture_width, s32 texture_height,
|
||||||
s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
|
s32 texture_view_x, s32 texture_view_y, s32 texture_view_width, s32 texture_view_height,
|
||||||
s32 texture_view_height, u32 target_width, u32 target_height);
|
u32 target_width, u32 target_height);
|
||||||
|
|
||||||
ComPtr<ID3D11Device> m_device;
|
ComPtr<ID3D11Device> m_device;
|
||||||
ComPtr<ID3D11DeviceContext> m_context;
|
ComPtr<ID3D11DeviceContext> m_context;
|
||||||
|
|
|
@ -19,37 +19,37 @@
|
||||||
|
|
||||||
namespace FrontendCommon {
|
namespace FrontendCommon {
|
||||||
|
|
||||||
class OpenGLHostDisplay : public HostDisplay
|
class OpenGLHostDisplay final : public HostDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenGLHostDisplay();
|
OpenGLHostDisplay();
|
||||||
virtual ~OpenGLHostDisplay();
|
~OpenGLHostDisplay();
|
||||||
|
|
||||||
virtual RenderAPI GetRenderAPI() const override;
|
RenderAPI GetRenderAPI() const override;
|
||||||
virtual void* GetRenderDevice() const override;
|
void* GetRenderDevice() const override;
|
||||||
virtual void* GetRenderContext() const override;
|
void* GetRenderContext() const override;
|
||||||
|
|
||||||
virtual bool HasRenderDevice() const override;
|
bool HasRenderDevice() const override;
|
||||||
virtual bool HasRenderSurface() const override;
|
bool HasRenderSurface() const override;
|
||||||
|
|
||||||
virtual bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual void DestroyRenderDevice() override;
|
void DestroyRenderDevice() override;
|
||||||
|
|
||||||
virtual bool MakeRenderContextCurrent() override;
|
bool MakeRenderContextCurrent() override;
|
||||||
virtual bool DoneRenderContextCurrent() override;
|
bool DoneRenderContextCurrent() override;
|
||||||
|
|
||||||
virtual bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||||
virtual void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||||
virtual bool SupportsFullscreen() const override;
|
bool SupportsFullscreen() const override;
|
||||||
virtual bool IsFullscreen() override;
|
bool IsFullscreen() override;
|
||||||
virtual bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||||
virtual AdapterAndModeList GetAdapterAndModeList() override;
|
AdapterAndModeList GetAdapterAndModeList() override;
|
||||||
virtual void DestroyRenderSurface() override;
|
void DestroyRenderSurface() override;
|
||||||
|
|
||||||
virtual bool SetPostProcessingChain(const std::string_view& config) override;
|
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||||
|
|
||||||
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
||||||
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
||||||
|
@ -64,22 +64,22 @@ public:
|
||||||
void EndSetDisplayPixels() override;
|
void EndSetDisplayPixels() override;
|
||||||
bool SetDisplayPixels(HostDisplayPixelFormat format, u32 width, u32 height, const void* buffer, u32 pitch) override;
|
bool SetDisplayPixels(HostDisplayPixelFormat format, u32 width, u32 height, const void* buffer, u32 pitch) override;
|
||||||
|
|
||||||
virtual void SetVSync(bool enabled) override;
|
void SetVSync(bool enabled) override;
|
||||||
|
|
||||||
virtual bool Render() override;
|
bool Render() override;
|
||||||
virtual bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
||||||
HostDisplayPixelFormat* out_format) override;
|
HostDisplayPixelFormat* out_format) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char* GetGLSLVersionString() const;
|
const char* GetGLSLVersionString() const;
|
||||||
std::string GetGLSLVersionHeader() const;
|
std::string GetGLSLVersionHeader() const;
|
||||||
|
|
||||||
virtual bool CreateResources() override;
|
bool CreateResources() override;
|
||||||
virtual void DestroyResources() override;
|
void DestroyResources() override;
|
||||||
|
|
||||||
virtual bool CreateImGuiContext() override;
|
bool CreateImGuiContext() override;
|
||||||
virtual void DestroyImGuiContext() override;
|
void DestroyImGuiContext() override;
|
||||||
virtual bool UpdateImGuiFontTexture() override;
|
bool UpdateImGuiFontTexture() override;
|
||||||
|
|
||||||
void BindDisplayPixelsTexture();
|
void BindDisplayPixelsTexture();
|
||||||
void UpdateDisplayPixelsTextureFilter();
|
void UpdateDisplayPixelsTextureFilter();
|
||||||
|
|
|
@ -16,37 +16,37 @@ class SwapChain;
|
||||||
|
|
||||||
namespace FrontendCommon {
|
namespace FrontendCommon {
|
||||||
|
|
||||||
class VulkanHostDisplay : public HostDisplay
|
class VulkanHostDisplay final : public HostDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VulkanHostDisplay();
|
VulkanHostDisplay();
|
||||||
virtual ~VulkanHostDisplay();
|
~VulkanHostDisplay();
|
||||||
|
|
||||||
virtual RenderAPI GetRenderAPI() const override;
|
RenderAPI GetRenderAPI() const override;
|
||||||
virtual void* GetRenderDevice() const override;
|
void* GetRenderDevice() const override;
|
||||||
virtual void* GetRenderContext() const override;
|
void* GetRenderContext() const override;
|
||||||
|
|
||||||
virtual bool HasRenderDevice() const override;
|
bool HasRenderDevice() const override;
|
||||||
virtual bool HasRenderSurface() const override;
|
bool HasRenderSurface() const override;
|
||||||
|
|
||||||
virtual bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
|
||||||
bool threaded_presentation) override;
|
bool threaded_presentation) override;
|
||||||
virtual void DestroyRenderDevice() override;
|
void DestroyRenderDevice() override;
|
||||||
|
|
||||||
virtual bool MakeRenderContextCurrent() override;
|
bool MakeRenderContextCurrent() override;
|
||||||
virtual bool DoneRenderContextCurrent() override;
|
bool DoneRenderContextCurrent() override;
|
||||||
|
|
||||||
virtual bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||||
virtual void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||||
virtual bool SupportsFullscreen() const override;
|
bool SupportsFullscreen() const override;
|
||||||
virtual bool IsFullscreen() override;
|
bool IsFullscreen() override;
|
||||||
virtual bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||||
virtual AdapterAndModeList GetAdapterAndModeList() override;
|
AdapterAndModeList GetAdapterAndModeList() override;
|
||||||
virtual void DestroyRenderSurface() override;
|
void DestroyRenderSurface() override;
|
||||||
|
|
||||||
virtual bool SetPostProcessingChain(const std::string_view& config) override;
|
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||||
|
|
||||||
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
||||||
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
HostDisplayPixelFormat format, const void* data, u32 data_stride,
|
||||||
|
@ -61,10 +61,10 @@ public:
|
||||||
u32* out_pitch) override;
|
u32* out_pitch) override;
|
||||||
void EndSetDisplayPixels() override;
|
void EndSetDisplayPixels() override;
|
||||||
|
|
||||||
virtual void SetVSync(bool enabled) override;
|
void SetVSync(bool enabled) override;
|
||||||
|
|
||||||
virtual bool Render() override;
|
bool Render() override;
|
||||||
virtual bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
|
||||||
HostDisplayPixelFormat* out_format) override;
|
HostDisplayPixelFormat* out_format) override;
|
||||||
|
|
||||||
static AdapterAndModeList StaticGetAdapterAndModeList(const WindowInfo* wi);
|
static AdapterAndModeList StaticGetAdapterAndModeList(const WindowInfo* wi);
|
||||||
|
@ -97,14 +97,14 @@ protected:
|
||||||
u32 target_width, u32 target_height);
|
u32 target_width, u32 target_height);
|
||||||
|
|
||||||
// Can be overridden by frontends.
|
// Can be overridden by frontends.
|
||||||
virtual VkRenderPass GetRenderPassForDisplay() const;
|
VkRenderPass GetRenderPassForDisplay() const;
|
||||||
|
|
||||||
virtual bool CreateResources() override;
|
bool CreateResources() override;
|
||||||
virtual void DestroyResources() override;
|
void DestroyResources() override;
|
||||||
|
|
||||||
virtual bool CreateImGuiContext() override;
|
bool CreateImGuiContext() override;
|
||||||
virtual void DestroyImGuiContext() override;
|
void DestroyImGuiContext() override;
|
||||||
virtual bool UpdateImGuiFontTexture() override;
|
bool UpdateImGuiFontTexture() override;
|
||||||
|
|
||||||
void BeginSwapChainRenderPass(VkFramebuffer framebuffer, u32 width, u32 height);
|
void BeginSwapChainRenderPass(VkFramebuffer framebuffer, u32 width, u32 height);
|
||||||
void RenderDisplay();
|
void RenderDisplay();
|
||||||
|
|
Loading…
Reference in a new issue