1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved.
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef CR_STATE_REGCOMBINER_H
|
---|
8 | #define CR_STATE_REGCOMBINER_H
|
---|
9 |
|
---|
10 | #include "state/cr_statetypes.h"
|
---|
11 | #include "state/cr_limits.h"
|
---|
12 |
|
---|
13 | #include <iprt/cdefs.h>
|
---|
14 |
|
---|
15 | #ifdef __cplusplus
|
---|
16 | extern "C" {
|
---|
17 | #endif
|
---|
18 |
|
---|
19 | typedef struct {
|
---|
20 | GLenum a, b, c, d;
|
---|
21 | GLenum aMapping, bMapping, cMapping, dMapping;
|
---|
22 | GLenum aPortion, bPortion, cPortion, dPortion;
|
---|
23 | GLenum scale, bias;
|
---|
24 | GLenum abOutput, cdOutput, sumOutput;
|
---|
25 | GLboolean abDotProduct, cdDotProduct, muxSum;
|
---|
26 | } CRRegCombinerPortionState;
|
---|
27 |
|
---|
28 | typedef struct {
|
---|
29 | GLboolean enabledRegCombiners;
|
---|
30 | GLboolean enabledPerStageConstants;
|
---|
31 |
|
---|
32 | GLcolorf constantColor0;
|
---|
33 | GLcolorf constantColor1;
|
---|
34 | GLcolorf stageConstantColor0[CR_MAX_GENERAL_COMBINERS];
|
---|
35 | GLcolorf stageConstantColor1[CR_MAX_GENERAL_COMBINERS];
|
---|
36 | GLboolean colorSumClamp;
|
---|
37 | GLint numGeneralCombiners;
|
---|
38 |
|
---|
39 | CRRegCombinerPortionState rgb[CR_MAX_GENERAL_COMBINERS];
|
---|
40 | CRRegCombinerPortionState alpha[CR_MAX_GENERAL_COMBINERS];
|
---|
41 |
|
---|
42 | GLenum a, b, c, d, e, f, g;
|
---|
43 | GLenum aMapping, bMapping, cMapping, dMapping, eMapping, fMapping, gMapping;
|
---|
44 | GLenum aPortion, bPortion, cPortion, dPortion, ePortion, fPortion, gPortion;
|
---|
45 | } CRRegCombinerState;
|
---|
46 |
|
---|
47 | typedef struct {
|
---|
48 | CRbitvalue dirty[CR_MAX_BITARRAY];
|
---|
49 | CRbitvalue enable[CR_MAX_BITARRAY];
|
---|
50 | CRbitvalue regCombinerVars[CR_MAX_BITARRAY]; /* numGeneralCombiners, colorSumClamp */
|
---|
51 | CRbitvalue regCombinerColor0[CR_MAX_BITARRAY];
|
---|
52 | CRbitvalue regCombinerColor1[CR_MAX_BITARRAY];
|
---|
53 | CRbitvalue regCombinerStageColor0[CR_MAX_GENERAL_COMBINERS][CR_MAX_BITARRAY];
|
---|
54 | CRbitvalue regCombinerStageColor1[CR_MAX_GENERAL_COMBINERS][CR_MAX_BITARRAY];
|
---|
55 | CRbitvalue regCombinerInput[CR_MAX_GENERAL_COMBINERS][CR_MAX_BITARRAY]; /* rgb/alpha[].a/b/c/d, .aMapping, .aPortion */
|
---|
56 | CRbitvalue regCombinerOutput[CR_MAX_GENERAL_COMBINERS][CR_MAX_BITARRAY]; /* rgb/alpha[].abOutput, .cdOutput, .sumOutput, .scale, .bias, .abDotProduct, .cdDotProduct, .muxSum */
|
---|
57 | CRbitvalue regCombinerFinalInput[CR_MAX_BITARRAY]; /* a/b/c/d/e/f/g, aMapping, aPortion */
|
---|
58 | } CRRegCombinerBits;
|
---|
59 |
|
---|
60 | DECLEXPORT(void) crStateRegCombinerInit( CRContext *ctx );
|
---|
61 |
|
---|
62 | DECLEXPORT(void) crStateRegCombinerDiff(CRRegCombinerBits *b, CRbitvalue *bitID,
|
---|
63 | CRContext *fromCtx, CRContext *toCtx);
|
---|
64 | DECLEXPORT(void) crStateRegCombinerSwitch( CRRegCombinerBits *b, CRbitvalue *bitID,
|
---|
65 | CRContext *fromCtx, CRContext *toCtx );
|
---|
66 |
|
---|
67 | #ifdef __cplusplus
|
---|
68 | }
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | #endif /* CR_STATE_REGCOMBINER_H */
|
---|