mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-02 11:43:31 +00:00
Use GEPrimitiveType everywhere instead of stupid integer
This commit is contained in:
parent
554ca84556
commit
c6932e2675
@ -644,7 +644,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
|
||||
// when it's time to draw. As most PSP games set state redundantly ALL THE TIME, this is a huge optimization.
|
||||
|
||||
u32 count = data & 0xFFFF;
|
||||
u32 prim = data >> 16;
|
||||
GEPrimitiveType prim = static_cast<GEPrimitiveType>(data >> 16);
|
||||
|
||||
// Discard AA lines as we can't do anything that makes sense with these anyway. The SW plugin might, though.
|
||||
if ((prim == GE_PRIM_LINE_STRIP || prim == GE_PRIM_LINES) && (gstate.antiAliasEnable & 1))
|
||||
|
@ -29,7 +29,7 @@ static const u8 indexedPrimitiveType[7] = {
|
||||
};
|
||||
|
||||
void IndexGenerator::Reset() {
|
||||
prim_ = -1;
|
||||
prim_ = GE_PRIM_INVALID;
|
||||
count_ = 0;
|
||||
index_ = 0;
|
||||
seenPrims_ = 0;
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
void Reset();
|
||||
static bool PrimCompatible(int prim1, int prim2);
|
||||
bool PrimCompatible(int prim);
|
||||
int Prim() const { return prim_; }
|
||||
GEPrimitiveType Prim() const { return prim_; }
|
||||
|
||||
void AddPrim(int prim, int vertexCount);
|
||||
void TranslatePrim(int prim, int numInds, const u8 *inds, int indexOffset);
|
||||
@ -93,7 +93,7 @@ private:
|
||||
int index_;
|
||||
int count_;
|
||||
int pureCount_;
|
||||
int prim_;
|
||||
GEPrimitiveType prim_;
|
||||
int seenPrims_;
|
||||
};
|
||||
|
||||
|
@ -65,7 +65,7 @@ inline float clamp(float in, float min, float max) {
|
||||
|
||||
TransformDrawEngine::TransformDrawEngine()
|
||||
: collectedVerts(0),
|
||||
prevPrim_(-1),
|
||||
prevPrim_(GE_PRIM_INVALID),
|
||||
dec_(0),
|
||||
lastVType_(-1),
|
||||
curVbo_(0),
|
||||
@ -830,7 +830,7 @@ int TransformDrawEngine::EstimatePerVertexCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
void TransformDrawEngine::SubmitPrim(void *verts, void *inds, int prim, int vertexCount, u32 vertType, int forceIndexType, int *bytesRead) {
|
||||
void TransformDrawEngine::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int forceIndexType, int *bytesRead) {
|
||||
if (vertexCount == 0)
|
||||
return; // we ignore zero-sized draw calls.
|
||||
|
||||
@ -1031,7 +1031,7 @@ void TransformDrawEngine::DoFlush() {
|
||||
// This is not done on every drawcall, we should collect vertex data
|
||||
// until critical state changes. That's when we draw (flush).
|
||||
|
||||
int prim = prevPrim_;
|
||||
GEPrimitiveType prim = prevPrim_;
|
||||
ApplyDrawState(prim);
|
||||
|
||||
LinkedShader *program = shaderManager_->ApplyShader(prim);
|
||||
@ -1139,7 +1139,7 @@ void TransformDrawEngine::DoFlush() {
|
||||
vbo = vai->vbo;
|
||||
ebo = vai->ebo;
|
||||
vertexCount = vai->numVerts;
|
||||
prim = vai->prim;
|
||||
prim = static_cast<GEPrimitiveType>(vai->prim);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1158,7 +1158,7 @@ void TransformDrawEngine::DoFlush() {
|
||||
if (ebo)
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);
|
||||
vertexCount = vai->numVerts;
|
||||
prim = vai->prim;
|
||||
prim = static_cast<GEPrimitiveType>(vai->prim);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1219,5 +1219,5 @@ rotateVBO:
|
||||
indexGen.Reset();
|
||||
collectedVerts = 0;
|
||||
numDrawCalls = 0;
|
||||
prevPrim_ = -1;
|
||||
prevPrim_ = GE_PRIM_INVALID;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
vbo = 0;
|
||||
ebo = 0;
|
||||
numDCs = 0;
|
||||
prim = -1;
|
||||
prim = GE_PRIM_INVALID;
|
||||
numDraws = 0;
|
||||
numFrames = 0;
|
||||
lastFrame = gpuStats.numFlips;
|
||||
@ -96,7 +96,7 @@ class TransformDrawEngine : public GfxResourceHolder {
|
||||
public:
|
||||
TransformDrawEngine();
|
||||
virtual ~TransformDrawEngine();
|
||||
void SubmitPrim(void *verts, void *inds, int prim, int vertexCount, u32 vertexType, int forceIndexType, int *bytesRead);
|
||||
void SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertexType, int forceIndexType, int *bytesRead);
|
||||
void DrawBezier(int ucount, int vcount);
|
||||
void SubmitSpline(void* control_points, void* indices, int count_u, int count_v, int type_u, int type_v, GEPatchPrimType prim_type, u32 vertex_type);
|
||||
|
||||
@ -157,7 +157,7 @@ private:
|
||||
// Vertex collector state
|
||||
IndexGenerator indexGen;
|
||||
int collectedVerts;
|
||||
int prevPrim_;
|
||||
GEPrimitiveType prevPrim_;
|
||||
|
||||
// Cached vertex decoders
|
||||
std::map<u32, VertexDecoder *> decoderMap_;
|
||||
|
@ -476,13 +476,15 @@ enum GETexProjMapMode
|
||||
|
||||
enum GEPrimitiveType
|
||||
{
|
||||
GE_PRIM_POINTS=0,
|
||||
GE_PRIM_LINES=1,
|
||||
GE_PRIM_LINE_STRIP=2,
|
||||
GE_PRIM_TRIANGLES=3,
|
||||
GE_PRIM_TRIANGLE_STRIP=4,
|
||||
GE_PRIM_TRIANGLE_FAN=5,
|
||||
GE_PRIM_RECTANGLES=6,
|
||||
GE_PRIM_POINTS = 0,
|
||||
GE_PRIM_LINES = 1,
|
||||
GE_PRIM_LINE_STRIP = 2,
|
||||
GE_PRIM_TRIANGLES = 3,
|
||||
GE_PRIM_TRIANGLE_STRIP = 4,
|
||||
GE_PRIM_TRIANGLE_FAN = 5,
|
||||
GE_PRIM_RECTANGLES = 6,
|
||||
GE_PRIM_KEEP_PREVIOUS = 7,
|
||||
GE_PRIM_INVALID = -1,
|
||||
};
|
||||
|
||||
enum GELogicOp
|
||||
|
Loading…
x
Reference in New Issue
Block a user