From 8d16b76c15bd24df41c19a49cd0e30ce44e5bdef Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 1 Sep 2013 01:10:12 -0700 Subject: [PATCH] Add some reporting to the software GPU. --- GPU/Software/Rasterizer.cpp | 25 +++++++++++++------------ GPU/Software/SoftGpu.cpp | 14 +++++++------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 1f5de39877..d571ebb84c 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -15,11 +15,12 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "../../Core/MemMap.h" -#include "../GPUState.h" +#include "Core/MemMap.h" +#include "Core/Reporting.h" +#include "GPU/GPUState.h" -#include "Rasterizer.h" -#include "Colors.h" +#include "GPU/Software/Rasterizer.h" +#include "GPU/Software/Colors.h" extern u8* fb; extern u8* depthbuf; @@ -85,7 +86,7 @@ static inline u32 LookupColor(unsigned int index, unsigned int level) return DecodeRGBA8888(clut[index + clutSharingOffset]); default: - ERROR_LOG(G3D, "Unsupported palette format: %x", gstate.getClutPaletteFormat()); + ERROR_LOG_REPORT(G3D, "Software: Unsupported palette format: %x", gstate.getClutPaletteFormat()); return 0; } } @@ -145,7 +146,7 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData& if (gstate.getUVProjMode() == GE_PROJMAP_POSITION) { source = ((v0.modelpos * w0 + v1.modelpos * w1 + v2.modelpos * w2) / (w0+w1+w2)); } else { - ERROR_LOG(G3D, "Unsupported UV projection mode %x", gstate.getUVProjMode()); + ERROR_LOG_REPORT(G3D, "Software: Unsupported UV projection mode %x", gstate.getUVProjMode()); } Mat3x3 tgen(gstate.tgenMatrix); @@ -155,7 +156,7 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData& } break; default: - ERROR_LOG(G3D, "Unsupported texture mapping mode %x!", gstate.getUVGenMode()); + ERROR_LOG_REPORT(G3D, "Software: Unsupported texture mapping mode %x!", gstate.getUVGenMode()); break; } } @@ -213,7 +214,7 @@ static inline u32 SampleNearest(int level, unsigned int u, unsigned int v) return LookupColor(gstate.transformClutIndex(val), level); } default: - ERROR_LOG(G3D, "Unsupported texture format: %x", texfmt); + ERROR_LOG_REPORT(G3D, "Software: Unsupported texture format: %x", texfmt); return 0; } } @@ -452,7 +453,7 @@ static inline Vec4 GetTextureFunctionOutput(const Vec3& prim_color_rgb break; default: - ERROR_LOG(G3D, "Unknown texture function %x", gstate.getTextureFunction()); + ERROR_LOG_REPORT(G3D, "Software: Unknown texture function %x", gstate.getTextureFunction()); out_rgb = Vec3::AssignToAll(0); out_a = 0; } @@ -553,7 +554,7 @@ static inline Vec3 GetSourceFactor(int source_a, const Vec4& dst) return Vec4::FromRGBA(gstate.getFixA()).rgb(); default: - ERROR_LOG(G3D, "Unknown source factor %x", gstate.getBlendFuncA()); + ERROR_LOG_REPORT(G3D, "Software: Unknown source factor %x", gstate.getBlendFuncA()); return Vec3(); } } @@ -595,7 +596,7 @@ static inline Vec3 GetDestFactor(const Vec3& source_rgb, int source_a, return Vec4::FromRGBA(gstate.getFixB()).rgb(); default: - ERROR_LOG(G3D, "Unknown dest factor %x", gstate.getBlendFuncB()); + ERROR_LOG_REPORT(G3D, "Software: Unknown dest factor %x", gstate.getBlendFuncB()); return Vec3(); } } @@ -631,7 +632,7 @@ static inline Vec3 AlphaBlendingResult(const Vec3& source_rgb, int sou ::abs(source_rgb.b() - dst.b())); default: - ERROR_LOG(G3D, "Unknown blend function %x", gstate.getBlendEq()); + ERROR_LOG_REPORT(G3D, "Software: Unknown blend function %x", gstate.getBlendEq()); return Vec3(); } } diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 9c89a31e26..3a46ab4d39 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -192,7 +192,7 @@ void CopyToCurrentFboFromRam(u8* data, int srcwidth, int srcheight, int dstwidth break; default: - ERROR_LOG_REPORT(G3D, "Unexpected framebuffer format: %d", gstate.FrameBufFormat()); + ERROR_LOG_REPORT(G3D, "Software: Unexpected framebuffer format: %d", gstate.FrameBufFormat()); } } @@ -304,12 +304,12 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) }; if (type != GE_PRIM_TRIANGLES && type != GE_PRIM_TRIANGLE_STRIP && type != GE_PRIM_TRIANGLE_FAN && type != GE_PRIM_RECTANGLES) { - ERROR_LOG(G3D, "DL DrawPrim type: %s count: %i vaddr= %08x, iaddr= %08x", type<7 ? types[type] : "INVALID", count, gstate_c.vertexAddr, gstate_c.indexAddr); + ERROR_LOG_REPORT(G3D, "Software: DL DrawPrim type: %s count: %i vaddr= %08x, iaddr= %08x", type<7 ? types[type] : "INVALID", count, gstate_c.vertexAddr, gstate_c.indexAddr); break; } if (!Memory::IsValidAddress(gstate_c.vertexAddr)) { - ERROR_LOG(G3D, "Bad vertex address %08x!", gstate_c.vertexAddr); + ERROR_LOG_REPORT(G3D, "Software: Bad vertex address %08x!", gstate_c.vertexAddr); break; } @@ -317,7 +317,7 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) void *indices = NULL; if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) { if (!Memory::IsValidAddress(gstate_c.indexAddr)) { - ERROR_LOG(G3D, "Bad index address %08x!", gstate_c.indexAddr); + ERROR_LOG_REPORT(G3D, "Software: Bad index address %08x!", gstate_c.indexAddr); break; } indices = Memory::GetPointer(gstate_c.indexAddr); @@ -344,7 +344,7 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) int sp_vtype = (data >> 18) & 0x3; if (!Memory::IsValidAddress(gstate_c.vertexAddr)) { - ERROR_LOG(G3D, "Bad vertex address %08x!", gstate_c.vertexAddr); + ERROR_LOG_REPORT(G3D, "Software: Bad vertex address %08x!", gstate_c.vertexAddr); break; } @@ -352,14 +352,14 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) void *indices = NULL; if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) { if (!Memory::IsValidAddress(gstate_c.indexAddr)) { - ERROR_LOG(G3D, "Bad index address %08x!", gstate_c.indexAddr); + ERROR_LOG_REPORT(G3D, "Software: Bad index address %08x!", gstate_c.indexAddr); break; } indices = Memory::GetPointer(gstate_c.indexAddr); } if (gstate.getPatchPrimitiveType() != GE_PATCHPRIM_TRIANGLES) { - ERROR_LOG(G3D, "Unsupported patch primitive %x", gstate.patchprimitive&3); + ERROR_LOG_REPORT(G3D, "Software: Unsupported patch primitive %x", gstate.patchprimitive&3); break; }