PANDORA: Make GLES context compatible with latest driver (FB only, no X11)
[mupen64plus-pandora.git] / source / rice_gles / src / CGLESCombiner.h
CommitLineData
d07c171f 1/*
2Copyright (C) 2003 Rice1964
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19#ifndef _GLES_COMBINER_H_
20#define _GLES_COMBINER_H_
21
22#include <vector>
23
24#include "Combiner.h"
25
26typedef struct
27{
28 uint8 arg0;
29 uint8 arg1;
30 uint8 arg2;
31 uint8 arg3;
32} GLESCombType;
33
34typedef struct {
35 union {
36 struct {
37 unsigned int rgbOp;
38 unsigned int alphaOp;
39 };
40 unsigned int ops[2];
41 };
42
43 union {
44 struct {
45 uint8 rgbArg0;
46 uint8 rgbArg1;
47 uint8 rgbArg2;
48 uint8 rgbArg3;
49 uint8 alphaArg0;
50 uint8 alphaArg1;
51 uint8 alphaArg2;
52 uint8 alphaArg3;
53 };
54 GLESCombType Combs[2];
55 uint8 args[2][4];
56 };
57
58 int constant;
59} GLESCombinerType;
60
61typedef struct {
62 uint32 dwMux0;
63 uint32 dwMux1;
64 union {
65 struct {
66 GLESCombinerType unit1;
67 GLESCombinerType unit2;
68 };
69 GLESCombinerType units[2];
70 };
71 int numOfUnits;
72} GLESCombinerSaveType;
73
74class CGLESCombiner
75{
76protected:
77 CGLESCombiner();
78 virtual ~CGLESCombiner();
79
80 int FindCompiledMux();
81 int ParseDecodedMux(); // Compile the decodedMux into NV register combiner setting
82 virtual void ParseDecodedMuxForConstants(GLESCombinerSaveType &res);
83 int SaveParserResult(GLESCombinerSaveType &result);
84
85#ifdef DEBUGGER
86 void DisplaySimpleMuxString();
87#endif
88 std::vector<GLESCombinerSaveType> m_vCompiledGLESSettings;
89 int m_lastIndexGLES;
90 DecodedMux **m_ppDecodedMux;
91};
92
93#endif
94