mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix size calculation for weights. Old one would waste space for small weights.
This commit is contained in:
parent
0ae3c041d2
commit
9add78722d
1 changed files with 4 additions and 5 deletions
|
@ -593,25 +593,24 @@ void VertexDecoder::SetVertexType(u32 fmt) {
|
|||
steps_[numSteps_++] = wtstep[weighttype];
|
||||
|
||||
int fmtBase = DEC_FLOAT_1;
|
||||
int weightSize = 4;
|
||||
if (weighttype == GE_VTYPE_WEIGHT_8BIT >> GE_VTYPE_WEIGHT_SHIFT) {
|
||||
fmtBase = DEC_U8_1;
|
||||
weightSize = 1;
|
||||
} else if (weighttype == GE_VTYPE_WEIGHT_16BIT >> GE_VTYPE_WEIGHT_SHIFT) {
|
||||
fmtBase = DEC_U16_1;
|
||||
weightSize = 2;
|
||||
}
|
||||
|
||||
if (nweights < 5) {
|
||||
decFmt.w0off = decOff;
|
||||
decFmt.w0fmt = fmtBase + nweights - 1;
|
||||
decOff += DecFmtSize(decFmt.w0fmt);
|
||||
} else {
|
||||
decFmt.w0off = decOff;
|
||||
decFmt.w0fmt = fmtBase + 3;
|
||||
decFmt.w1off = decOff + 4 * weightSize;
|
||||
decOff += DecFmtSize(decFmt.w0fmt);
|
||||
decFmt.w1off = decOff;
|
||||
decFmt.w1fmt = fmtBase + nweights - 5;
|
||||
decOff += DecFmtSize(decFmt.w1fmt);
|
||||
}
|
||||
decOff += nweights * 4;
|
||||
}
|
||||
|
||||
if (tc) {
|
||||
|
|
Loading…
Add table
Reference in a new issue