Pass the VertexDecoder pointer around

This commit is contained in:
Henrik Rydgård committed 2024-12-17 18:24:26 +01:00
1 parent e74101a2fb
commit 20ecbfdf57
8 files changed
+19 -18

No files matched your search

+4 -4
View File
@@ -274,7 +274,7 @@ void DrawEngineGLES::Flush() {
if (vshader->UseHWTransform()) {
if (applySkinInDecode_ && (lastVType_ & GE_VTYPE_WEIGHT_MASK)) {
// If software skinning, we're predecoding into "decoded". So make sure we're done, then push that content.
DecodeVerts(decoded_);
DecodeVerts(dec_, decoded_);
uint32_t size = numDecodedVerts_ * dec_->GetDecVtxFmt().stride;
u8 *dest = (u8 *)frameData.pushVertex->Allocate(size, 4, &vertexBuffer, &vertexBufferOffset);
memcpy(dest, decoded_, size);
@@ -282,13 +282,13 @@ void DrawEngineGLES::Flush() {
// Figure out how much pushbuffer space we need to allocate.
int vertsToDecode = ComputeNumVertsToDecode();
u8 *dest = (u8 *)frameData.pushVertex->Allocate(vertsToDecode * dec_->GetDecVtxFmt().stride, 4, &vertexBuffer, &vertexBufferOffset);
DecodeVerts(dest);
DecodeVerts(dec_, dest);
}
int vertexCount;
int maxIndex;
bool useElements;
DecodeVerts(decoded_);
DecodeVerts(dec_, decoded_);
DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false);
if (useElements) {
@@ -333,7 +333,7 @@ void DrawEngineGLES::Flush() {
lastVType_ |= (1 << 26);
dec_ = GetVertexDecoder(lastVType_);
}
DecodeVerts(decoded_);
DecodeVerts(dec_, decoded_);
int vertexCount = DecodeInds();
bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE;