Home | History | Annotate | Download | only in Shader
      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 		word4 invMaskW01Q[4];
     68 		dword4 maskD01X[4];
     69 		dword4 invMaskD01X[4];
     70 		word4 mask565Q[8];
     71 		word4 invMask565Q[8];
     72 
     73 		unsigned short sRGBtoLinear8_12[256];
     74 		unsigned short sRGBtoLinear6_12[64];
     75 		unsigned short sRGBtoLinear5_12[32];
     76 
     77 		unsigned short linearToSRGB12_16[4096];
     78 		unsigned short sRGBtoLinear12_16[4096];
     79 
     80 		// Centroid parameters
     81 		float4 sampleX[4][16];
     82 		float4 sampleY[4][16];
     83 		float4 weight[16];
     84 
     85 		// Fragment offsets
     86 		int Xf[4];
     87 		int Yf[4];
     88 
     89 		float4 X[4];
     90 		float4 Y[4];
     91 
     92 		dword maxX[16];
     93 		dword maxY[16];
     94 		dword maxZ[16];
     95 		dword minX[16];
     96 		dword minY[16];
     97 		dword minZ[16];
     98 		dword fini[16];
     99 
    100 		dword4 maxPos;
    101 
    102 		float4 unscaleByte;
    103 		float4 unscaleSByte;
    104 		float4 unscaleShort;
    105 		float4 unscaleUShort;
    106 		float4 unscaleInt;
    107 		float4 unscaleUInt;
    108 		float4 unscaleFixed;
    109 
    110 		float half2float[65536];
    111 	};
    112 
    113 	extern Constants constants;
    114 }
    115 
    116 #endif   // sw_Constants_hpp
    117