mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-05 04:05:27 +02:00
Add some reporting to the software GPU.
This commit is contained in:
+13
-12
@@ -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<float> 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<int> GetTextureFunctionOutput(const Vec3<int>& 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<int>::AssignToAll(0);
|
||||
out_a = 0;
|
||||
}
|
||||
@@ -553,7 +554,7 @@ static inline Vec3<int> GetSourceFactor(int source_a, const Vec4<int>& dst)
|
||||
return Vec4<int>::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<int>();
|
||||
}
|
||||
}
|
||||
@@ -595,7 +596,7 @@ static inline Vec3<int> GetDestFactor(const Vec3<int>& source_rgb, int source_a,
|
||||
return Vec4<int>::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<int>();
|
||||
}
|
||||
}
|
||||
@@ -631,7 +632,7 @@ static inline Vec3<int> AlphaBlendingResult(const Vec3<int>& 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<int>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user