summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OpcodeDecoding.h
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2022-09-18 22:38:06 -0400
committerGitHub <noreply@github.com>2022-09-18 22:38:06 -0400
commit6f4f5b0b7b62b3a1eb9d0e069b38de1bbedde6c6 (patch)
tree8d9035d5a97d113131d630bbe4311d4748a4d681 /Source/Core/VideoCommon/OpcodeDecoding.h
parentd19994b4bd9f18b5d917105ab6bac4131be8d2e5 (diff)
parent2db74e7f21cdad4abc7f5148ffcdd9e801093b42 (diff)
Merge pull request #11067 from K0bin/cache-vertex-size
OpcodeDecoding: Cache vertex sizes
Diffstat (limited to 'Source/Core/VideoCommon/OpcodeDecoding.h')
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.h b/Source/Core/VideoCommon/OpcodeDecoding.h
index 1badf63196..2035f5c733 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.h
+++ b/Source/Core/VideoCommon/OpcodeDecoding.h
@@ -110,6 +110,8 @@ public:
// Get the current CP state. Needed for vertex decoding; will also be mutated for CP commands.
virtual CPState& GetCPState() = 0;
+
+ virtual u32 GetVertexSize(u8 vat) = 0;
#endif
};
@@ -229,8 +231,7 @@ static DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, T& cal
(cmdbyte & OpcodeDecoder::GX_PRIMITIVE_MASK) >> OpcodeDecoder::GX_PRIMITIVE_SHIFT);
const u8 vat = cmdbyte & OpcodeDecoder::GX_VAT_MASK;
- const u32 vertex_size = VertexLoaderBase::GetVertexSize(callback.GetCPState().vtx_desc,
- callback.GetCPState().vtx_attr[vat]);
+ const u32 vertex_size = callback.GetVertexSize(vat);
const u16 num_vertices = Common::swap16(&data[1]);
if (available < 3 + num_vertices * vertex_size)