mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
OpcodeDecoding: Get vertex size from the loader
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user