From a5d3af9cb0e2d3f254c1a686e524fb7fcbdd754c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 6 Nov 2022 07:59:01 -0800 Subject: [PATCH] GPU: Cleanup GetVertTypeID() usage. --- GPU/Common/DrawEngineCommon.cpp | 2 +- GPU/Common/SplineCommon.cpp | 2 +- GPU/Software/TransformUnit.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 35cfb7dfa9..bf6d7a432d 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -184,7 +184,7 @@ void DrawEngineCommon::Resized() { } u32 DrawEngineCommon::NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inPtr, int lowerBound, int upperBound, u32 vertType, int *vertexSize) { - const u32 vertTypeID = (vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24); + const u32 vertTypeID = GetVertTypeID(vertType, gstate.getUVGenMode()); VertexDecoder *dec = GetVertexDecoder(vertTypeID); if (vertexSize) *vertexSize = dec->VertexSize(); diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index b2358f401b..c5468e1203 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -507,7 +507,7 @@ void DrawEngineCommon::SubmitCurve(const void *control_points, const void *indic if (indices) GetIndexBounds(indices, num_points, vertType, &index_lower_bound, &index_upper_bound); - VertexDecoder *origVDecoder = GetVertexDecoder((vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24)); + VertexDecoder *origVDecoder = GetVertexDecoder(GetVertTypeID(vertType, gstate.getUVGenMode())); *bytesRead = num_points * origVDecoder->VertexSize(); // Simplify away bones and morph before proceeding diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index 043683b88c..795d39635f 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -137,7 +137,7 @@ void SoftwareDrawEngine::DispatchSubmitImm(GEPrimitiveType prim, TransformedVert } VertexDecoder *SoftwareDrawEngine::FindVertexDecoder(u32 vtype) { - const u32 vertTypeID = (vtype & 0xFFFFFF) | (gstate.getUVGenMode() << 24); + const u32 vertTypeID = GetVertTypeID(vtype, gstate.getUVGenMode()); return DrawEngineCommon::GetVertexDecoder(vertTypeID); }