Debian Codegraph @

Source/Core/VideoCommon/VertexLoader.h

raw symbols SCIP
1 // Copyright 2008 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 // Top vertex loaders
7 // Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
8
9 #include <string>
10
11 #include "Common/CommonTypes.h"
12 #include "Common/SmallVector.h"
13 #include "VideoCommon/VertexLoaderBase.h"
14
15 class VertexLoader;
16 typedef void (*TPipelineFunction)(VertexLoader* loader);
17
18 class VertexLoader : public VertexLoaderBase
19 {
20 public:
21 VertexLoader(const TVtxDesc& vtx_desc, const VAT& vtx_attr);
22
23 int RunVertices(const u8* src, u8* dst, int count) override;
24 // They are used for the communication with the loader functions
25 float m_posScale;
26 float m_tcScale[8];
27 int m_tcIndex;
28 int m_colIndex;
29
30 // Matrix components are first in GC format but later in PC format - we need to store it
31 // temporarily
32 // when decoding each vertex.
33 u8 m_curtexmtx[8];
34 int m_texmtxwrite;
35 int m_texmtxread;
36 bool m_vertexSkip;
37 int m_skippedVertices;
38 int m_remaining;
39
40 private:
41 // Pipeline.
42 // 1 pos matrix + 8 texture matrices + 1 position + 1 normal or normal/binormal/tangent
43 // + 2 colors + 8 texture coordinates or dummy texture coordinates + 8 texture matrices
44 // merged into texture coordinates + 1 skip gives a maximum of 30
45 // (Tested by VertexLoaderTest.LargeFloatVertexSpeed)
46 Common::SmallVector<TPipelineFunction, 30> m_PipelineStages;
47
48 void CompileVertexTranslator();
49
50 void WriteCall(TPipelineFunction);
51 };