2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:29:41 +00:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2015-10-09 18:50:36 +00:00
|
|
|
#include "VideoCommon/BPMemory.h"
|
2014-07-30 00:55:07 +00:00
|
|
|
|
2009-10-12 00:48:24 +00:00
|
|
|
class Tev
|
2010-03-09 04:38:07 +00:00
|
|
|
{
|
|
|
|
struct InputRegType
|
|
|
|
{
|
|
|
|
unsigned a : 8;
|
|
|
|
unsigned b : 8;
|
|
|
|
unsigned c : 8;
|
|
|
|
signed d : 11;
|
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-03-09 04:38:07 +00:00
|
|
|
struct TextureCoordinateType
|
|
|
|
{
|
|
|
|
signed s : 24;
|
|
|
|
signed t : 24;
|
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-12-31 06:45:18 +00:00
|
|
|
// color order: ABGR
|
|
|
|
s16 Reg[4][4];
|
2009-10-12 00:48:24 +00:00
|
|
|
s16 KonstantColors[4][4];
|
|
|
|
s16 TexColor[4];
|
|
|
|
s16 RasColor[4];
|
|
|
|
s16 StageKonst[4];
|
|
|
|
s16 Zero16[4];
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-12-31 06:45:18 +00:00
|
|
|
s16 FixedConstants[9];
|
|
|
|
u8 AlphaBump;
|
2009-10-12 00:48:24 +00:00
|
|
|
u8 IndirectTex[4][4];
|
2010-03-09 04:38:07 +00:00
|
|
|
TextureCoordinateType TexCoord;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-10-12 00:48:24 +00:00
|
|
|
s16* m_ColorInputLUT[16][3];
|
2010-12-31 06:45:18 +00:00
|
|
|
s16* m_AlphaInputLUT[8]; // values must point to ABGR color
|
2009-10-12 00:48:24 +00:00
|
|
|
s16* m_KonstLUT[32][4];
|
|
|
|
s16 m_BiasLUT[4];
|
|
|
|
u8 m_ScaleLShiftLUT[4];
|
|
|
|
u8 m_ScaleRShiftLUT[4];
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-12-31 06:45:18 +00:00
|
|
|
// enumeration for color input LUT
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
BLU_INP,
|
|
|
|
GRN_INP,
|
|
|
|
RED_INP
|
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
enum BufferBase
|
|
|
|
{
|
|
|
|
DIRECT = 0,
|
|
|
|
DIRECT_TFETCH = 16,
|
|
|
|
INDIRECT = 32
|
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2021-02-11 02:11:31 +00:00
|
|
|
void SetRasColor(RasColorChan colorChan, int swaptable);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2017-09-03 18:02:57 +00:00
|
|
|
void DrawColorRegular(const TevStageCombiner::ColorCombiner& cc, const InputRegType inputs[4]);
|
|
|
|
void DrawColorCompare(const TevStageCombiner::ColorCombiner& cc, const InputRegType inputs[4]);
|
|
|
|
void DrawAlphaRegular(const TevStageCombiner::AlphaCombiner& ac, const InputRegType inputs[4]);
|
|
|
|
void DrawAlphaCompare(const TevStageCombiner::AlphaCombiner& ac, const InputRegType inputs[4]);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-03-09 04:38:07 +00:00
|
|
|
void Indirect(unsigned int stageNum, s32 s, s32 t);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-10-12 00:48:24 +00:00
|
|
|
public:
|
2010-03-09 04:38:07 +00:00
|
|
|
s32 Position[3];
|
2010-12-31 06:45:18 +00:00
|
|
|
u8 Color[2][4]; // must be RGBA for correct swap table ordering
|
2010-03-09 04:38:07 +00:00
|
|
|
TextureCoordinateType Uv[8];
|
|
|
|
s32 IndirectLod[4];
|
|
|
|
bool IndirectLinear[4];
|
|
|
|
s32 TextureLod[16];
|
|
|
|
bool TextureLinear[16];
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-08-11 01:18:38 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ALP_C,
|
|
|
|
BLU_C,
|
|
|
|
GRN_C,
|
|
|
|
RED_C
|
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-10-12 00:48:24 +00:00
|
|
|
void Init();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-10-12 00:48:24 +00:00
|
|
|
void Draw();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-03-06 10:03:45 +00:00
|
|
|
void SetRegColor(int reg, int comp, s16 color);
|
2009-10-12 00:48:24 +00:00
|
|
|
};
|