mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
0bcd3c79bb
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways. Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
// Top vertex loaders
|
|
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
|
|
|
#include <string>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "VideoCommon/VertexLoaderBase.h"
|
|
|
|
class VertexLoader;
|
|
typedef void (*TPipelineFunction)(VertexLoader* loader);
|
|
|
|
class VertexLoader : public VertexLoaderBase
|
|
{
|
|
public:
|
|
VertexLoader(const TVtxDesc& vtx_desc, const VAT& vtx_attr);
|
|
|
|
int RunVertices(const u8* src, u8* dst, int count) override;
|
|
// They are used for the communication with the loader functions
|
|
float m_posScale;
|
|
float m_tcScale[8];
|
|
int m_tcIndex;
|
|
int m_colIndex;
|
|
|
|
// Matrix components are first in GC format but later in PC format - we need to store it
|
|
// temporarily
|
|
// when decoding each vertex.
|
|
u8 m_curtexmtx[8];
|
|
int m_texmtxwrite;
|
|
int m_texmtxread;
|
|
bool m_vertexSkip;
|
|
int m_skippedVertices;
|
|
int m_remaining;
|
|
|
|
private:
|
|
// Pipeline.
|
|
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
|
|
int m_numPipelineStages;
|
|
|
|
void CompileVertexTranslator();
|
|
|
|
void WriteCall(TPipelineFunction);
|
|
};
|