• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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 
18 #include "Common/Types.hpp"
19 
20 namespace 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];
69 
70 		unsigned short sRGBtoLinear8_12[256];
71 		unsigned short sRGBtoLinear6_12[64];
72 		unsigned short sRGBtoLinear5_12[32];
73 
74 		unsigned short linearToSRGB12_16[4096];
75 		unsigned short sRGBtoLinear12_16[4096];
76 
77 		// Centroid parameters
78 		float4 sampleX[4][16];
79 		float4 sampleY[4][16];
80 		float4 weight[16];
81 
82 		// Fragment offsets
83 		int Xf[4];
84 		int Yf[4];
85 
86 		float4 X[4];
87 		float4 Y[4];
88 
89 		dword maxX[16];
90 		dword maxY[16];
91 		dword maxZ[16];
92 		dword minX[16];
93 		dword minY[16];
94 		dword minZ[16];
95 		dword fini[16];
96 
97 		dword4 maxPos;
98 
99 		float4 unscaleByte;
100 		float4 unscaleSByte;
101 		float4 unscaleShort;
102 		float4 unscaleUShort;
103 		float4 unscaleInt;
104 		float4 unscaleUInt;
105 		float4 unscaleFixed;
106 
107 		float half2float[65536];
108 	};
109 
110 	extern Constants constants;
111 }
112 
113 #endif   // sw_Constants_hpp
114