2019-10-26 02:57:35 +00:00
|
|
|
#pragma once
|
2020-10-21 15:25:33 +00:00
|
|
|
#include "common/heap_array.h"
|
2019-10-26 02:57:35 +00:00
|
|
|
#include "gpu.h"
|
2020-11-21 03:32:58 +00:00
|
|
|
#include "gpu_sw_backend.h"
|
2020-10-21 15:25:33 +00:00
|
|
|
#include "host_display.h"
|
2019-10-26 02:57:35 +00:00
|
|
|
#include <array>
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
2019-11-03 14:39:48 +00:00
|
|
|
class HostDisplayTexture;
|
2019-10-26 02:57:35 +00:00
|
|
|
|
|
|
|
class GPU_SW final : public GPU
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GPU_SW();
|
|
|
|
~GPU_SW() override;
|
|
|
|
|
2021-03-28 03:47:10 +00:00
|
|
|
GPURenderer GetRendererType() const override;
|
2020-01-24 04:51:53 +00:00
|
|
|
|
2020-07-31 07:09:18 +00:00
|
|
|
bool Initialize(HostDisplay* host_display) override;
|
2021-01-23 16:52:52 +00:00
|
|
|
bool DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool update_display) override;
|
2021-01-23 09:00:54 +00:00
|
|
|
void Reset(bool clear_vram) override;
|
2020-11-21 03:32:58 +00:00
|
|
|
void UpdateSettings() override;
|
2020-05-14 15:31:48 +00:00
|
|
|
|
2019-10-26 02:57:35 +00:00
|
|
|
protected:
|
2020-11-21 03:32:58 +00:00
|
|
|
void ReadVRAM(u32 x, u32 y, u32 width, u32 height) override;
|
|
|
|
void FillVRAM(u32 x, u32 y, u32 width, u32 height, u32 color) override;
|
2020-12-14 16:19:28 +00:00
|
|
|
void UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data, bool set_mask, bool check_mask) override;
|
2020-11-21 03:32:58 +00:00
|
|
|
void CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 height) override;
|
2019-12-22 08:53:20 +00:00
|
|
|
|
2020-10-21 15:25:33 +00:00
|
|
|
template<HostDisplayPixelFormat display_format>
|
|
|
|
void CopyOut15Bit(u32 src_x, u32 src_y, u32 width, u32 height, u32 field, bool interlaced, bool interleaved);
|
|
|
|
void CopyOut15Bit(HostDisplayPixelFormat display_format, u32 src_x, u32 src_y, u32 width, u32 height, u32 field,
|
|
|
|
bool interlaced, bool interleaved);
|
|
|
|
|
|
|
|
template<HostDisplayPixelFormat display_format>
|
|
|
|
void CopyOut24Bit(u32 src_x, u32 src_y, u32 skip_x, u32 width, u32 height, u32 field, bool interlaced,
|
2020-05-25 17:18:04 +00:00
|
|
|
bool interleaved);
|
2020-10-21 15:25:33 +00:00
|
|
|
void CopyOut24Bit(HostDisplayPixelFormat display_format, u32 src_x, u32 src_y, u32 skip_x, u32 width, u32 height,
|
|
|
|
u32 field, bool interlaced, bool interleaved);
|
|
|
|
|
2020-08-02 17:26:11 +00:00
|
|
|
void ClearDisplay() override;
|
2019-10-26 02:57:35 +00:00
|
|
|
void UpdateDisplay() override;
|
|
|
|
|
2020-04-18 15:16:58 +00:00
|
|
|
void DispatchRenderCommand() override;
|
2019-10-26 02:57:35 +00:00
|
|
|
|
2020-11-21 03:32:58 +00:00
|
|
|
void FillBackendCommandParameters(GPUBackendCommand* cmd);
|
|
|
|
void FillDrawCommand(GPUBackendDrawCommand* cmd, GPURenderCommand rc);
|
2020-09-20 11:33:24 +00:00
|
|
|
|
2021-02-01 08:39:36 +00:00
|
|
|
HeapArray<u8, GPU_MAX_DISPLAY_WIDTH * GPU_MAX_DISPLAY_HEIGHT * sizeof(u32)> m_display_texture_buffer;
|
2020-10-21 15:25:33 +00:00
|
|
|
HostDisplayPixelFormat m_16bit_display_format = HostDisplayPixelFormat::RGB565;
|
|
|
|
HostDisplayPixelFormat m_24bit_display_format = HostDisplayPixelFormat::RGBA8;
|
2020-11-21 03:32:58 +00:00
|
|
|
|
|
|
|
GPU_SW_Backend m_backend;
|
2019-10-26 02:57:35 +00:00
|
|
|
};
|