Shrink the DeferredDrawcall struct, because why not. Assorted cleanup

This commit is contained in:
Henrik Rydgård 2022-09-01 11:07:30 +02:00
parent 24d674d2bc
commit c9048c3748
6 changed files with 14 additions and 21 deletions

View file

@ -129,6 +129,6 @@ protected:
private:
DialogStatus status = SCE_UTILITY_STATUS_NONE;
UtilityDialogType dialogType_;
UtilityDialogType dialogType_ = UtilityDialogType::NONE;
bool volatileLocked_ = false;
};

View file

@ -285,9 +285,6 @@ struct SaveFileInfo
PPGeImage *texture = nullptr;
SaveFileInfo() {
}
void DoState(PointerWrap &p);
};

View file

@ -701,12 +701,11 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti
DeferredDrawCall &dc = drawCalls[numDrawCalls];
dc.verts = verts;
dc.inds = inds;
dc.vertexCount = vertexCount;
dc.indexType = (vertTypeID & GE_VTYPE_IDX_MASK) >> GE_VTYPE_IDX_SHIFT;
dc.prim = prim;
dc.vertexCount = vertexCount;
dc.uvScale = gstate_c.uv;
dc.cullMode = cullMode;
dc.uvScale = gstate_c.uv;
if (inds) {
GetIndexBounds(inds, vertexCount, vertTypeID, &dc.indexLowerBound, &dc.indexUpperBound);
} else {

View file

@ -165,10 +165,10 @@ protected:
u32 vertexCount;
u8 indexType;
s8 prim;
u8 cullMode;
u16 indexLowerBound;
u16 indexUpperBound;
UVScale uvScale;
int cullMode;
};
enum { MAX_DEFERRED_DRAW_CALLS = 128 };

View file

@ -176,9 +176,6 @@ void PrintDecodedVertex(VertexReader &vtx) {
printf("P: %f %f %f\n", pos[0], pos[1], pos[2]);
}
VertexDecoder::VertexDecoder() : decoded_(nullptr), ptr_(nullptr), jitted_(0), jittedSize_(0) {
}
void VertexDecoder::Step_WeightsU8() const
{
u8 *wt = (u8 *)(decoded_ + decFmt.w0off);

View file

@ -125,10 +125,13 @@ public:
case DEC_FLOAT_3:
{
const float *f = (const float *)(data_ + decFmt_.posoff);
memcpy(pos, f, 12);
if (isThrough()) {
pos[0] = f[0];
pos[1] = f[1];
if (!isThrough()) {
pos[2] = f[2];
} else {
// Integer value passed in a float. Clamped to 0, 65535.
const float z = (int)pos[2] * (1.0f / 65535.0f);
const float z = (int)f[2] * (1.0f / 65535.0f);
pos[2] = z > 1.0f ? 1.0f : (z < 0.0f ? 0.0f : z);
}
}
@ -443,8 +446,6 @@ struct VertexDecoderOptions {
class VertexDecoder {
public:
VertexDecoder();
// A jit cache is not mandatory.
void SetVertexType(u32 vtype, const VertexDecoderOptions &options, VertexDecoderJitCache *jitCache = nullptr);
@ -549,11 +550,10 @@ public:
int ToString(char *output) const;
// Mutable decoder state
mutable u8 *decoded_;
mutable const u8 *ptr_;
JittedVertexDecoder jitted_;
int32_t jittedSize_;
mutable u8 *decoded_ = nullptr;
mutable const u8 *ptr_ = nullptr;
JittedVertexDecoder jitted_ = 0;
int32_t jittedSize_ = 0;
// "Immutable" state, set at startup