blob: 7f6c951d24326b52aa68ffb060d56e3e1267a1d4 [file] [log] [blame]
Nicolas Capens68a82382018-10-02 13:16:55 -04001// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef sw_Constants_hpp
16#define sw_Constants_hpp
17
Nicolas Capens1d8c8db2018-11-05 16:30:42 -050018#include "System/Types.hpp"
Nicolas Capens68a82382018-10-02 13:16:55 -040019
20namespace sw
21{
22 struct Constants
23 {
24 Constants();
25
26 unsigned int transposeBit0[16];
27 unsigned int transposeBit1[16];
28 unsigned int transposeBit2[16];
29
30 ushort4 cWeight[17];
31 float4 uvWeight[17];
32 float4 uvStart[17];
33
34 unsigned int occlusionCount[16];
35
36 byte8 maskB4Q[16];
37 byte8 invMaskB4Q[16];
38 word4 maskW4Q[16];
39 word4 invMaskW4Q[16];
40 dword4 maskD4X[16];
41 dword4 invMaskD4X[16];
42 qword maskQ0Q[16];
43 qword maskQ1Q[16];
44 qword maskQ2Q[16];
45 qword maskQ3Q[16];
46 qword invMaskQ0Q[16];
47 qword invMaskQ1Q[16];
48 qword invMaskQ2Q[16];
49 qword invMaskQ3Q[16];
50 dword4 maskX0X[16];
51 dword4 maskX1X[16];
52 dword4 maskX2X[16];
53 dword4 maskX3X[16];
54 dword4 invMaskX0X[16];
55 dword4 invMaskX1X[16];
56 dword4 invMaskX2X[16];
57 dword4 invMaskX3X[16];
58 dword2 maskD01Q[16];
59 dword2 maskD23Q[16];
60 dword2 invMaskD01Q[16];
61 dword2 invMaskD23Q[16];
62 qword2 maskQ01X[16];
63 qword2 maskQ23X[16];
64 qword2 invMaskQ01X[16];
65 qword2 invMaskQ23X[16];
66 word4 maskW01Q[4];
67 dword4 maskD01X[4];
68 word4 mask565Q[8];
Chris Forbesb0f37162019-05-03 07:25:58 -070069 dword2 mask10Q[16]; // 4 bit writemask -> A2B10G10R10 bit patterns, replicated 2x
Nicolas Capens68a82382018-10-02 13:16:55 -040070
71 unsigned short sRGBtoLinear8_16[256];
Nicolas Capens68a82382018-10-02 13:16:55 -040072
73 unsigned short linearToSRGB12_16[4096];
74 unsigned short sRGBtoLinear12_16[4096];
75
76 // Centroid parameters
77 float4 sampleX[4][16];
78 float4 sampleY[4][16];
79 float4 weight[16];
80
81 // Fragment offsets
82 int Xf[4];
83 int Yf[4];
84
85 float4 X[4];
86 float4 Y[4];
87
88 dword maxX[16];
89 dword maxY[16];
90 dword maxZ[16];
91 dword minX[16];
92 dword minY[16];
93 dword minZ[16];
94 dword fini[16];
95
96 dword4 maxPos;
97
98 float4 unscaleByte;
99 float4 unscaleSByte;
100 float4 unscaleShort;
101 float4 unscaleUShort;
102 float4 unscaleInt;
103 float4 unscaleUInt;
104 float4 unscaleFixed;
105
106 float half2float[65536];
107 };
108
109 extern Constants constants;
110}
111
112#endif // sw_Constants_hpp