GPU header cleanup: Avoid including GPUCommon.h in some places

This commit is contained in:
Henrik Rydgård committed 2025-11-23 20:37:37 +01:00
1 parent ac9e02c9b7
commit 7853881210
26 files changed
+174 -161

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
#pragma once
#include "GPU/GPUCommon.h"
#include "GPU/GPUDefinitions.h"
#include "Core/MemMap.h"
#define SCE_GE_LIST_COMPLETED 0
+1
View File
@@ -27,6 +27,7 @@
#include "Common/TimeUtil.h"
#include "Core/System.h"
#include "Core/Config.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/DrawEngineCommon.h"
#include "GPU/Common/SplineCommon.h"
#include "GPU/Common/DepthRaster.h"
+1
View File
@@ -24,6 +24,7 @@
#include "GPU/Math3D.h"
#include "GPU/GPUState.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/Common/GPUStateUtils.h"
#include "GPU/Common/IndexGenerator.h"
#include "GPU/Common/VertexDecoderCommon.h"
+1 -1
View File
@@ -33,8 +33,8 @@
#include "Core/Config.h"
#include "Core/ConfigValues.h"
#include "GPU/GPU.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/ge_constants.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/Draw2D.h"
enum {
+3
View File
@@ -22,6 +22,7 @@
#include "Common/Math/lin/matrix4x4.h"
#include "GPU/Common/VertexDecoderCommon.h"
#include "GPU/Common/TransformCommon.h"
#include "GPU/Common/GPUDebugInterface.h"
class FramebufferManagerCommon;
class TextureCacheCommon;
@@ -87,6 +88,8 @@ protected:
Lin::Matrix4x4 projMatrix_;
};
class DrawEngineCommon;
// Slow. See description in the cpp file.
u32 NormalizeVertices(SimpleVertex *sverts, u8 *bufPtr, const u8 *inPtr, int lowerBound, int upperBound, const VertexDecoder *dec, u32 vertType);
bool GetCurrentDrawAsDebugVertices(DrawEngineCommon *drawEngine, int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices);
-1
View File
@@ -28,7 +28,6 @@
#include "Common/LogReporting.h"
#include "GPU/ge_constants.h"
#include "GPU/Common/ShaderCommon.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUState.h"
#if PPSSPP_ARCH(ARM)
+1
View File
@@ -25,6 +25,7 @@
#include "GPU/GPUState.h"
#include "GPU/ge_constants.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/SplineCommon.h"
#include "GPU/Common/TransformCommon.h"
#include "GPU/Common/VertexDecoderCommon.h"
+1
View File
@@ -24,6 +24,7 @@
#include "GPU/ge_constants.h"
#include "GPU/GPUState.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/Common/GPUStateUtils.h"
#include "GPU/Common/DrawEngineCommon.h"
#include "GPU/D3D11/TextureCacheD3D11.h"
-1
View File
@@ -23,7 +23,6 @@
#include <wrl/client.h>
#include "GPU/GPU.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/TextureCacheCommon.h"
struct VirtualFramebuffer;
+1
View File
@@ -28,6 +28,7 @@
#include "GPU/ge_constants.h"
#include "GPU/GPUState.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/GLES/TextureCacheGLES.h"
#include "GPU/GLES/FramebufferManagerGLES.h"
#include "GPU/Common/TextureShaderCommon.h"
-1
View File
@@ -21,7 +21,6 @@
#include "Common/GPU/OpenGL/GLCommon.h"
#include "Common/GPU/OpenGL/GLRenderManager.h"
#include "Common/GPU/thin3d.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUState.h"
#include "GPU/Common/TextureCacheCommon.h"
+2 -150
View File
@@ -10,11 +10,11 @@
#include "Common/MemoryUtil.h"
#include "GPU/ge_constants.h"
#include "GPU/GPU.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUState.h"
#include "GPU/Debugger/Record.h"
#include "GPU/Debugger/Breakpoints.h"
#include "GPU/Common/ShaderCommon.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/Common/GPUDebugInterface.h"
#include "GPU/GPUDefinitions.h"
@@ -40,153 +40,7 @@ namespace Draw {
class DrawContext;
}
enum SignalBehavior {
PSP_GE_SIGNAL_NONE = 0x00,
PSP_GE_SIGNAL_HANDLER_SUSPEND = 0x01,
PSP_GE_SIGNAL_HANDLER_CONTINUE = 0x02,
PSP_GE_SIGNAL_HANDLER_PAUSE = 0x03,
PSP_GE_SIGNAL_SYNC = 0x08,
PSP_GE_SIGNAL_JUMP = 0x10,
PSP_GE_SIGNAL_CALL = 0x11,
PSP_GE_SIGNAL_RET = 0x12,
PSP_GE_SIGNAL_RJUMP = 0x13,
PSP_GE_SIGNAL_RCALL = 0x14,
PSP_GE_SIGNAL_OJUMP = 0x15,
PSP_GE_SIGNAL_OCALL = 0x16,
PSP_GE_SIGNAL_RTBP0 = 0x20,
PSP_GE_SIGNAL_RTBP1 = 0x21,
PSP_GE_SIGNAL_RTBP2 = 0x22,
PSP_GE_SIGNAL_RTBP3 = 0x23,
PSP_GE_SIGNAL_RTBP4 = 0x24,
PSP_GE_SIGNAL_RTBP5 = 0x25,
PSP_GE_SIGNAL_RTBP6 = 0x26,
PSP_GE_SIGNAL_RTBP7 = 0x27,
PSP_GE_SIGNAL_OTBP0 = 0x28,
PSP_GE_SIGNAL_OTBP1 = 0x29,
PSP_GE_SIGNAL_OTBP2 = 0x2A,
PSP_GE_SIGNAL_OTBP3 = 0x2B,
PSP_GE_SIGNAL_OTBP4 = 0x2C,
PSP_GE_SIGNAL_OTBP5 = 0x2D,
PSP_GE_SIGNAL_OTBP6 = 0x2E,
PSP_GE_SIGNAL_OTBP7 = 0x2F,
PSP_GE_SIGNAL_RCBP = 0x30,
PSP_GE_SIGNAL_OCBP = 0x38,
PSP_GE_SIGNAL_BREAK1 = 0xF0,
PSP_GE_SIGNAL_BREAK2 = 0xFF,
};
enum GPURunState {
GPUSTATE_RUNNING = 0,
GPUSTATE_DONE = 1,
GPUSTATE_STALL = 2,
GPUSTATE_INTERRUPT = 3,
GPUSTATE_ERROR = 4,
};
enum GPUSyncType {
GPU_SYNC_DRAW,
GPU_SYNC_LIST,
};
enum class WriteStencil {
NEEDS_CLEAR = 1,
STENCIL_IS_ZERO = 2,
IGNORE_ALPHA = 4,
};
ENUM_CLASS_BITOPS(WriteStencil);
enum class GPUCopyFlag {
NONE = 0,
FORCE_SRC_MATCH_MEM = 1,
FORCE_DST_MATCH_MEM = 2,
// Note: implies src == dst and FORCE_SRC_MATCH_MEM.
MEMSET = 4,
DEPTH_REQUESTED = 8,
DEBUG_NOTIFIED = 16,
DISALLOW_CREATE_VFB = 32,
};
ENUM_CLASS_BITOPS(GPUCopyFlag);
struct DisplayListStackEntry {
u32 pc;
u32 offsetAddr;
u32 baseAddr;
};
struct DisplayList {
int id;
u32 startpc;
u32 pc;
u32 stall;
DisplayListState state;
SignalBehavior signal;
int subIntrBase;
u16 subIntrToken;
DisplayListStackEntry stack[32];
int stackptr;
bool interrupted;
u64 waitUntilTicks;
bool interruptsEnabled;
bool pendingInterrupt;
bool started;
PSPPointer<u32_le> context;
u32 offsetAddr;
bool bboxResult;
u32 stackAddr;
u32 padding; // Android x86-32 does not round the structure size up to the closest multiple of 8 like the other platforms.
};
namespace Draw {
class DrawContext;
}
enum DrawType {
DRAW_UNKNOWN,
DRAW_PRIM,
DRAW_SPLINE,
DRAW_BEZIER,
};
enum {
FLAG_FLUSHBEFOREONCHANGE = 2,
FLAG_EXECUTE = 4,
FLAG_EXECUTEONCHANGE = 8,
FLAG_READS_PC = 16,
FLAG_WRITES_PC = 32,
FLAG_DIRTYONCHANGE = 64, // NOTE: Either this or FLAG_EXECUTE*, not both!
};
struct TransformedVertex {
union {
struct {
float x, y, z, pos_w; // in case of morph, preblend during decode
};
float pos[4];
};
union {
struct {
float u; float v; float uv_w; // scaled by uscale, vscale, if there
};
float uv[3];
};
float fog;
union {
u8 color0[4]; // prelit
u32 color0_32;
};
union {
u8 color1[4]; // prelit
u32 color1_32;
};
void CopyFromWithOffset(const TransformedVertex &other, float xoff, float yoff) {
this->x = other.x + xoff;
this->y = other.y + yoff;
memcpy(&this->z, &other.z, sizeof(*this) - sizeof(float) * 2);
}
};
struct DisplayLayoutConfig;
inline bool IsTrianglePrim(GEPrimitiveType prim) {
// TODO: KEEP_PREVIOUS is mistakenly treated as TRIANGLE here... This isn't new.
@@ -199,8 +53,6 @@ inline bool IsTrianglePrim(GEPrimitiveType prim) {
return prim > GE_PRIM_LINE_STRIP && prim != GE_PRIM_RECTANGLES;
}
struct DisplayLayoutConfig;
class GPUCommon : public GPUDebugInterface {
public:
// The constructor might run on the loader thread.
-1
View File
@@ -1492,7 +1492,6 @@ void GPUCommonHW::Execute_LoadClut(u32 op, u32 diff) {
textureCache_->LoadClut(gstate.getClutAddress(), gstate.getClutLoadBytes(), &recorder_);
}
void GPUCommonHW::Execute_WorldMtxNum(u32 op, u32 diff) {
if (!currentList) {
gstate.worldmtxnum = (GE_CMD_WORLDMATRIXNUMBER << 24) | (op & 0xF);
+154
View File
@@ -17,6 +17,13 @@
#pragma once
#include <cstring>
#include "Common/Common.h"
#include "Core/MemMap.h"
// X11, sigh.
#ifdef None
#undef None
@@ -69,3 +76,150 @@ enum class DLResult {
Error,
DebugBreak, // used for stepping, breakpoints
};
enum SignalBehavior {
PSP_GE_SIGNAL_NONE = 0x00,
PSP_GE_SIGNAL_HANDLER_SUSPEND = 0x01,
PSP_GE_SIGNAL_HANDLER_CONTINUE = 0x02,
PSP_GE_SIGNAL_HANDLER_PAUSE = 0x03,
PSP_GE_SIGNAL_SYNC = 0x08,
PSP_GE_SIGNAL_JUMP = 0x10,
PSP_GE_SIGNAL_CALL = 0x11,
PSP_GE_SIGNAL_RET = 0x12,
PSP_GE_SIGNAL_RJUMP = 0x13,
PSP_GE_SIGNAL_RCALL = 0x14,
PSP_GE_SIGNAL_OJUMP = 0x15,
PSP_GE_SIGNAL_OCALL = 0x16,
PSP_GE_SIGNAL_RTBP0 = 0x20,
PSP_GE_SIGNAL_RTBP1 = 0x21,
PSP_GE_SIGNAL_RTBP2 = 0x22,
PSP_GE_SIGNAL_RTBP3 = 0x23,
PSP_GE_SIGNAL_RTBP4 = 0x24,
PSP_GE_SIGNAL_RTBP5 = 0x25,
PSP_GE_SIGNAL_RTBP6 = 0x26,
PSP_GE_SIGNAL_RTBP7 = 0x27,
PSP_GE_SIGNAL_OTBP0 = 0x28,
PSP_GE_SIGNAL_OTBP1 = 0x29,
PSP_GE_SIGNAL_OTBP2 = 0x2A,
PSP_GE_SIGNAL_OTBP3 = 0x2B,
PSP_GE_SIGNAL_OTBP4 = 0x2C,
PSP_GE_SIGNAL_OTBP5 = 0x2D,
PSP_GE_SIGNAL_OTBP6 = 0x2E,
PSP_GE_SIGNAL_OTBP7 = 0x2F,
PSP_GE_SIGNAL_RCBP = 0x30,
PSP_GE_SIGNAL_OCBP = 0x38,
PSP_GE_SIGNAL_BREAK1 = 0xF0,
PSP_GE_SIGNAL_BREAK2 = 0xFF,
};
enum GPURunState {
GPUSTATE_RUNNING = 0,
GPUSTATE_DONE = 1,
GPUSTATE_STALL = 2,
GPUSTATE_INTERRUPT = 3,
GPUSTATE_ERROR = 4,
};
enum GPUSyncType {
GPU_SYNC_DRAW,
GPU_SYNC_LIST,
};
enum class WriteStencil {
NEEDS_CLEAR = 1,
STENCIL_IS_ZERO = 2,
IGNORE_ALPHA = 4,
};
ENUM_CLASS_BITOPS(WriteStencil);
enum class GPUCopyFlag {
NONE = 0,
FORCE_SRC_MATCH_MEM = 1,
FORCE_DST_MATCH_MEM = 2,
// Note: implies src == dst and FORCE_SRC_MATCH_MEM.
MEMSET = 4,
DEPTH_REQUESTED = 8,
DEBUG_NOTIFIED = 16,
DISALLOW_CREATE_VFB = 32,
};
ENUM_CLASS_BITOPS(GPUCopyFlag);
struct DisplayListStackEntry {
u32 pc;
u32 offsetAddr;
u32 baseAddr;
};
struct DisplayList {
int id;
u32 startpc;
u32 pc;
u32 stall;
DisplayListState state;
SignalBehavior signal;
int subIntrBase;
u16 subIntrToken;
DisplayListStackEntry stack[32];
int stackptr;
bool interrupted;
u64 waitUntilTicks;
bool interruptsEnabled;
bool pendingInterrupt;
bool started;
PSPPointer<u32_le> context;
u32 offsetAddr;
bool bboxResult;
u32 stackAddr;
u32 padding; // Android x86-32 does not round the structure size up to the closest multiple of 8 like the other platforms.
};
namespace Draw {
class DrawContext;
}
enum DrawType {
DRAW_UNKNOWN,
DRAW_PRIM,
DRAW_SPLINE,
DRAW_BEZIER,
};
enum {
FLAG_FLUSHBEFOREONCHANGE = 2,
FLAG_EXECUTE = 4,
FLAG_EXECUTEONCHANGE = 8,
FLAG_READS_PC = 16,
FLAG_WRITES_PC = 32,
FLAG_DIRTYONCHANGE = 64, // NOTE: Either this or FLAG_EXECUTE*, not both!
};
struct TransformedVertex {
union {
struct {
float x, y, z, pos_w; // in case of morph, preblend during decode
};
float pos[4];
};
union {
struct {
float u; float v; float uv_w; // scaled by uscale, vscale, if there
};
float uv[3];
};
float fog;
union {
u8 color0[4]; // prelit
u32 color0_32;
};
union {
u8 color1[4]; // prelit
u32 color1_32;
};
void CopyFromWithOffset(const TransformedVertex &other, float xoff, float yoff) {
this->x = other.x + xoff;
this->y = other.y + yoff;
memcpy(&this->z, &other.z, sizeof(*this) - sizeof(float) * 2);
}
};
+1
View File
@@ -37,6 +37,7 @@
#include "Common/Profiler/Profiler.h"
#include "Common/GPU/thin3d.h"
#include "GPU/GPUCommon.h"
#include "GPU/Software/DrawPixel.h"
#include "GPU/Software/Rasterizer.h"
#include "GPU/Software/Sampler.h"
+1
View File
@@ -18,6 +18,7 @@
#pragma once
#include <cstdint>
#include "GPU/GPUCommon.h"
#include "GPU/Common/GPUDebugInterface.h"
#include "Common/GPU/thin3d.h"
+1
View File
@@ -29,6 +29,7 @@
#include "Common/GPU/Vulkan/VulkanContext.h"
#include "Common/GPU/Vulkan/VulkanMemory.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/SplineCommon.h"
#include "GPU/Common/TransformCommon.h"
#include "GPU/Common/VertexDecoderCommon.h"
+1
View File
@@ -11,6 +11,7 @@
#include "GPU/Vulkan/PipelineManagerVulkan.h"
#include "GPU/Vulkan/ShaderManagerVulkan.h"
#include "GPU/Common/ShaderId.h"
#include "GPU/GPUDefinitions.h"
#include "Common/GPU/thin3d.h"
#include "Common/GPU/Vulkan/VulkanRenderManager.h"
#include "Common/GPU/Vulkan/VulkanQueueRunner.h"
+1
View File
@@ -38,6 +38,7 @@
#include "GPU/ge_constants.h"
#include "GPU/GPUState.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/Common/TextureShaderCommon.h"
#include "GPU/Common/PostShader.h"
#include "GPU/Common/TextureCacheCommon.h"
-1
View File
@@ -18,7 +18,6 @@
#pragma once
#include "Common/Data/Collections/Hashmaps.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUState.h"
#include "Common/GPU/Vulkan/VulkanContext.h"
#include "GPU/Common/TextureCacheCommon.h"
+1
View File
@@ -37,6 +37,7 @@
#include "Core/Config.h"
#include "Core/ConfigValues.h"
#include "Core/System.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferManagerCommon.h"
#include "GPU/Common/PresentationCommon.h"
-1
View File
@@ -81,7 +81,6 @@
#include "Core/HLE/sceUtility.h"
#include "GPU/Common/TextureReplacer.h"
#include "GPU/Common/PostShader.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferManagerCommon.h"
#include "Core/Core.h" // for Core_IsStepping
-1
View File
@@ -66,7 +66,6 @@
#include "UI/InstallZipScreen.h"
#include "Core/Config.h"
#include "Core/Loaders.h"
#include "GPU/GPUCommon.h"
#include "Common/Data/Text/I18n.h"
#if PPSSPP_PLATFORM(IOS) || PPSSPP_PLATFORM(MAC)
-1
View File
@@ -48,7 +48,6 @@
#include "Core/HLE/sceUtility.h"
#include "Core/Util/RecentFiles.h"
#include "GPU/GPUState.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/PostShader.h"
#include "UI/ControlMappingScreen.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include <algorithm>
#include "Common/CommonWindows.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUDefinitions.h"
class CtrlDisplayListView
{
+1
View File
@@ -44,6 +44,7 @@
#include "Core/WebServer.h"
#include "Core/HLE/sceUtility.h"
#include "Core/SaveState.h"
#include "GPU/GPUCommon.h"
#include "GPU/Common/FramebufferManagerCommon.h"
#include "Common/Log.h"
#include "Common/Log/LogManager.h"