2023-01-27 15:07:05 +13:00
|
|
|
// Copyright 2023 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-02-03 14:02:17 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
#include "VideoCommon/AbstractGfx.h"
|
2014-02-03 14:02:17 +01:00
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
class SWOGLWindow;
|
2021-06-09 07:42:21 -04:00
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
namespace SW
|
2014-02-03 14:02:17 +01:00
|
|
|
{
|
2023-01-27 15:07:05 +13:00
|
|
|
class SWGfx final : public AbstractGfx
|
2014-02-03 14:02:17 +01:00
|
|
|
{
|
|
|
|
public:
|
2023-12-12 20:33:41 -05:00
|
|
|
explicit SWGfx(std::unique_ptr<SWOGLWindow> window);
|
|
|
|
~SWGfx() override;
|
2014-02-03 14:02:17 +01:00
|
|
|
|
2018-10-03 23:03:13 +10:00
|
|
|
bool IsHeadless() const override;
|
2023-01-28 16:23:30 +13:00
|
|
|
virtual bool SupportsUtilityDrawing() const override;
|
2018-10-03 23:03:13 +10:00
|
|
|
|
2021-08-28 00:30:05 -05:00
|
|
|
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config,
|
|
|
|
std::string_view name) override;
|
2017-10-22 00:49:40 +10:00
|
|
|
std::unique_ptr<AbstractStagingTexture>
|
|
|
|
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;
|
2018-01-21 20:22:45 +10:00
|
|
|
std::unique_ptr<AbstractFramebuffer>
|
2023-05-28 20:59:02 -05:00
|
|
|
CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
|
|
|
|
std::vector<AbstractTexture*> additional_color_attachments) override;
|
2017-09-30 16:25:36 +10:00
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
void BindBackbuffer(const ClearColor& clear_color = {}) override;
|
|
|
|
|
2021-08-28 00:30:05 -05:00
|
|
|
std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage, std::string_view source,
|
|
|
|
std::string_view name) override;
|
2017-09-08 19:42:56 +10:00
|
|
|
std::unique_ptr<AbstractShader> CreateShaderFromBinary(ShaderStage stage, const void* data,
|
2021-08-28 00:30:05 -05:00
|
|
|
size_t length,
|
|
|
|
std::string_view name) override;
|
2019-02-15 11:59:50 +10:00
|
|
|
std::unique_ptr<NativeVertexFormat>
|
|
|
|
CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
|
2019-04-15 21:55:26 +10:00
|
|
|
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config,
|
|
|
|
const void* cache_data = nullptr,
|
|
|
|
size_t cache_data_length = 0) override;
|
2017-09-08 19:42:56 +10:00
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
void ShowImage(const AbstractTexture* source_texture,
|
|
|
|
const MathUtil::Rectangle<int>& source_rc) override;
|
|
|
|
|
|
|
|
void ScaleTexture(AbstractFramebuffer* dst_framebuffer, const MathUtil::Rectangle<int>& dst_rect,
|
|
|
|
const AbstractTexture* src_texture,
|
|
|
|
const MathUtil::Rectangle<int>& src_rect) override;
|
2014-02-03 14:02:17 +01:00
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
void SetScissorRect(const MathUtil::Rectangle<int>& rc) override;
|
2014-02-03 14:02:17 +01:00
|
|
|
|
2023-01-31 17:29:16 +13:00
|
|
|
void ClearRegion(const MathUtil::Rectangle<int>& target_rc, bool colorEnable, bool alphaEnable,
|
|
|
|
bool zEnable, u32 color, u32 z) override;
|
2021-06-09 07:42:21 -04:00
|
|
|
|
2023-02-18 12:35:02 -08:00
|
|
|
SurfaceInfo GetSurfaceInfo() const override;
|
|
|
|
|
2023-01-27 15:07:05 +13:00
|
|
|
private:
|
|
|
|
std::unique_ptr<SWOGLWindow> m_window;
|
2014-02-03 14:02:17 +01:00
|
|
|
};
|
2023-01-27 15:07:05 +13:00
|
|
|
|
|
|
|
} // namespace SW
|