2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-02-10 19:54:46 +01:00
|
|
|
#pragma once
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2009-02-15 14:45:03 +01:00
|
|
|
// Top vertex loaders
|
|
|
|
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
|
|
|
|
2008-11-25 22:15:31 +01:00
|
|
|
#include <string>
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-09-08 03:06:58 +02:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-12-13 01:51:14 +01:00
|
|
|
#include "VideoCommon/VertexLoaderBase.h"
|
|
|
|
|
2016-01-31 20:51:55 +01:00
|
|
|
class DataReader;
|
2014-12-13 10:57:46 +01:00
|
|
|
class VertexLoader;
|
2015-06-19 21:18:16 +02:00
|
|
|
typedef void (*TPipelineFunction)(VertexLoader* loader);
|
2014-07-08 15:58:25 +02:00
|
|
|
|
2014-12-13 01:51:14 +01:00
|
|
|
class VertexLoader : public VertexLoaderBase
|
2008-10-25 17:53:43 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
VertexLoader(const TVtxDesc& vtx_desc, const VAT& vtx_attr);
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2015-04-06 11:44:13 +02:00
|
|
|
int RunVertices(DataReader src, DataReader dst, int count) override;
|
2014-12-13 10:57:46 +01:00
|
|
|
// They are used for the communication with the loader functions
|
2015-01-19 18:33:08 +01:00
|
|
|
float m_posScale;
|
|
|
|
float m_tcScale[8];
|
2014-12-13 10:57:46 +01:00
|
|
|
int m_tcIndex;
|
|
|
|
int m_colIndex;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2014-12-13 10:57:46 +01:00
|
|
|
// 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;
|
2014-12-21 14:29:44 +01:00
|
|
|
bool m_vertexSkip;
|
|
|
|
int m_skippedVertices;
|
2015-06-01 19:58:27 +02:00
|
|
|
int m_counter;
|
2014-12-13 10:57:46 +01:00
|
|
|
|
2008-10-25 17:53:43 +02:00
|
|
|
private:
|
2014-02-23 15:14:27 +01:00
|
|
|
// Pipeline.
|
2008-11-25 22:57:02 +01:00
|
|
|
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
|
2008-10-25 14:35:55 +02:00
|
|
|
int m_numPipelineStages;
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2008-10-25 17:53:43 +02:00
|
|
|
void CompileVertexTranslator();
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2008-10-25 17:53:43 +02:00
|
|
|
void WriteCall(TPipelineFunction);
|
2008-07-12 19:40:22 +02:00
|
|
|
};
|