1
// Copyright (c) 2012- PPSSPP Project.
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
20
#include "GPU/GPUCommon.h"
21
#include "GPU/Common/GPUDebugInterface.h"
30
inline void Set16(int x, int y, int stride, u16 v) {
31
as16[x + y * stride] = v;
34
inline void Set32(int x, int y, int stride, u32 v) {
35
as32[x + y * stride] = v;
38
inline u16 Get16(int x, int y, int stride) {
39
return as16[x + y * stride];
42
inline u32 Get32(int x, int y, int stride) {
43
return as32[x + y * stride];
49
class SoftGPU : public GPUCommon {
53
void InitClear() override {}
54
void ExecuteOp(u32 op, u32 diff) override;
56
void BeginFrame() override {}
57
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
58
void CopyDisplayToOutput() override;
59
void UpdateStats() override;
60
void InvalidateCache(u32 addr, int size, GPUInvalidationType type) override;
61
void NotifyVideoUpload(u32 addr, int size, int width, int format) override;
62
bool PerformMemoryCopy(u32 dest, u32 src, int size) override;
63
bool PerformMemorySet(u32 dest, u8 v, int size) override;
64
bool PerformMemoryDownload(u32 dest, int size) override;
65
bool PerformMemoryUpload(u32 dest, int size) override;
66
bool PerformStencilUpload(u32 dest, int size) override;
67
void ClearCacheNextFrame() override {}
69
void DeviceLost() override;
70
void DumpNextFrame() override {}
72
void Resized() override {}
73
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
74
primaryInfo = "Software";
75
fullInfo = "Software";
78
bool FramebufferDirty() override;
80
bool FramebufferReallyDirty() override {
81
return !(gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME);
84
bool GetCurrentFramebuffer(GPUDebugBuffer &buffer) override;
85
bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;
86
bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;
87
bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override;
88
bool GetCurrentClut(GPUDebugBuffer &buffer) override;
89
bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
92
void FastRunLoop(DisplayList &list) override;
93
void ProcessEvent(GPUEvent ev) override;
94
void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight);
97
void CopyDisplayToOutputInternal();
99
bool framebufferDirty_;
100
u32 displayFramebuf_;
102
GEBufferFormat displayFormat_;