1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Internal Test Module
3*35238bceSAndroid Build Coastguard Worker * ---------------------------------
4*35238bceSAndroid Build Coastguard Worker *
5*35238bceSAndroid Build Coastguard Worker * Copyright 2015 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker *
7*35238bceSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker *
11*35238bceSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker *
13*35238bceSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker *
19*35238bceSAndroid Build Coastguard Worker *//*!
20*35238bceSAndroid Build Coastguard Worker * \file
21*35238bceSAndroid Build Coastguard Worker * \brief Texture format tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "ditTextureFormatTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
26*35238bceSAndroid Build Coastguard Worker
27*35238bceSAndroid Build Coastguard Worker #include "rrRenderer.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuTextureUtil.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "tcuVectorUtil.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "tcuFormatUtil.hpp"
31*35238bceSAndroid Build Coastguard Worker
32*35238bceSAndroid Build Coastguard Worker #include "deRandom.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "deArrayUtil.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "deStringUtil.hpp"
35*35238bceSAndroid Build Coastguard Worker #include "deUniquePtr.hpp"
36*35238bceSAndroid Build Coastguard Worker
37*35238bceSAndroid Build Coastguard Worker #include <sstream>
38*35238bceSAndroid Build Coastguard Worker
39*35238bceSAndroid Build Coastguard Worker namespace dit
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker
42*35238bceSAndroid Build Coastguard Worker namespace
43*35238bceSAndroid Build Coastguard Worker {
44*35238bceSAndroid Build Coastguard Worker
45*35238bceSAndroid Build Coastguard Worker using std::string;
46*35238bceSAndroid Build Coastguard Worker using std::vector;
47*35238bceSAndroid Build Coastguard Worker
48*35238bceSAndroid Build Coastguard Worker using tcu::ConstPixelBufferAccess;
49*35238bceSAndroid Build Coastguard Worker using tcu::IVec3;
50*35238bceSAndroid Build Coastguard Worker using tcu::PixelBufferAccess;
51*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
52*35238bceSAndroid Build Coastguard Worker using tcu::TextureAccessType;
53*35238bceSAndroid Build Coastguard Worker using tcu::TextureChannelClass;
54*35238bceSAndroid Build Coastguard Worker using tcu::TextureFormat;
55*35238bceSAndroid Build Coastguard Worker using tcu::Vector;
56*35238bceSAndroid Build Coastguard Worker
57*35238bceSAndroid Build Coastguard Worker // Test data
58*35238bceSAndroid Build Coastguard Worker
59*35238bceSAndroid Build Coastguard Worker static const uint8_t s_snormInt8In[] = {
60*35238bceSAndroid Build Coastguard Worker 0x1b, 0x23, 0xc5, 0x09, 0xb4, 0xbf, 0xbf, 0x24, 0x1a, 0x8a, 0xdb, 0x96, 0xc0, 0xa1, 0xde, 0x78,
61*35238bceSAndroid Build Coastguard Worker };
62*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt8FloatRef[] = {
63*35238bceSAndroid Build Coastguard Worker 0x3e59b367, 0x3e8d1a34, 0xbeeddbb7, 0x3d912245, 0xbf193265, 0xbf03060c, 0xbf03060c, 0x3e912245,
64*35238bceSAndroid Build Coastguard Worker 0x3e51a347, 0xbf6ddbb7, 0xbe952a55, 0xbf55ab57, 0xbf010204, 0xbf3f7efe, 0xbe891224, 0x3f71e3c8,
65*35238bceSAndroid Build Coastguard Worker };
66*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt8UintRef[] = {
67*35238bceSAndroid Build Coastguard Worker 0x0000001b, 0x00000023, 0xffffffc5, 0x00000009, 0xffffffb4, 0xffffffbf, 0xffffffbf, 0x00000024,
68*35238bceSAndroid Build Coastguard Worker 0x0000001a, 0xffffff8a, 0xffffffdb, 0xffffff96, 0xffffffc0, 0xffffffa1, 0xffffffde, 0x00000078,
69*35238bceSAndroid Build Coastguard Worker };
70*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt8IntRef[] = {
71*35238bceSAndroid Build Coastguard Worker 0x0000001b, 0x00000023, 0xffffffc5, 0x00000009, 0xffffffb4, 0xffffffbf, 0xffffffbf, 0x00000024,
72*35238bceSAndroid Build Coastguard Worker 0x0000001a, 0xffffff8a, 0xffffffdb, 0xffffff96, 0xffffffc0, 0xffffffa1, 0xffffffde, 0x00000078,
73*35238bceSAndroid Build Coastguard Worker };
74*35238bceSAndroid Build Coastguard Worker
75*35238bceSAndroid Build Coastguard Worker static const uint8_t s_snormInt16In[] = {
76*35238bceSAndroid Build Coastguard Worker 0xa0, 0xe9, 0xaa, 0x30, 0x16, 0x61, 0x37, 0xa2, 0x23, 0x4c, 0x46, 0xac, 0x8b, 0xf9, 0x36, 0x3e,
77*35238bceSAndroid Build Coastguard Worker 0x92, 0x7c, 0x96, 0x81, 0xc5, 0xb2, 0x95, 0x6e, 0x4f, 0x1e, 0xbc, 0x49, 0x14, 0x6c, 0x3c, 0x61,
78*35238bceSAndroid Build Coastguard Worker };
79*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt16FloatRef[] = {
80*35238bceSAndroid Build Coastguard Worker 0xbe330166, 0x3ec2a985, 0x3f422d84, 0xbf3b9377, 0x3f184731, 0xbf27754f, 0xbd4ea19d, 0x3ef8d9f2,
81*35238bceSAndroid Build Coastguard Worker 0x3f7925f2, 0xbf7cd5fa, 0xbf1a7735, 0x3f5d2bba, 0x3e7279e5, 0x3f137927, 0x3f5829b0, 0x3f427985,
82*35238bceSAndroid Build Coastguard Worker };
83*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt16UintRef[] = {
84*35238bceSAndroid Build Coastguard Worker 0xffffe9a0, 0x000030aa, 0x00006116, 0xffffa237, 0x00004c23, 0xffffac46, 0xfffff98b, 0x00003e36,
85*35238bceSAndroid Build Coastguard Worker 0x00007c92, 0xffff8196, 0xffffb2c5, 0x00006e95, 0x00001e4f, 0x000049bc, 0x00006c14, 0x0000613c,
86*35238bceSAndroid Build Coastguard Worker };
87*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt16IntRef[] = {
88*35238bceSAndroid Build Coastguard Worker 0xffffe9a0, 0x000030aa, 0x00006116, 0xffffa237, 0x00004c23, 0xffffac46, 0xfffff98b, 0x00003e36,
89*35238bceSAndroid Build Coastguard Worker 0x00007c92, 0xffff8196, 0xffffb2c5, 0x00006e95, 0x00001e4f, 0x000049bc, 0x00006c14, 0x0000613c,
90*35238bceSAndroid Build Coastguard Worker };
91*35238bceSAndroid Build Coastguard Worker
92*35238bceSAndroid Build Coastguard Worker static const uint8_t s_snormInt32In[] = {
93*35238bceSAndroid Build Coastguard Worker 0xba, 0x2c, 0x02, 0xea, 0x75, 0x59, 0x74, 0x48, 0x32, 0xad, 0xb0, 0xda, 0x0b, 0xf7, 0x6f, 0x49,
94*35238bceSAndroid Build Coastguard Worker 0x98, 0x9b, 0x76, 0x66, 0x79, 0x7d, 0x69, 0x33, 0xb5, 0x74, 0x61, 0xa4, 0x4c, 0xcd, 0x5c, 0x20,
95*35238bceSAndroid Build Coastguard Worker 0xc3, 0xba, 0x90, 0xfc, 0xe3, 0x17, 0xd0, 0x89, 0x28, 0x61, 0x5d, 0xb0, 0x5d, 0xc9, 0xad, 0xc9,
96*35238bceSAndroid Build Coastguard Worker 0xfc, 0x8c, 0x48, 0x3c, 0x11, 0x13, 0x40, 0x27, 0xe4, 0x88, 0x27, 0x4f, 0x52, 0xa2, 0x54, 0x50,
97*35238bceSAndroid Build Coastguard Worker };
98*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt32FloatRef[] = {
99*35238bceSAndroid Build Coastguard Worker 0xbe2fee9a, 0x3f10e8b3, 0xbe953d4b, 0x3f12dfee, 0x3f4ced37, 0x3ecda5f6, 0xbf373d17, 0x3e817335,
100*35238bceSAndroid Build Coastguard Worker 0xbcdbd14f, 0xbf6c5fd0, 0xbf1f453e, 0xbed948db, 0x3ef12234, 0x3e9d004c, 0x3f1e4f12, 0x3f20a945,
101*35238bceSAndroid Build Coastguard Worker };
102*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt32UintRef[] = {
103*35238bceSAndroid Build Coastguard Worker 0xea022cba, 0x48745975, 0xdab0ad32, 0x496ff70b, 0x66769b98, 0x33697d79, 0xa46174b5, 0x205ccd4c,
104*35238bceSAndroid Build Coastguard Worker 0xfc90bac3, 0x89d017e3, 0xb05d6128, 0xc9adc95d, 0x3c488cfc, 0x27401311, 0x4f2788e4, 0x5054a252,
105*35238bceSAndroid Build Coastguard Worker };
106*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt32IntRef[] = {
107*35238bceSAndroid Build Coastguard Worker 0xea022cba, 0x48745975, 0xdab0ad32, 0x496ff70b, 0x66769b98, 0x33697d79, 0xa46174b5, 0x205ccd4c,
108*35238bceSAndroid Build Coastguard Worker 0xfc90bac3, 0x89d017e3, 0xb05d6128, 0xc9adc95d, 0x3c488cfc, 0x27401311, 0x4f2788e4, 0x5054a252,
109*35238bceSAndroid Build Coastguard Worker };
110*35238bceSAndroid Build Coastguard Worker
111*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt8In[] = {
112*35238bceSAndroid Build Coastguard Worker 0x90, 0xa0, 0xa9, 0x26, 0x24, 0xc4, 0xa1, 0xa5, 0xdb, 0x0e, 0x09, 0x7a, 0x7f, 0x3d, 0xf2, 0x1f,
113*35238bceSAndroid Build Coastguard Worker };
114*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt8FloatRef[] = {
115*35238bceSAndroid Build Coastguard Worker 0x3f109091, 0x3f20a0a1, 0x3f29a9aa, 0x3e189899, 0x3e109091, 0x3f44c4c5, 0x3f21a1a2, 0x3f25a5a6,
116*35238bceSAndroid Build Coastguard Worker 0x3f5bdbdc, 0x3d60e0e1, 0x3d109091, 0x3ef4f4f5, 0x3efefeff, 0x3e74f4f5, 0x3f72f2f3, 0x3df8f8f9,
117*35238bceSAndroid Build Coastguard Worker };
118*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt8UintRef[] = {
119*35238bceSAndroid Build Coastguard Worker 0x00000090, 0x000000a0, 0x000000a9, 0x00000026, 0x00000024, 0x000000c4, 0x000000a1, 0x000000a5,
120*35238bceSAndroid Build Coastguard Worker 0x000000db, 0x0000000e, 0x00000009, 0x0000007a, 0x0000007f, 0x0000003d, 0x000000f2, 0x0000001f,
121*35238bceSAndroid Build Coastguard Worker };
122*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt8IntRef[] = {
123*35238bceSAndroid Build Coastguard Worker 0x00000090, 0x000000a0, 0x000000a9, 0x00000026, 0x00000024, 0x000000c4, 0x000000a1, 0x000000a5,
124*35238bceSAndroid Build Coastguard Worker 0x000000db, 0x0000000e, 0x00000009, 0x0000007a, 0x0000007f, 0x0000003d, 0x000000f2, 0x0000001f,
125*35238bceSAndroid Build Coastguard Worker };
126*35238bceSAndroid Build Coastguard Worker
127*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt16In[] = {
128*35238bceSAndroid Build Coastguard Worker 0xb6, 0x85, 0xf0, 0x1a, 0xbc, 0x76, 0x5b, 0x59, 0xf8, 0x74, 0x80, 0x6c, 0xb1, 0x80, 0x4a, 0xdc,
129*35238bceSAndroid Build Coastguard Worker 0xeb, 0x61, 0xa3, 0x12, 0xf6, 0x65, 0x6b, 0x25, 0x29, 0xe0, 0xe3, 0x0d, 0x3a, 0xac, 0xa7, 0x97,
130*35238bceSAndroid Build Coastguard Worker };
131*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt16FloatRef[] = {
132*35238bceSAndroid Build Coastguard Worker 0x3f05b686, 0x3dd780d8, 0x3eed78ed, 0x3eb2b6b3, 0x3ee9f0ea, 0x3ed900d9, 0x3f00b181, 0x3f5c4adc,
133*35238bceSAndroid Build Coastguard Worker 0x3ec3d6c4, 0x3d951895, 0x3ecbeccc, 0x3e15ac96, 0x3f6029e0, 0x3d5e30de, 0x3f2c3aac, 0x3f17a798,
134*35238bceSAndroid Build Coastguard Worker };
135*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt16UintRef[] = {
136*35238bceSAndroid Build Coastguard Worker 0x000085b6, 0x00001af0, 0x000076bc, 0x0000595b, 0x000074f8, 0x00006c80, 0x000080b1, 0x0000dc4a,
137*35238bceSAndroid Build Coastguard Worker 0x000061eb, 0x000012a3, 0x000065f6, 0x0000256b, 0x0000e029, 0x00000de3, 0x0000ac3a, 0x000097a7,
138*35238bceSAndroid Build Coastguard Worker };
139*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt16IntRef[] = {
140*35238bceSAndroid Build Coastguard Worker 0x000085b6, 0x00001af0, 0x000076bc, 0x0000595b, 0x000074f8, 0x00006c80, 0x000080b1, 0x0000dc4a,
141*35238bceSAndroid Build Coastguard Worker 0x000061eb, 0x000012a3, 0x000065f6, 0x0000256b, 0x0000e029, 0x00000de3, 0x0000ac3a, 0x000097a7,
142*35238bceSAndroid Build Coastguard Worker };
143*35238bceSAndroid Build Coastguard Worker
144*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt24In[] = {
145*35238bceSAndroid Build Coastguard Worker 0xea, 0x65, 0x31, 0xb3, 0x53, 0x62, 0x02, 0xf1, 0xda, 0x3c, 0xaf, 0x31, 0x35, 0xd6, 0x1f, 0xe4,
146*35238bceSAndroid Build Coastguard Worker 0xfa, 0x3b, 0xb9, 0x48, 0x73, 0x9a, 0xde, 0x6b, 0x3e, 0xa5, 0x15, 0x90, 0x95, 0xc2, 0x56, 0x8b,
147*35238bceSAndroid Build Coastguard Worker 0xd2, 0x14, 0xd5, 0xe5, 0xd0, 0x7b, 0x9f, 0x74, 0x79, 0x58, 0x86, 0xa9, 0xc0, 0xdf, 0xb6, 0xb4,
148*35238bceSAndroid Build Coastguard Worker };
149*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt24FloatRef[] = {
150*35238bceSAndroid Build Coastguard Worker 0x3e4597a9, 0x3ec4a767, 0x3f5af103, 0x3e46bcf1, 0x3dfeb1a9, 0x3e6feb91, 0x3ee69173, 0x3ed7bd35,
151*35238bceSAndroid Build Coastguard Worker 0x3dad29f1, 0x3f429591, 0x3f528b57, 0x3f65d515, 0x3f1f7bd1, 0x3eb0f2e9, 0x3f40a987, 0x3f34b6e0,
152*35238bceSAndroid Build Coastguard Worker };
153*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt24UintRef[] = {
154*35238bceSAndroid Build Coastguard Worker 0x003165ea, 0x006253b3, 0x00daf102, 0x0031af3c, 0x001fd635, 0x003bfae4, 0x007348b9, 0x006bde9a,
155*35238bceSAndroid Build Coastguard Worker 0x0015a53e, 0x00c29590, 0x00d28b56, 0x00e5d514, 0x009f7bd0, 0x00587974, 0x00c0a986, 0x00b4b6df,
156*35238bceSAndroid Build Coastguard Worker };
157*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt24IntRef[] = {
158*35238bceSAndroid Build Coastguard Worker 0x003165ea, 0x006253b3, 0x00daf102, 0x0031af3c, 0x001fd635, 0x003bfae4, 0x007348b9, 0x006bde9a,
159*35238bceSAndroid Build Coastguard Worker 0x0015a53e, 0x00c29590, 0x00d28b56, 0x00e5d514, 0x009f7bd0, 0x00587974, 0x00c0a986, 0x00b4b6df,
160*35238bceSAndroid Build Coastguard Worker };
161*35238bceSAndroid Build Coastguard Worker
162*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt32In[] = {
163*35238bceSAndroid Build Coastguard Worker 0x45, 0x7d, 0xe1, 0x55, 0xd2, 0xcb, 0xc5, 0x17, 0x64, 0x87, 0x84, 0x50, 0x37, 0x60, 0x54, 0xa1,
164*35238bceSAndroid Build Coastguard Worker 0xa8, 0x7e, 0xea, 0x98, 0x1a, 0xd1, 0xb4, 0x70, 0x2d, 0xcb, 0xff, 0x13, 0x3d, 0xd7, 0x3c, 0xe4,
165*35238bceSAndroid Build Coastguard Worker 0x94, 0xd6, 0xb4, 0xf7, 0x01, 0x58, 0x32, 0x9d, 0x91, 0x2b, 0x49, 0x1f, 0xd0, 0xca, 0x3d, 0x05,
166*35238bceSAndroid Build Coastguard Worker 0x14, 0x5a, 0x95, 0xd0, 0xfd, 0x64, 0x33, 0xd3, 0x73, 0x87, 0xa5, 0xf9, 0x6d, 0xc8, 0x39, 0x03,
167*35238bceSAndroid Build Coastguard Worker };
168*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt32FloatRef[] = {
169*35238bceSAndroid Build Coastguard Worker 0x3eabc2fb, 0x3dbe2e5f, 0x3ea1090f, 0x3f215460, 0x3f18ea7f, 0x3ee169a2, 0x3d9ffe59, 0x3f643cd7,
170*35238bceSAndroid Build Coastguard Worker 0x3f77b4d7, 0x3f1d3258, 0x3dfa495d, 0x3ca7b95a, 0x3f50955a, 0x3f533365, 0x3f79a587, 0x3c4e721b,
171*35238bceSAndroid Build Coastguard Worker };
172*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt32UintRef[] = {
173*35238bceSAndroid Build Coastguard Worker 0x55e17d45, 0x17c5cbd2, 0x50848764, 0xa1546037, 0x98ea7ea8, 0x70b4d11a, 0x13ffcb2d, 0xe43cd73d,
174*35238bceSAndroid Build Coastguard Worker 0xf7b4d694, 0x9d325801, 0x1f492b91, 0x053dcad0, 0xd0955a14, 0xd33364fd, 0xf9a58773, 0x0339c86d,
175*35238bceSAndroid Build Coastguard Worker };
176*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt32IntRef[] = {
177*35238bceSAndroid Build Coastguard Worker 0x55e17d45, 0x17c5cbd2, 0x50848764, 0xa1546037, 0x98ea7ea8, 0x70b4d11a, 0x13ffcb2d, 0xe43cd73d,
178*35238bceSAndroid Build Coastguard Worker 0xf7b4d694, 0x9d325801, 0x1f492b91, 0x053dcad0, 0xd0955a14, 0xd33364fd, 0xf9a58773, 0x0339c86d,
179*35238bceSAndroid Build Coastguard Worker };
180*35238bceSAndroid Build Coastguard Worker
181*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormByte44In[] = {
182*35238bceSAndroid Build Coastguard Worker 0xdb,
183*35238bceSAndroid Build Coastguard Worker 0xa8,
184*35238bceSAndroid Build Coastguard Worker 0x29,
185*35238bceSAndroid Build Coastguard Worker 0x2d,
186*35238bceSAndroid Build Coastguard Worker };
187*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormByte44FloatRef[] = {
188*35238bceSAndroid Build Coastguard Worker 0x3f5dddde, 0x3f3bbbbc, 0x00000000, 0x3f800000, 0x3f2aaaab, 0x3f088889, 0x00000000, 0x3f800000,
189*35238bceSAndroid Build Coastguard Worker 0x3e088889, 0x3f19999a, 0x00000000, 0x3f800000, 0x3e088889, 0x3f5dddde, 0x00000000, 0x3f800000,
190*35238bceSAndroid Build Coastguard Worker };
191*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormByte44IntRef[] = {
192*35238bceSAndroid Build Coastguard Worker 0x0000000d, 0x0000000b, 0x00000000, 0x00000001, 0x0000000a, 0x00000008, 0x00000000, 0x00000001,
193*35238bceSAndroid Build Coastguard Worker 0x00000002, 0x00000009, 0x00000000, 0x00000001, 0x00000002, 0x0000000d, 0x00000000, 0x00000001,
194*35238bceSAndroid Build Coastguard Worker };
195*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedByte44FloatRef[] = {
196*35238bceSAndroid Build Coastguard Worker 0x41500000, 0x41300000, 0x00000000, 0x3f800000, 0x41200000, 0x41000000, 0x00000000, 0x3f800000,
197*35238bceSAndroid Build Coastguard Worker 0x40000000, 0x41100000, 0x00000000, 0x3f800000, 0x40000000, 0x41500000, 0x00000000, 0x3f800000,
198*35238bceSAndroid Build Coastguard Worker };
199*35238bceSAndroid Build Coastguard Worker
200*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort565In[] = {
201*35238bceSAndroid Build Coastguard Worker 0xea, 0x7e, 0xcc, 0x28, 0x38, 0xce, 0x8f, 0x16,
202*35238bceSAndroid Build Coastguard Worker };
203*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort565FloatRef[] = {
204*35238bceSAndroid Build Coastguard Worker 0x3ef7bdef, 0x3f5f7df8, 0x3ea5294a, 0x3f800000, 0x3e25294a, 0x3dc30c31, 0x3ec6318c, 0x3f800000,
205*35238bceSAndroid Build Coastguard Worker 0x3f4e739d, 0x3f471c72, 0x3f46318c, 0x3f800000, 0x3d842108, 0x3f534d35, 0x3ef7bdef, 0x3f800000,
206*35238bceSAndroid Build Coastguard Worker };
207*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort565IntRef[] = {
208*35238bceSAndroid Build Coastguard Worker 0x0000000f, 0x00000037, 0x0000000a, 0x00000001, 0x00000005, 0x00000006, 0x0000000c, 0x00000001,
209*35238bceSAndroid Build Coastguard Worker 0x00000019, 0x00000031, 0x00000018, 0x00000001, 0x00000002, 0x00000034, 0x0000000f, 0x00000001,
210*35238bceSAndroid Build Coastguard Worker };
211*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedShort565FloatRef[] = {
212*35238bceSAndroid Build Coastguard Worker 0x41700000, 0x425c0000, 0x41200000, 0x3f800000, 0x40a00000, 0x40c00000, 0x41400000, 0x3f800000,
213*35238bceSAndroid Build Coastguard Worker 0x41c80000, 0x42440000, 0x41c00000, 0x3f800000, 0x40000000, 0x42500000, 0x41700000, 0x3f800000,
214*35238bceSAndroid Build Coastguard Worker };
215*35238bceSAndroid Build Coastguard Worker
216*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort555In[] = {
217*35238bceSAndroid Build Coastguard Worker 0x02, 0xea, 0x89, 0x13, 0x94, 0x5a, 0x5b, 0x60,
218*35238bceSAndroid Build Coastguard Worker };
219*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort555FloatRef[] = {
220*35238bceSAndroid Build Coastguard Worker 0x3f56b5ad, 0x3f042108, 0x3d842108, 0x3f800000, 0x3e042108, 0x3f6739ce, 0x3e94a529, 0x3f800000,
221*35238bceSAndroid Build Coastguard Worker 0x3f35ad6b, 0x3f25294a, 0x3f25294a, 0x3f800000, 0x3f46318c, 0x3d842108, 0x3f5ef7be, 0x3f800000,
222*35238bceSAndroid Build Coastguard Worker };
223*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort555IntRef[] = {
224*35238bceSAndroid Build Coastguard Worker 0x0000001a, 0x00000010, 0x00000002, 0x00000001, 0x00000004, 0x0000001c, 0x00000009, 0x00000001,
225*35238bceSAndroid Build Coastguard Worker 0x00000016, 0x00000014, 0x00000014, 0x00000001, 0x00000018, 0x00000002, 0x0000001b, 0x00000001,
226*35238bceSAndroid Build Coastguard Worker };
227*35238bceSAndroid Build Coastguard Worker
228*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort4444In[] = {
229*35238bceSAndroid Build Coastguard Worker 0x19, 0xdb, 0xa8, 0xa8, 0x72, 0x29, 0xb4, 0x2d,
230*35238bceSAndroid Build Coastguard Worker };
231*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort4444FloatRef[] = {
232*35238bceSAndroid Build Coastguard Worker 0x3f5dddde, 0x3f3bbbbc, 0x3d888889, 0x3f19999a, 0x3f2aaaab, 0x3f088889, 0x3f2aaaab, 0x3f088889,
233*35238bceSAndroid Build Coastguard Worker 0x3e088889, 0x3f19999a, 0x3eeeeeef, 0x3e088889, 0x3e088889, 0x3f5dddde, 0x3f3bbbbc, 0x3e888889,
234*35238bceSAndroid Build Coastguard Worker };
235*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort4444IntRef[] = {
236*35238bceSAndroid Build Coastguard Worker 0x0000000d, 0x0000000b, 0x00000001, 0x00000009, 0x0000000a, 0x00000008, 0x0000000a, 0x00000008,
237*35238bceSAndroid Build Coastguard Worker 0x00000002, 0x00000009, 0x00000007, 0x00000002, 0x00000002, 0x0000000d, 0x0000000b, 0x00000004,
238*35238bceSAndroid Build Coastguard Worker };
239*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedShort4444FloatRef[] = {
240*35238bceSAndroid Build Coastguard Worker 0x41500000, 0x41300000, 0x3f800000, 0x41100000, 0x41200000, 0x41000000, 0x41200000, 0x41000000,
241*35238bceSAndroid Build Coastguard Worker 0x40000000, 0x41100000, 0x40e00000, 0x40000000, 0x40000000, 0x41500000, 0x41300000, 0x40800000,
242*35238bceSAndroid Build Coastguard Worker };
243*35238bceSAndroid Build Coastguard Worker
244*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort5551In[] = {
245*35238bceSAndroid Build Coastguard Worker 0x13, 0x89, 0x6f, 0x3c, 0xae, 0xe9, 0xf2, 0xd9,
246*35238bceSAndroid Build Coastguard Worker };
247*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort5551FloatRef[] = {
248*35238bceSAndroid Build Coastguard Worker 0x3f0c6319, 0x3e042108, 0x3e94a529, 0x3f800000, 0x3e6739ce, 0x3f0c6319, 0x3f3def7c, 0x3f800000,
249*35238bceSAndroid Build Coastguard Worker 0x3f6f7bdf, 0x3e46318c, 0x3f3def7c, 0x00000000, 0x3f5ef7be, 0x3e6739ce, 0x3f4e739d, 0x00000000,
250*35238bceSAndroid Build Coastguard Worker };
251*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort5551IntRef[] = {
252*35238bceSAndroid Build Coastguard Worker 0x00000011, 0x00000004, 0x00000009, 0x00000001, 0x00000007, 0x00000011, 0x00000017, 0x00000001,
253*35238bceSAndroid Build Coastguard Worker 0x0000001d, 0x00000006, 0x00000017, 0x00000000, 0x0000001b, 0x00000007, 0x00000019, 0x00000000,
254*35238bceSAndroid Build Coastguard Worker };
255*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedShort5551FloatRef[] = {
256*35238bceSAndroid Build Coastguard Worker 0x41880000, 0x40800000, 0x41100000, 0x3f800000, 0x40e00000, 0x41880000, 0x41b80000, 0x3f800000,
257*35238bceSAndroid Build Coastguard Worker 0x41e80000, 0x40c00000, 0x41b80000, 0x00000000, 0x41d80000, 0x40e00000, 0x41c80000, 0x00000000,
258*35238bceSAndroid Build Coastguard Worker };
259*35238bceSAndroid Build Coastguard Worker
260*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort1555In[] = {
261*35238bceSAndroid Build Coastguard Worker 0xf8, 0xc5, 0x1f, 0x6c, 0xf0, 0x2f, 0xf2, 0x95,
262*35238bceSAndroid Build Coastguard Worker };
263*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort1555FloatRef[] = {
264*35238bceSAndroid Build Coastguard Worker 0x3f800000, 0x3f0c6319, 0x3ef7bdef, 0x3f46318c, 0x00000000, 0x3f5ef7be, 0x00000000, 0x3f800000,
265*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x3eb5ad6b, 0x3f800000, 0x3f042108, 0x3f800000, 0x3e25294a, 0x3ef7bdef, 0x3f14a529,
266*35238bceSAndroid Build Coastguard Worker };
267*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort1555IntRef[] = {
268*35238bceSAndroid Build Coastguard Worker 0x00000001, 0x00000011, 0x0000000f, 0x00000018, 0x00000000, 0x0000001b, 0x00000000, 0x0000001f,
269*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x0000000b, 0x0000001f, 0x00000010, 0x00000001, 0x00000005, 0x0000000f, 0x00000012,
270*35238bceSAndroid Build Coastguard Worker };
271*35238bceSAndroid Build Coastguard Worker
272*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt101010In[] = {
273*35238bceSAndroid Build Coastguard Worker 0x81, 0xb3, 0x67, 0x51, 0xa9, 0x00, 0x34, 0xc5, 0xf0, 0x2f, 0xf2, 0x95, 0xf8, 0xc5, 0x1f, 0x6c,
274*35238bceSAndroid Build Coastguard Worker };
275*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt101010FloatRef[] = {
276*35238bceSAndroid Build Coastguard Worker 0x3ea2a8aa, 0x3f1ee7ba, 0x3e60380e, 0x3f800000, 0x3f45314c, 0x3f50340d, 0x3d282a0b, 0x3f800000,
277*35238bceSAndroid Build Coastguard Worker 0x3f15e579, 0x3f48b22d, 0x3f7f3fd0, 0x3f800000, 0x3ed8360e, 0x3efe3f90, 0x3ebf2fcc, 0x3f800000,
278*35238bceSAndroid Build Coastguard Worker };
279*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt101010IntRef[] = {
280*35238bceSAndroid Build Coastguard Worker 0x00000145, 0x0000027b, 0x000000e0, 0x00000001, 0x00000314, 0x00000340, 0x0000002a, 0x00000001,
281*35238bceSAndroid Build Coastguard Worker 0x00000257, 0x00000322, 0x000003fc, 0x00000001, 0x000001b0, 0x000001fc, 0x0000017e, 0x00000001,
282*35238bceSAndroid Build Coastguard Worker };
283*35238bceSAndroid Build Coastguard Worker
284*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormInt1010102RevIn[] = {
285*35238bceSAndroid Build Coastguard Worker 0xfd, 0xc6, 0xf5, 0xc4, 0x32, 0xa8, 0xfd, 0x7d, 0xe7, 0x3f, 0x10, 0xd0, 0x86, 0x0d, 0x66, 0xd0,
286*35238bceSAndroid Build Coastguard Worker };
287*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt1010102RevFloatRef[] = {
288*35238bceSAndroid Build Coastguard Worker 0x3f3f6fdc, 0x3eb8ae2c, 0x3d9e278a, 0x3f800000, 0x3d48320d, 0x3f5ab6ae, 0x3f77fdff, 0x3eaaaaab,
289*35238bceSAndroid Build Coastguard Worker 0x3f79fe80, 0x3c703c0f, 0x3e80a028, 0x3f800000, 0x3ec330cc, 0x3ec1b06c, 0x3e8320c8, 0x3f800000,
290*35238bceSAndroid Build Coastguard Worker };
291*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormInt1010102RevIntRef[] = {
292*35238bceSAndroid Build Coastguard Worker 0x000002fd, 0x00000171, 0x0000004f, 0x00000003, 0x00000032, 0x0000036a, 0x000003df, 0x00000001,
293*35238bceSAndroid Build Coastguard Worker 0x000003e7, 0x0000000f, 0x00000101, 0x00000003, 0x00000186, 0x00000183, 0x00000106, 0x00000003,
294*35238bceSAndroid Build Coastguard Worker };
295*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt1010102RevFloatRef[] = {
296*35238bceSAndroid Build Coastguard Worker 0xbf01c0e0, 0x3f38dc6e, 0x3e1e4f28, 0xbf800000, 0x3dc86432, 0xbe964b26, 0xbd844221, 0x3f800000,
297*35238bceSAndroid Build Coastguard Worker 0xbd486432, 0x3cf0783c, 0x3f00c060, 0xbf800000, 0x3f4361b1, 0x3f41e0f0, 0x3f0341a1, 0xbf800000,
298*35238bceSAndroid Build Coastguard Worker };
299*35238bceSAndroid Build Coastguard Worker static const uint32_t s_snormInt1010102RevIntRef[] = {
300*35238bceSAndroid Build Coastguard Worker 0xfffffefd, 0x00000171, 0x0000004f, 0xffffffff, 0x00000032, 0xffffff6a, 0xffffffdf, 0x00000001,
301*35238bceSAndroid Build Coastguard Worker 0xffffffe7, 0x0000000f, 0x00000101, 0xffffffff, 0x00000186, 0x00000183, 0x00000106, 0xffffffff,
302*35238bceSAndroid Build Coastguard Worker };
303*35238bceSAndroid Build Coastguard Worker
304*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt1010102RevIn[] = {
305*35238bceSAndroid Build Coastguard Worker 0xb8, 0x4c, 0xfd, 0x00, 0x65, 0x7f, 0xb2, 0x4e, 0x11, 0x3e, 0x03, 0x23, 0xae, 0xc9, 0xdd, 0xa2,
306*35238bceSAndroid Build Coastguard Worker };
307*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt1010102RevFloatRef[] = {
308*35238bceSAndroid Build Coastguard Worker 0x43380000, 0x4454c000, 0x41700000, 0x00000000, 0x44594000, 0x431f0000, 0x436b0000, 0x3f800000,
309*35238bceSAndroid Build Coastguard Worker 0x44044000, 0x434f0000, 0x440c0000, 0x00000000, 0x43d70000, 0x445c8000, 0x440b4000, 0x40000000,
310*35238bceSAndroid Build Coastguard Worker };
311*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt1010102RevIntRef[] = {
312*35238bceSAndroid Build Coastguard Worker 0x000000b8, 0x00000353, 0x0000000f, 0x00000000, 0x00000365, 0x0000009f, 0x000000eb, 0x00000001,
313*35238bceSAndroid Build Coastguard Worker 0x00000211, 0x000000cf, 0x00000230, 0x00000000, 0x000001ae, 0x00000372, 0x0000022d, 0x00000002,
314*35238bceSAndroid Build Coastguard Worker };
315*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt1010102RevFloatRef[] = {
316*35238bceSAndroid Build Coastguard Worker 0x43380000, 0x4f7fffff, 0x41700000, 0x00000000, 0x4f7fffff, 0x431f0000, 0x436b0000, 0x3f800000,
317*35238bceSAndroid Build Coastguard Worker 0x4f7ffffe, 0x434f0000, 0x4f7ffffe, 0x00000000, 0x43d70000, 0x4f7fffff, 0x4f7ffffe, 0x4f800000,
318*35238bceSAndroid Build Coastguard Worker };
319*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt1010102RevIntRef[] = {
320*35238bceSAndroid Build Coastguard Worker 0x000000b8, 0xffffff53, 0x0000000f, 0x00000000, 0xffffff65, 0x0000009f, 0x000000eb, 0x00000001,
321*35238bceSAndroid Build Coastguard Worker 0xfffffe11, 0x000000cf, 0xfffffe30, 0x00000000, 0x000001ae, 0xffffff72, 0xfffffe2d, 0xfffffffe,
322*35238bceSAndroid Build Coastguard Worker };
323*35238bceSAndroid Build Coastguard Worker
324*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt11f11f10fRevIn[] = {
325*35238bceSAndroid Build Coastguard Worker 0x8e, 0x1b, 0x81, 0x45, 0xcf, 0x47, 0x50, 0x29, 0xff, 0x5e, 0x8e, 0x93, 0x95, 0x07, 0x45, 0x4a,
326*35238bceSAndroid Build Coastguard Worker };
327*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt11f11f10fRevFloatRef[] = {
328*35238bceSAndroid Build Coastguard Worker 0x3f1c0000, 0x380c0000, 0x3c580000, 0x3f800000, 0x7fffffff, 0x3c100000, 0x3a940000, 0x3f800000,
329*35238bceSAndroid Build Coastguard Worker 0x45fe0000, 0x3b960000, 0x41380000, 0x3f800000, 0x472a0000, 0x39400000, 0x3ca40000, 0x3f800000,
330*35238bceSAndroid Build Coastguard Worker };
331*35238bceSAndroid Build Coastguard Worker
332*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt999E5RevIn[] = {
333*35238bceSAndroid Build Coastguard Worker 0x88, 0x8b, 0x50, 0x34, 0x2b, 0x2f, 0xe2, 0x92, 0x95, 0x7f, 0xeb, 0x18, 0x6b, 0xe2, 0x27, 0x30,
334*35238bceSAndroid Build Coastguard Worker };
335*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt999E5RevFloatRef[] = {
336*35238bceSAndroid Build Coastguard Worker 0x3ac40000, 0x398a0000, 0x3a8a0000, 0x3f800000, 0x40958000, 0x408b8000, 0x40380000, 0x3f800000,
337*35238bceSAndroid Build Coastguard Worker 0x394a8000, 0x395f8000, 0x37e80000, 0x3f800000, 0x39d60000, 0x3af88000, 0x38100000, 0x3f800000,
338*35238bceSAndroid Build Coastguard Worker };
339*35238bceSAndroid Build Coastguard Worker
340*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt1688In[] = {
341*35238bceSAndroid Build Coastguard Worker 0x02, 0x50, 0x91, 0x85, 0xcc, 0xe2, 0xfd, 0xc8, 0x62, 0xeb, 0x0f, 0xe6, 0x95, 0x27, 0x26, 0x24,
342*35238bceSAndroid Build Coastguard Worker };
343*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt1688FloatRef[] = {
344*35238bceSAndroid Build Coastguard Worker 0x3f059186, 0x00000000, 0x00000000, 0x3f800000, 0x3f48fdc9, 0x00000000, 0x00000000, 0x3f800000,
345*35238bceSAndroid Build Coastguard Worker 0x3f660fe6, 0x00000000, 0x00000000, 0x3f800000, 0x3e109891, 0x00000000, 0x00000000, 0x3f800000,
346*35238bceSAndroid Build Coastguard Worker };
347*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt1688UintRef[] = {
348*35238bceSAndroid Build Coastguard Worker 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x000000cc, 0x00000000, 0x00000000, 0x00000001,
349*35238bceSAndroid Build Coastguard Worker 0x00000062, 0x00000000, 0x00000000, 0x00000001, 0x00000095, 0x00000000, 0x00000000, 0x00000001,
350*35238bceSAndroid Build Coastguard Worker };
351*35238bceSAndroid Build Coastguard Worker
352*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt248In[] = {
353*35238bceSAndroid Build Coastguard Worker 0xea, 0x7e, 0xcc, 0x28, 0x38, 0xce, 0x8f, 0x16, 0x3e, 0x4f, 0xe2, 0xfd, 0x74, 0x5e, 0xf2, 0x30,
354*35238bceSAndroid Build Coastguard Worker };
355*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt248FloatRef[] = {
356*35238bceSAndroid Build Coastguard Worker 0x3e2331f9, 0x00000000, 0x00000000, 0x3f800000, 0x3db47e71, 0x00000000, 0x00000000, 0x3f800000,
357*35238bceSAndroid Build Coastguard Worker 0x3f7de250, 0x00000000, 0x00000000, 0x3f800000, 0x3e43c979, 0x00000000, 0x00000000, 0x3f800000,
358*35238bceSAndroid Build Coastguard Worker };
359*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt248UintRef[] = {
360*35238bceSAndroid Build Coastguard Worker 0x000000ea, 0x00000000, 0x00000000, 0x00000001, 0x00000038, 0x00000000, 0x00000000, 0x00000001,
361*35238bceSAndroid Build Coastguard Worker 0x0000003e, 0x00000000, 0x00000000, 0x00000001, 0x00000074, 0x00000000, 0x00000000, 0x00000001,
362*35238bceSAndroid Build Coastguard Worker };
363*35238bceSAndroid Build Coastguard Worker
364*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt248RevIn[] = {
365*35238bceSAndroid Build Coastguard Worker 0x7e, 0xcc, 0x28, 0xea, 0xce, 0x8f, 0x16, 0x38, 0x4f, 0xe2, 0xfd, 0x3e, 0x5e, 0xf2, 0x30, 0x74,
366*35238bceSAndroid Build Coastguard Worker };
367*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt248RevFloatRef[] = {
368*35238bceSAndroid Build Coastguard Worker 0x3e2331f9, 0x00000000, 0x00000000, 0x3f800000, 0x3db47e71, 0x00000000, 0x00000000, 0x3f800000,
369*35238bceSAndroid Build Coastguard Worker 0x3f7de250, 0x00000000, 0x00000000, 0x3f800000, 0x3e43c979, 0x00000000, 0x00000000, 0x3f800000,
370*35238bceSAndroid Build Coastguard Worker };
371*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt248RevUintRef[] = {
372*35238bceSAndroid Build Coastguard Worker 0x000000ea, 0x00000000, 0x00000000, 0x00000001, 0x00000038, 0x00000000, 0x00000000, 0x00000001,
373*35238bceSAndroid Build Coastguard Worker 0x0000003e, 0x00000000, 0x00000000, 0x00000001, 0x00000074, 0x00000000, 0x00000000, 0x00000001,
374*35238bceSAndroid Build Coastguard Worker };
375*35238bceSAndroid Build Coastguard Worker
376*35238bceSAndroid Build Coastguard Worker static const uint8_t s_signedInt8In[] = {
377*35238bceSAndroid Build Coastguard Worker 0x3a, 0x5b, 0x6d, 0x6a, 0x44, 0x56, 0x6b, 0x21, 0x6a, 0x0b, 0x24, 0xd9, 0xd4, 0xb4, 0xda, 0x97,
378*35238bceSAndroid Build Coastguard Worker };
379*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt8FloatRef[] = {
380*35238bceSAndroid Build Coastguard Worker 0x42680000, 0x42b60000, 0x42da0000, 0x42d40000, 0x42880000, 0x42ac0000, 0x42d60000, 0x42040000,
381*35238bceSAndroid Build Coastguard Worker 0x42d40000, 0x41300000, 0x42100000, 0xc21c0000, 0xc2300000, 0xc2980000, 0xc2180000, 0xc2d20000,
382*35238bceSAndroid Build Coastguard Worker };
383*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt8UintRef[] = {
384*35238bceSAndroid Build Coastguard Worker 0x0000003a, 0x0000005b, 0x0000006d, 0x0000006a, 0x00000044, 0x00000056, 0x0000006b, 0x00000021,
385*35238bceSAndroid Build Coastguard Worker 0x0000006a, 0x0000000b, 0x00000024, 0xffffffd9, 0xffffffd4, 0xffffffb4, 0xffffffda, 0xffffff97,
386*35238bceSAndroid Build Coastguard Worker };
387*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt8IntRef[] = {
388*35238bceSAndroid Build Coastguard Worker 0x0000003a, 0x0000005b, 0x0000006d, 0x0000006a, 0x00000044, 0x00000056, 0x0000006b, 0x00000021,
389*35238bceSAndroid Build Coastguard Worker 0x0000006a, 0x0000000b, 0x00000024, 0xffffffd9, 0xffffffd4, 0xffffffb4, 0xffffffda, 0xffffff97,
390*35238bceSAndroid Build Coastguard Worker };
391*35238bceSAndroid Build Coastguard Worker
392*35238bceSAndroid Build Coastguard Worker static const uint8_t s_signedInt16In[] = {
393*35238bceSAndroid Build Coastguard Worker 0xf1, 0xdd, 0xcd, 0xc3, 0x1c, 0xb6, 0x6f, 0x74, 0x19, 0x13, 0x25, 0xed, 0x16, 0xce, 0x0d, 0x0f,
394*35238bceSAndroid Build Coastguard Worker 0x5c, 0xf4, 0x3c, 0xa3, 0x6d, 0x25, 0x65, 0x6d, 0xae, 0x5d, 0x88, 0xfa, 0x86, 0x3e, 0x6a, 0x91,
395*35238bceSAndroid Build Coastguard Worker };
396*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt16FloatRef[] = {
397*35238bceSAndroid Build Coastguard Worker 0xc6083c00, 0xc670cc00, 0xc693c800, 0x46e8de00, 0x4598c800, 0xc596d800, 0xc647a800, 0x4570d000,
398*35238bceSAndroid Build Coastguard Worker 0xc53a4000, 0xc6b98800, 0x4615b400, 0x46daca00, 0x46bb5c00, 0xc4af0000, 0x467a1800, 0xc6dd2c00,
399*35238bceSAndroid Build Coastguard Worker };
400*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt16UintRef[] = {
401*35238bceSAndroid Build Coastguard Worker 0xffffddf1, 0xffffc3cd, 0xffffb61c, 0x0000746f, 0x00001319, 0xffffed25, 0xffffce16, 0x00000f0d,
402*35238bceSAndroid Build Coastguard Worker 0xfffff45c, 0xffffa33c, 0x0000256d, 0x00006d65, 0x00005dae, 0xfffffa88, 0x00003e86, 0xffff916a,
403*35238bceSAndroid Build Coastguard Worker };
404*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt16IntRef[] = {
405*35238bceSAndroid Build Coastguard Worker 0xffffddf1, 0xffffc3cd, 0xffffb61c, 0x0000746f, 0x00001319, 0xffffed25, 0xffffce16, 0x00000f0d,
406*35238bceSAndroid Build Coastguard Worker 0xfffff45c, 0xffffa33c, 0x0000256d, 0x00006d65, 0x00005dae, 0xfffffa88, 0x00003e86, 0xffff916a,
407*35238bceSAndroid Build Coastguard Worker };
408*35238bceSAndroid Build Coastguard Worker
409*35238bceSAndroid Build Coastguard Worker static const uint8_t s_signedInt32In[] = {
410*35238bceSAndroid Build Coastguard Worker 0xc6, 0x7e, 0x50, 0x2a, 0xec, 0x0f, 0x9b, 0x44, 0x4d, 0xa9, 0x77, 0x0d, 0x69, 0x4c, 0xd3, 0x76,
411*35238bceSAndroid Build Coastguard Worker 0xf0, 0xb7, 0xde, 0x6b, 0x4e, 0xe2, 0xb1, 0x58, 0xa8, 0x9c, 0xfc, 0x6d, 0x75, 0x8f, 0x3c, 0x7f,
412*35238bceSAndroid Build Coastguard Worker 0xf3, 0x19, 0x14, 0x97, 0xf0, 0x87, 0x5c, 0x11, 0x95, 0x32, 0xab, 0x7a, 0x03, 0x2b, 0xdf, 0x52,
413*35238bceSAndroid Build Coastguard Worker 0x68, 0x84, 0xd9, 0x91, 0xec, 0x2a, 0xf1, 0xd0, 0xf7, 0x73, 0x8f, 0x0a, 0x62, 0xd2, 0x76, 0xfd,
414*35238bceSAndroid Build Coastguard Worker };
415*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt32FloatRef[] = {
416*35238bceSAndroid Build Coastguard Worker 0x4e2941fb, 0x4e893620, 0x4d577a95, 0x4eeda699, 0x4ed7bd70, 0x4eb163c5, 0x4edbf939, 0x4efe791f,
417*35238bceSAndroid Build Coastguard Worker 0xced1d7cc, 0x4d8ae440, 0x4ef55665, 0x4ea5be56, 0xcedc4cf7, 0xce3c3b54, 0x4d28f73f, 0xcc224b68,
418*35238bceSAndroid Build Coastguard Worker };
419*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt32UintRef[] = {
420*35238bceSAndroid Build Coastguard Worker 0x2a507ec6, 0x449b0fec, 0x0d77a94d, 0x76d34c69, 0x6bdeb7f0, 0x58b1e24e, 0x6dfc9ca8, 0x7f3c8f75,
421*35238bceSAndroid Build Coastguard Worker 0x971419f3, 0x115c87f0, 0x7aab3295, 0x52df2b03, 0x91d98468, 0xd0f12aec, 0x0a8f73f7, 0xfd76d262,
422*35238bceSAndroid Build Coastguard Worker };
423*35238bceSAndroid Build Coastguard Worker static const uint32_t s_signedInt32IntRef[] = {
424*35238bceSAndroid Build Coastguard Worker 0x2a507ec6, 0x449b0fec, 0x0d77a94d, 0x76d34c69, 0x6bdeb7f0, 0x58b1e24e, 0x6dfc9ca8, 0x7f3c8f75,
425*35238bceSAndroid Build Coastguard Worker 0x971419f3, 0x115c87f0, 0x7aab3295, 0x52df2b03, 0x91d98468, 0xd0f12aec, 0x0a8f73f7, 0xfd76d262,
426*35238bceSAndroid Build Coastguard Worker };
427*35238bceSAndroid Build Coastguard Worker
428*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt8In[] = {
429*35238bceSAndroid Build Coastguard Worker 0x68, 0xa6, 0x99, 0x6e, 0x13, 0x90, 0x0f, 0x40, 0x34, 0x76, 0x05, 0x9a, 0x6c, 0x9c, 0x1d, 0x6a,
430*35238bceSAndroid Build Coastguard Worker };
431*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt8FloatRef[] = {
432*35238bceSAndroid Build Coastguard Worker 0x42d00000, 0x43260000, 0x43190000, 0x42dc0000, 0x41980000, 0x43100000, 0x41700000, 0x42800000,
433*35238bceSAndroid Build Coastguard Worker 0x42500000, 0x42ec0000, 0x40a00000, 0x431a0000, 0x42d80000, 0x431c0000, 0x41e80000, 0x42d40000,
434*35238bceSAndroid Build Coastguard Worker };
435*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt8UintRef[] = {
436*35238bceSAndroid Build Coastguard Worker 0x00000068, 0x000000a6, 0x00000099, 0x0000006e, 0x00000013, 0x00000090, 0x0000000f, 0x00000040,
437*35238bceSAndroid Build Coastguard Worker 0x00000034, 0x00000076, 0x00000005, 0x0000009a, 0x0000006c, 0x0000009c, 0x0000001d, 0x0000006a,
438*35238bceSAndroid Build Coastguard Worker };
439*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt8IntRef[] = {
440*35238bceSAndroid Build Coastguard Worker 0x00000068, 0x000000a6, 0x00000099, 0x0000006e, 0x00000013, 0x00000090, 0x0000000f, 0x00000040,
441*35238bceSAndroid Build Coastguard Worker 0x00000034, 0x00000076, 0x00000005, 0x0000009a, 0x0000006c, 0x0000009c, 0x0000001d, 0x0000006a,
442*35238bceSAndroid Build Coastguard Worker };
443*35238bceSAndroid Build Coastguard Worker
444*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt16In[] = {
445*35238bceSAndroid Build Coastguard Worker 0xa5, 0x62, 0x98, 0x7c, 0x13, 0x21, 0xc8, 0xf4, 0x78, 0x0b, 0x9f, 0xc2, 0x92, 0x1c, 0xa9, 0x25,
446*35238bceSAndroid Build Coastguard Worker 0x86, 0xea, 0x1f, 0x1c, 0x41, 0xf7, 0xe2, 0x2e, 0x38, 0x69, 0xf2, 0x6d, 0x01, 0xec, 0x7f, 0xc5,
447*35238bceSAndroid Build Coastguard Worker };
448*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt16FloatRef[] = {
449*35238bceSAndroid Build Coastguard Worker 0x46c54a00, 0x46f93000, 0x46044c00, 0x4774c800, 0x45378000, 0x47429f00, 0x45e49000, 0x4616a400,
450*35238bceSAndroid Build Coastguard Worker 0x476a8600, 0x45e0f800, 0x47774100, 0x463b8800, 0x46d27000, 0x46dbe400, 0x476c0100, 0x47457f00,
451*35238bceSAndroid Build Coastguard Worker };
452*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt16UintRef[] = {
453*35238bceSAndroid Build Coastguard Worker 0x000062a5, 0x00007c98, 0x00002113, 0x0000f4c8, 0x00000b78, 0x0000c29f, 0x00001c92, 0x000025a9,
454*35238bceSAndroid Build Coastguard Worker 0x0000ea86, 0x00001c1f, 0x0000f741, 0x00002ee2, 0x00006938, 0x00006df2, 0x0000ec01, 0x0000c57f,
455*35238bceSAndroid Build Coastguard Worker };
456*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt16IntRef[] = {
457*35238bceSAndroid Build Coastguard Worker 0x000062a5, 0x00007c98, 0x00002113, 0x0000f4c8, 0x00000b78, 0x0000c29f, 0x00001c92, 0x000025a9,
458*35238bceSAndroid Build Coastguard Worker 0x0000ea86, 0x00001c1f, 0x0000f741, 0x00002ee2, 0x00006938, 0x00006df2, 0x0000ec01, 0x0000c57f,
459*35238bceSAndroid Build Coastguard Worker };
460*35238bceSAndroid Build Coastguard Worker
461*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt24In[] = {
462*35238bceSAndroid Build Coastguard Worker 0xa8, 0x11, 0x00, 0xc8, 0xe5, 0x07, 0xd3, 0x6d, 0x0a, 0xc7, 0xe4, 0x42, 0x2d, 0xf7, 0x5d, 0x9c,
463*35238bceSAndroid Build Coastguard Worker 0x2e, 0x18, 0xfd, 0xa4, 0x9e, 0x90, 0x0c, 0x31, 0x06, 0x04, 0xc4, 0xc2, 0xde, 0xfe, 0x7c, 0x1d,
464*35238bceSAndroid Build Coastguard Worker 0x57, 0x37, 0x4a, 0xf2, 0xe2, 0xf3, 0x74, 0x8e, 0x8f, 0xd6, 0x73, 0xc4, 0x91, 0xa0, 0x49, 0xe3,
465*35238bceSAndroid Build Coastguard Worker };
466*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt24FloatRef[] = {
467*35238bceSAndroid Build Coastguard Worker 0x458d4000, 0x48fcb900, 0x4926dd30, 0x4a85c98e, 0x4abbee5a, 0x49c174e0, 0x4b1ea4fd, 0x4a443240,
468*35238bceSAndroid Build Coastguard Worker 0x4b440406, 0x4b7edec2, 0x4aae3af8, 0x4b724a37, 0x4ae9e7c4, 0x4b568f8e, 0x4b11c473, 0x4b6349a0,
469*35238bceSAndroid Build Coastguard Worker };
470*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt24UintRef[] = {
471*35238bceSAndroid Build Coastguard Worker 0x000011a8, 0x0007e5c8, 0x000a6dd3, 0x0042e4c7, 0x005df72d, 0x00182e9c, 0x009ea4fd, 0x00310c90,
472*35238bceSAndroid Build Coastguard Worker 0x00c40406, 0x00fedec2, 0x00571d7c, 0x00f24a37, 0x0074f3e2, 0x00d68f8e, 0x0091c473, 0x00e349a0,
473*35238bceSAndroid Build Coastguard Worker };
474*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt24IntRef[] = {
475*35238bceSAndroid Build Coastguard Worker 0x000011a8, 0x0007e5c8, 0x000a6dd3, 0x0042e4c7, 0x005df72d, 0x00182e9c, 0x009ea4fd, 0x00310c90,
476*35238bceSAndroid Build Coastguard Worker 0x00c40406, 0x00fedec2, 0x00571d7c, 0x00f24a37, 0x0074f3e2, 0x00d68f8e, 0x0091c473, 0x00e349a0,
477*35238bceSAndroid Build Coastguard Worker };
478*35238bceSAndroid Build Coastguard Worker
479*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unsignedInt32In[] = {
480*35238bceSAndroid Build Coastguard Worker 0x90, 0xb0, 0x00, 0xa8, 0xd8, 0x42, 0x5b, 0xae, 0x40, 0x70, 0x38, 0x2a, 0x92, 0x76, 0xd8, 0x70,
481*35238bceSAndroid Build Coastguard Worker 0x04, 0x0d, 0x67, 0x87, 0x9c, 0xdd, 0xb1, 0xeb, 0xfc, 0x37, 0xe6, 0x40, 0x24, 0x9c, 0x6a, 0x0f,
482*35238bceSAndroid Build Coastguard Worker 0x09, 0x0e, 0xb6, 0x2f, 0x31, 0x95, 0x43, 0x22, 0x24, 0xde, 0x70, 0x2a, 0x05, 0xa2, 0x84, 0x38,
483*35238bceSAndroid Build Coastguard Worker 0x16, 0x9f, 0x65, 0x0e, 0xb2, 0x99, 0x84, 0x6d, 0xef, 0x86, 0x94, 0xf0, 0x25, 0x9d, 0xf9, 0x67,
484*35238bceSAndroid Build Coastguard Worker };
485*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt32FloatRef[] = {
486*35238bceSAndroid Build Coastguard Worker 0x4f2800b1, 0x4f2e5b43, 0x4e28e1c1, 0x4ee1b0ed, 0x4f07670d, 0x4f6bb1de, 0x4e81cc70, 0x4d76a9c2,
487*35238bceSAndroid Build Coastguard Worker 0x4e3ed838, 0x4e090e55, 0x4e29c379, 0x4e621288, 0x4d6659f1, 0x4edb0933, 0x4f709487, 0x4ecff33a,
488*35238bceSAndroid Build Coastguard Worker };
489*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt32UintRef[] = {
490*35238bceSAndroid Build Coastguard Worker 0xa800b090, 0xae5b42d8, 0x2a387040, 0x70d87692, 0x87670d04, 0xebb1dd9c, 0x40e637fc, 0x0f6a9c24,
491*35238bceSAndroid Build Coastguard Worker 0x2fb60e09, 0x22439531, 0x2a70de24, 0x3884a205, 0x0e659f16, 0x6d8499b2, 0xf09486ef, 0x67f99d25,
492*35238bceSAndroid Build Coastguard Worker };
493*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unsignedInt32IntRef[] = {
494*35238bceSAndroid Build Coastguard Worker 0xa800b090, 0xae5b42d8, 0x2a387040, 0x70d87692, 0x87670d04, 0xebb1dd9c, 0x40e637fc, 0x0f6a9c24,
495*35238bceSAndroid Build Coastguard Worker 0x2fb60e09, 0x22439531, 0x2a70de24, 0x3884a205, 0x0e659f16, 0x6d8499b2, 0xf09486ef, 0x67f99d25,
496*35238bceSAndroid Build Coastguard Worker };
497*35238bceSAndroid Build Coastguard Worker
498*35238bceSAndroid Build Coastguard Worker static const uint8_t s_Int64In[] = {
499*35238bceSAndroid Build Coastguard Worker 0x90, 0xb0, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x40, 0x70, 0x38, 0x2a, 0x01, 0x01, 0x00, 0x00, 0x04, 0x0d, 0x67,
500*35238bceSAndroid Build Coastguard Worker 0x87, 0x01, 0x01, 0x01, 0x00, 0xfc, 0x37, 0xe6, 0x40, 0x01, 0x01, 0x01, 0x01, 0x09, 0x0e, 0xb6, 0x2f, 0x02, 0x01,
501*35238bceSAndroid Build Coastguard Worker 0x01, 0x01, 0x24, 0xde, 0x70, 0x2a, 0x01, 0x02, 0x01, 0x01, 0x16, 0x9f, 0x65, 0x0e, 0x01, 0x01, 0x02, 0x01, 0xef,
502*35238bceSAndroid Build Coastguard Worker 0x86, 0x94, 0x72, 0x01, 0x01, 0x01, 0x02, 0xc6, 0x7e, 0x50, 0x2a, 0x01, 0x00, 0x00, 0x00, 0x4d, 0xa9, 0x77, 0x0d,
503*35238bceSAndroid Build Coastguard Worker 0x01, 0x01, 0x00, 0x00, 0xf0, 0xb7, 0xde, 0x6b, 0x01, 0x01, 0x01, 0x00, 0xa8, 0x9c, 0xfc, 0x6d, 0x01, 0x01, 0x01,
504*35238bceSAndroid Build Coastguard Worker 0x01, 0xf3, 0x19, 0x14, 0x97, 0x02, 0x01, 0x01, 0x01, 0x95, 0x32, 0xab, 0x7a, 0x01, 0x02, 0x01, 0x01, 0x68, 0x84,
505*35238bceSAndroid Build Coastguard Worker 0xd9, 0x71, 0x01, 0x01, 0x02, 0x01, 0xf7, 0x73, 0x8f, 0x0a, 0x01, 0x01, 0x01, 0x02,
506*35238bceSAndroid Build Coastguard Worker };
507*35238bceSAndroid Build Coastguard Worker
508*35238bceSAndroid Build Coastguard Worker static const uint32_t s_Int64FloatRef[] = {
509*35238bceSAndroid Build Coastguard Worker 0x4fbc0058, 0x5380951c, 0x578080c4, 0x5b808081, 0x5b808081, 0x5b808101, 0x5b810081, 0x5c004040,
510*35238bceSAndroid Build Coastguard Worker 0x4f95283f, 0x538086bc, 0x578080b6, 0x5b808081, 0x5b808081, 0x5b808101, 0x5b810081, 0x5c004040,
511*35238bceSAndroid Build Coastguard Worker };
512*35238bceSAndroid Build Coastguard Worker
513*35238bceSAndroid Build Coastguard Worker static const uint32_t s_Int64IntRef[] = {
514*35238bceSAndroid Build Coastguard Worker 0x7800b090, 0x2a387040, 0x87670d04, 0x40e637fc, 0x2fb60e09, 0x2a70de24, 0x0e659f16, 0x729486ef,
515*35238bceSAndroid Build Coastguard Worker 0x2a507ec6, 0x0d77a94d, 0x6bdeb7f0, 0x6dfc9ca8, 0x971419f3, 0x7aab3295, 0x71d98468, 0x0a8f73f7,
516*35238bceSAndroid Build Coastguard Worker };
517*35238bceSAndroid Build Coastguard Worker
518*35238bceSAndroid Build Coastguard Worker static const uint8_t s_halfFloatIn[] = {
519*35238bceSAndroid Build Coastguard Worker 0x2b, 0x74, 0x6a, 0x5d, 0x1c, 0xb2, 0x9a, 0x4d, 0xad, 0x55, 0x22, 0x01, 0xce, 0x2d, 0x97, 0x0d,
520*35238bceSAndroid Build Coastguard Worker 0x71, 0x31, 0x42, 0x2b, 0xeb, 0x26, 0xc7, 0x16, 0x94, 0xd2, 0x22, 0x79, 0x89, 0xbd, 0xff, 0xbc,
521*35238bceSAndroid Build Coastguard Worker };
522*35238bceSAndroid Build Coastguard Worker static const uint32_t s_halfFloatFloatRef[] = {
523*35238bceSAndroid Build Coastguard Worker 0x46856000, 0x43ad4000, 0xbe438000, 0x41b34000, 0x42b5a000, 0x37910000, 0x3db9c000, 0x39b2e000,
524*35238bceSAndroid Build Coastguard Worker 0x3e2e2000, 0x3d684000, 0x3cdd6000, 0x3ad8e000, 0xc2528000, 0x47244000, 0xbfb12000, 0xbf9fe000,
525*35238bceSAndroid Build Coastguard Worker };
526*35238bceSAndroid Build Coastguard Worker static const uint32_t s_halfFloatUintRef[] = {
527*35238bceSAndroid Build Coastguard Worker 0x000042b0, 0x0000015a, 0x00000000, 0x00000016, 0x0000005a, 0x00000000, 0x00000000, 0x00000000,
528*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffcc, 0x0000a440, 0xffffffff, 0xffffffff,
529*35238bceSAndroid Build Coastguard Worker };
530*35238bceSAndroid Build Coastguard Worker static const uint32_t s_halfFloatIntRef[] = {
531*35238bceSAndroid Build Coastguard Worker 0x000042b0, 0x0000015a, 0x00000000, 0x00000016, 0x0000005a, 0x00000000, 0x00000000, 0x00000000,
532*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffcc, 0x0000a440, 0xffffffff, 0xffffffff,
533*35238bceSAndroid Build Coastguard Worker };
534*35238bceSAndroid Build Coastguard Worker
535*35238bceSAndroid Build Coastguard Worker static const uint8_t s_floatIn[] = {
536*35238bceSAndroid Build Coastguard Worker 0x92, 0xac, 0x68, 0x36, 0x9f, 0x42, 0x0b, 0x6e, 0x67, 0xcf, 0x0f, 0x20, 0x22, 0x6c, 0xe4, 0x0f,
537*35238bceSAndroid Build Coastguard Worker 0xb3, 0x72, 0xc8, 0x8a, 0x4b, 0x99, 0xc3, 0xb0, 0xbd, 0x78, 0x5c, 0x16, 0x1c, 0xce, 0xb7, 0x4e,
538*35238bceSAndroid Build Coastguard Worker 0x15, 0xdf, 0x37, 0xfd, 0xeb, 0x32, 0xe9, 0x47, 0x68, 0x1a, 0xaa, 0xd0, 0xb9, 0xba, 0x77, 0xe7,
539*35238bceSAndroid Build Coastguard Worker 0x81, 0x0a, 0x42, 0x5a, 0xb0, 0x5a, 0xee, 0x06, 0x77, 0xb4, 0x7b, 0x57, 0xf5, 0x35, 0xac, 0x56,
540*35238bceSAndroid Build Coastguard Worker };
541*35238bceSAndroid Build Coastguard Worker static const uint32_t s_floatFloatRef[] = {
542*35238bceSAndroid Build Coastguard Worker 0x3668ac92, 0x6e0b429f, 0x200fcf67, 0x0fe46c22, 0x8ac872b3, 0xb0c3994b, 0x165c78bd, 0x4eb7ce1c,
543*35238bceSAndroid Build Coastguard Worker 0xfd37df15, 0x47e932eb, 0xd0aa1a68, 0xe777bab9, 0x5a420a81, 0x06ee5ab0, 0x577bb477, 0x56ac35f5,
544*35238bceSAndroid Build Coastguard Worker };
545*35238bceSAndroid Build Coastguard Worker static const uint32_t s_floatUintRef[] = {
546*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x5be70e00,
547*35238bceSAndroid Build Coastguard Worker 0x80000000, 0x0001d265, 0x80000000, 0x80000000, 0x80000000, 0x00000000, 0x80000000, 0x80000000,
548*35238bceSAndroid Build Coastguard Worker };
549*35238bceSAndroid Build Coastguard Worker static const uint32_t s_floatIntRef[] = {
550*35238bceSAndroid Build Coastguard Worker 0x00000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x5be70e00,
551*35238bceSAndroid Build Coastguard Worker 0x80000000, 0x0001d265, 0x80000000, 0x80000000, 0x80000000, 0x00000000, 0x80000000, 0x80000000,
552*35238bceSAndroid Build Coastguard Worker };
553*35238bceSAndroid Build Coastguard Worker
554*35238bceSAndroid Build Coastguard Worker static const uint8_t s_float64In[] = {
555*35238bceSAndroid Build Coastguard Worker 0xbd, 0xb6, 0xc3, 0xd2, 0xf6, 0x62, 0x29, 0xd9, 0x2f, 0xc2, 0x46, 0x18, 0x6b, 0x0d, 0x0a, 0x53, 0x6d, 0x0c, 0xf3,
556*35238bceSAndroid Build Coastguard Worker 0x80, 0xbd, 0xa9, 0x12, 0x89, 0x6b, 0x9f, 0x3d, 0xdd, 0xb3, 0x91, 0xee, 0xf5, 0x92, 0xac, 0x68, 0x36, 0x9f, 0x42,
557*35238bceSAndroid Build Coastguard Worker 0x0b, 0x6e, 0x67, 0xcf, 0x0f, 0x20, 0x22, 0x6c, 0xe4, 0x0f, 0xb3, 0x72, 0xc8, 0x8a, 0x4b, 0x99, 0xc3, 0xb0, 0xbd,
558*35238bceSAndroid Build Coastguard Worker 0x78, 0x5c, 0x16, 0x1c, 0xce, 0xb7, 0x4e, 0x15, 0xdf, 0x37, 0xfd, 0xeb, 0x32, 0xe9, 0x47, 0x68, 0x1a, 0xaa, 0xd0,
559*35238bceSAndroid Build Coastguard Worker 0xb9, 0xba, 0x77, 0xe7, 0x81, 0x0a, 0x42, 0x5a, 0xb0, 0x5a, 0xee, 0x06, 0x77, 0xb4, 0x7b, 0x57, 0xf5, 0x35, 0xac,
560*35238bceSAndroid Build Coastguard Worker 0x56, 0x2b, 0x74, 0x6a, 0x5d, 0x1c, 0xb2, 0x9a, 0x4d, 0xad, 0x55, 0x22, 0x01, 0xce, 0x2d, 0x97, 0x0d, 0x71, 0x31,
561*35238bceSAndroid Build Coastguard Worker 0x42, 0x2b, 0xeb, 0x26, 0xc7, 0x16, 0x94, 0xd2, 0x22, 0x79, 0x89, 0xbd, 0xff, 0xbc,
562*35238bceSAndroid Build Coastguard Worker };
563*35238bceSAndroid Build Coastguard Worker static const uint32_t s_float64FloatRef[] = {
564*35238bceSAndroid Build Coastguard Worker 0xff800000, 0x7f800000, 0x80000000, 0xff800000, 0x7f800000, 0x00000000, 0x80000000, 0x7f800000,
565*35238bceSAndroid Build Coastguard Worker 0x7f499760, 0xff800000, 0x00000000, 0x7f800000, 0x7f800000, 0x00000000, 0x00000000, 0xa7fdec4c,
566*35238bceSAndroid Build Coastguard Worker };
567*35238bceSAndroid Build Coastguard Worker static const uint32_t s_float64IntRef[] = {
568*35238bceSAndroid Build Coastguard Worker 0x80000000, 0x80000000, 0x00000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000, 0x80000000,
569*35238bceSAndroid Build Coastguard Worker 0x80000000, 0x80000000, 0x00000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000,
570*35238bceSAndroid Build Coastguard Worker };
571*35238bceSAndroid Build Coastguard Worker
572*35238bceSAndroid Build Coastguard Worker static const uint8_t s_floatUnsignedInt248RevIn[] = {
573*35238bceSAndroid Build Coastguard Worker 0xbd, 0xb6, 0xc3, 0xd2, 0xf6, 0x62, 0x29, 0xd9, 0x2f, 0xc2, 0x46, 0x18, 0x6b, 0x0d, 0x0a, 0x53,
574*35238bceSAndroid Build Coastguard Worker 0x6d, 0x0c, 0xf3, 0x80, 0xbd, 0xa9, 0x12, 0x89, 0x6b, 0x9f, 0x3d, 0xdd, 0xb3, 0x91, 0xee, 0xf5,
575*35238bceSAndroid Build Coastguard Worker };
576*35238bceSAndroid Build Coastguard Worker static const uint32_t s_floatUnsignedInt248RevFloatRef[] = {
577*35238bceSAndroid Build Coastguard Worker 0xd2c3b6bd, 0x00000000, 0x00000000, 0x3f800000, 0x1846c22f, 0x00000000, 0x00000000, 0x3f800000,
578*35238bceSAndroid Build Coastguard Worker 0x80f30c6d, 0x00000000, 0x00000000, 0x3f800000, 0xdd3d9f6b, 0x00000000, 0x00000000, 0x3f800000,
579*35238bceSAndroid Build Coastguard Worker };
580*35238bceSAndroid Build Coastguard Worker static const uint32_t s_floatUnsignedInt248RevUintRef[] = {
581*35238bceSAndroid Build Coastguard Worker 0x000000f6, 0x00000000, 0x00000000, 0x00000001, 0x0000006b, 0x00000000, 0x00000000, 0x00000001,
582*35238bceSAndroid Build Coastguard Worker 0x000000bd, 0x00000000, 0x00000000, 0x00000001, 0x000000b3, 0x00000000, 0x00000000, 0x00000001,
583*35238bceSAndroid Build Coastguard Worker };
584*35238bceSAndroid Build Coastguard Worker
585*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort10In[] = {0x80, 0x84, 0x40, 0x3b, 0x40, 0xfd, 0x80, 0x1a, 0x80, 0x0c, 0x80,
586*35238bceSAndroid Build Coastguard Worker 0x15, 0x40, 0x11, 0x80, 0xc3, 0x80, 0xc8, 0x80, 0xd5, 0xc0, 0xf9,
587*35238bceSAndroid Build Coastguard Worker 0x00, 0x0a, 0xc0, 0x39, 0x40, 0xd5, 0xc0, 0x4d, 0xc0, 0x26};
588*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort10FloatRef[] = {
589*35238bceSAndroid Build Coastguard Worker 0x3f04a128, 0x3e6d3b4f, 0x3f7d7f60, 0x3dd4350d, 0x3d48320d, 0x3dac2b0b, 0x3d8a2289, 0x3f43b0ec,
590*35238bceSAndroid Build Coastguard Worker 0x3f48b22d, 0x3f55b56d, 0x3f79fe80, 0x3d20280a, 0x3e6739ce, 0x3f55755d, 0x3e9ba6ea, 0x3e1b26ca};
591*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort10UintRef[] = {
592*35238bceSAndroid Build Coastguard Worker 0x212, 0x0ed, 0x3f5, 0x06a, 0x032, 0x056, 0x045, 0x30e, 0x322, 0x356, 0x3e7, 0x028, 0x0e7, 0x355, 0x137, 0x09b,
593*35238bceSAndroid Build Coastguard Worker };
594*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort10IntRef[] = {
595*35238bceSAndroid Build Coastguard Worker 0x212, 0x0ed, 0x3f5, 0x06a, 0x032, 0x056, 0x045, 0x30e, 0x322, 0x356, 0x3e7, 0x028, 0x0e7, 0x355, 0x137, 0x09b,
596*35238bceSAndroid Build Coastguard Worker };
597*35238bceSAndroid Build Coastguard Worker
598*35238bceSAndroid Build Coastguard Worker static const uint8_t s_unormShort12In[] = {0x30, 0x46, 0xf0, 0x38, 0x90, 0x85, 0xf0, 0x88, 0x90, 0x92, 0x30,
599*35238bceSAndroid Build Coastguard Worker 0x5d, 0x30, 0x3a, 0x00, 0xc9, 0x00, 0x64, 0xb0, 0x9b, 0x20, 0x71,
600*35238bceSAndroid Build Coastguard Worker 0xd0, 0x5b, 0xa0, 0xc5, 0x70, 0x27, 0x30, 0x0b, 0xa0, 0x53};
601*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort12FloatRef[] = {
602*35238bceSAndroid Build Coastguard Worker 0x3e8c68c7, 0x3e63ce3d, 0x3f05985a, 0x3f08f890, 0x3f12992a, 0x3eba6ba7, 0x3e68ce8d, 0x3f490c91,
603*35238bceSAndroid Build Coastguard Worker 0x3ec80c81, 0x3f1bb9bc, 0x3ee24e25, 0x3eb7ab7b, 0x3f45ac5b, 0x3e1dc9dd, 0x3d330b31, 0x3ea74a75};
604*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort12UintRef[] = {0x463, 0x38f, 0x859, 0x88f, 0x929, 0x5d3, 0x3a3, 0xc90,
605*35238bceSAndroid Build Coastguard Worker 0x640, 0x9bb, 0x712, 0x5bd, 0xc5a, 0x277, 0x0b3, 0x53a};
606*35238bceSAndroid Build Coastguard Worker static const uint32_t s_unormShort12IntRef[] = {0x463, 0x38f, 0x859, 0x88f, 0x929, 0x5d3, 0x3a3, 0xc90,
607*35238bceSAndroid Build Coastguard Worker 0x640, 0x9bb, 0x712, 0x5bd, 0xc5a, 0x277, 0x0b3, 0x53a};
608*35238bceSAndroid Build Coastguard Worker
609*35238bceSAndroid Build Coastguard Worker // \todo [2015-10-12 pyry] Collapse duplicate ref arrays
610*35238bceSAndroid Build Coastguard Worker
611*35238bceSAndroid Build Coastguard Worker static const struct
612*35238bceSAndroid Build Coastguard Worker {
613*35238bceSAndroid Build Coastguard Worker const uint8_t *input;
614*35238bceSAndroid Build Coastguard Worker const int inputSize;
615*35238bceSAndroid Build Coastguard Worker const uint32_t *floatRef;
616*35238bceSAndroid Build Coastguard Worker const uint32_t *intRef;
617*35238bceSAndroid Build Coastguard Worker const uint32_t *uintRef;
618*35238bceSAndroid Build Coastguard Worker } s_formatData[] = {
619*35238bceSAndroid Build Coastguard Worker {s_snormInt8In, DE_LENGTH_OF_ARRAY(s_snormInt8In), s_snormInt8FloatRef, s_snormInt8IntRef, s_snormInt8UintRef},
620*35238bceSAndroid Build Coastguard Worker {s_snormInt16In, DE_LENGTH_OF_ARRAY(s_snormInt16In), s_snormInt16FloatRef, s_snormInt16IntRef, s_snormInt16UintRef},
621*35238bceSAndroid Build Coastguard Worker {s_snormInt32In, DE_LENGTH_OF_ARRAY(s_snormInt32In), s_snormInt32FloatRef, s_snormInt32IntRef, s_snormInt32UintRef},
622*35238bceSAndroid Build Coastguard Worker {s_unormInt8In, DE_LENGTH_OF_ARRAY(s_unormInt8In), s_unormInt8FloatRef, s_unormInt8IntRef, s_unormInt8UintRef},
623*35238bceSAndroid Build Coastguard Worker {s_unormInt16In, DE_LENGTH_OF_ARRAY(s_unormInt16In), s_unormInt16FloatRef, s_unormInt16IntRef, s_unormInt16UintRef},
624*35238bceSAndroid Build Coastguard Worker {s_unormInt24In, DE_LENGTH_OF_ARRAY(s_unormInt24In), s_unormInt24FloatRef, s_unormInt24IntRef, s_unormInt24UintRef},
625*35238bceSAndroid Build Coastguard Worker {s_unormInt32In, DE_LENGTH_OF_ARRAY(s_unormInt32In), s_unormInt32FloatRef, s_unormInt32IntRef, s_unormInt32UintRef},
626*35238bceSAndroid Build Coastguard Worker {s_unormByte44In, DE_LENGTH_OF_ARRAY(s_unormByte44In), s_unormByte44FloatRef, s_unormByte44IntRef,
627*35238bceSAndroid Build Coastguard Worker s_unormByte44IntRef},
628*35238bceSAndroid Build Coastguard Worker {
629*35238bceSAndroid Build Coastguard Worker s_unormShort565In,
630*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort565In),
631*35238bceSAndroid Build Coastguard Worker s_unormShort565FloatRef,
632*35238bceSAndroid Build Coastguard Worker s_unormShort565IntRef,
633*35238bceSAndroid Build Coastguard Worker s_unormShort565IntRef,
634*35238bceSAndroid Build Coastguard Worker },
635*35238bceSAndroid Build Coastguard Worker {
636*35238bceSAndroid Build Coastguard Worker s_unormShort555In,
637*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort555In),
638*35238bceSAndroid Build Coastguard Worker s_unormShort555FloatRef,
639*35238bceSAndroid Build Coastguard Worker s_unormShort555IntRef,
640*35238bceSAndroid Build Coastguard Worker s_unormShort555IntRef,
641*35238bceSAndroid Build Coastguard Worker },
642*35238bceSAndroid Build Coastguard Worker {
643*35238bceSAndroid Build Coastguard Worker s_unormShort4444In,
644*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort4444In),
645*35238bceSAndroid Build Coastguard Worker s_unormShort4444FloatRef,
646*35238bceSAndroid Build Coastguard Worker s_unormShort4444IntRef,
647*35238bceSAndroid Build Coastguard Worker s_unormShort4444IntRef,
648*35238bceSAndroid Build Coastguard Worker },
649*35238bceSAndroid Build Coastguard Worker {
650*35238bceSAndroid Build Coastguard Worker s_unormShort5551In,
651*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort5551In),
652*35238bceSAndroid Build Coastguard Worker s_unormShort5551FloatRef,
653*35238bceSAndroid Build Coastguard Worker s_unormShort5551IntRef,
654*35238bceSAndroid Build Coastguard Worker s_unormShort5551IntRef,
655*35238bceSAndroid Build Coastguard Worker },
656*35238bceSAndroid Build Coastguard Worker {
657*35238bceSAndroid Build Coastguard Worker s_unormShort1555In,
658*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort1555In),
659*35238bceSAndroid Build Coastguard Worker s_unormShort1555FloatRef,
660*35238bceSAndroid Build Coastguard Worker s_unormShort1555IntRef,
661*35238bceSAndroid Build Coastguard Worker s_unormShort1555IntRef,
662*35238bceSAndroid Build Coastguard Worker },
663*35238bceSAndroid Build Coastguard Worker {s_unormInt101010In, DE_LENGTH_OF_ARRAY(s_unormInt101010In), s_unormInt101010FloatRef, s_unormInt101010IntRef,
664*35238bceSAndroid Build Coastguard Worker s_unormInt101010IntRef},
665*35238bceSAndroid Build Coastguard Worker
666*35238bceSAndroid Build Coastguard Worker // \note Same input data & int reference used for {U,S}NORM_INT_1010102_REV
667*35238bceSAndroid Build Coastguard Worker {s_unormInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unormInt1010102RevIn), s_snormInt1010102RevFloatRef,
668*35238bceSAndroid Build Coastguard Worker s_snormInt1010102RevIntRef, s_snormInt1010102RevIntRef},
669*35238bceSAndroid Build Coastguard Worker {s_unormInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unormInt1010102RevIn), s_unormInt1010102RevFloatRef,
670*35238bceSAndroid Build Coastguard Worker s_unormInt1010102RevIntRef, s_unormInt1010102RevIntRef},
671*35238bceSAndroid Build Coastguard Worker
672*35238bceSAndroid Build Coastguard Worker // \note UNSIGNED_BYTE_* and UNSIGNED_SHORT_* re-use input data and integer reference values from UNORM_* cases
673*35238bceSAndroid Build Coastguard Worker {s_unormByte44In, DE_LENGTH_OF_ARRAY(s_unormByte44In), s_unsignedByte44FloatRef, s_unormByte44IntRef,
674*35238bceSAndroid Build Coastguard Worker s_unormByte44IntRef},
675*35238bceSAndroid Build Coastguard Worker {
676*35238bceSAndroid Build Coastguard Worker s_unormShort565In,
677*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort565In),
678*35238bceSAndroid Build Coastguard Worker s_unsignedShort565FloatRef,
679*35238bceSAndroid Build Coastguard Worker s_unormShort565IntRef,
680*35238bceSAndroid Build Coastguard Worker s_unormShort565IntRef,
681*35238bceSAndroid Build Coastguard Worker },
682*35238bceSAndroid Build Coastguard Worker {
683*35238bceSAndroid Build Coastguard Worker s_unormShort4444In,
684*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort4444In),
685*35238bceSAndroid Build Coastguard Worker s_unsignedShort4444FloatRef,
686*35238bceSAndroid Build Coastguard Worker s_unormShort4444IntRef,
687*35238bceSAndroid Build Coastguard Worker s_unormShort4444IntRef,
688*35238bceSAndroid Build Coastguard Worker },
689*35238bceSAndroid Build Coastguard Worker {
690*35238bceSAndroid Build Coastguard Worker s_unormShort5551In,
691*35238bceSAndroid Build Coastguard Worker DE_LENGTH_OF_ARRAY(s_unormShort5551In),
692*35238bceSAndroid Build Coastguard Worker s_unsignedShort5551FloatRef,
693*35238bceSAndroid Build Coastguard Worker s_unormShort5551IntRef,
694*35238bceSAndroid Build Coastguard Worker s_unormShort5551IntRef,
695*35238bceSAndroid Build Coastguard Worker },
696*35238bceSAndroid Build Coastguard Worker
697*35238bceSAndroid Build Coastguard Worker // \note (UN)SIGNED_INT_1010102_REV formats use same input data
698*35238bceSAndroid Build Coastguard Worker {s_unsignedInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt1010102RevIn), s_signedInt1010102RevFloatRef,
699*35238bceSAndroid Build Coastguard Worker s_signedInt1010102RevIntRef, s_signedInt1010102RevIntRef},
700*35238bceSAndroid Build Coastguard Worker {s_unsignedInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt1010102RevIn), s_unsignedInt1010102RevFloatRef,
701*35238bceSAndroid Build Coastguard Worker s_unsignedInt1010102RevIntRef, s_unsignedInt1010102RevIntRef},
702*35238bceSAndroid Build Coastguard Worker
703*35238bceSAndroid Build Coastguard Worker {s_unsignedInt11f11f10fRevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt11f11f10fRevIn), s_unsignedInt11f11f10fRevFloatRef,
704*35238bceSAndroid Build Coastguard Worker DE_NULL, DE_NULL},
705*35238bceSAndroid Build Coastguard Worker {s_unsignedInt999E5RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt999E5RevIn), s_unsignedInt999E5RevFloatRef, DE_NULL,
706*35238bceSAndroid Build Coastguard Worker DE_NULL},
707*35238bceSAndroid Build Coastguard Worker {s_unsignedInt1688In, DE_LENGTH_OF_ARRAY(s_unsignedInt1688In), s_unsignedInt1688FloatRef, DE_NULL,
708*35238bceSAndroid Build Coastguard Worker s_unsignedInt1688UintRef},
709*35238bceSAndroid Build Coastguard Worker {s_unsignedInt248In, DE_LENGTH_OF_ARRAY(s_unsignedInt248In), s_unsignedInt248FloatRef, DE_NULL,
710*35238bceSAndroid Build Coastguard Worker s_unsignedInt248UintRef},
711*35238bceSAndroid Build Coastguard Worker {s_unsignedInt248RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt248RevIn), s_unsignedInt248RevFloatRef, DE_NULL,
712*35238bceSAndroid Build Coastguard Worker s_unsignedInt248RevUintRef},
713*35238bceSAndroid Build Coastguard Worker {s_signedInt8In, DE_LENGTH_OF_ARRAY(s_signedInt8In), s_signedInt8FloatRef, s_signedInt8IntRef, s_signedInt8UintRef},
714*35238bceSAndroid Build Coastguard Worker {s_signedInt16In, DE_LENGTH_OF_ARRAY(s_signedInt16In), s_signedInt16FloatRef, s_signedInt16IntRef,
715*35238bceSAndroid Build Coastguard Worker s_signedInt16UintRef},
716*35238bceSAndroid Build Coastguard Worker {s_signedInt32In, DE_LENGTH_OF_ARRAY(s_signedInt32In), s_signedInt32FloatRef, s_signedInt32IntRef,
717*35238bceSAndroid Build Coastguard Worker s_signedInt32UintRef},
718*35238bceSAndroid Build Coastguard Worker {s_Int64In, DE_LENGTH_OF_ARRAY(s_Int64In), s_Int64FloatRef, s_Int64IntRef, s_Int64IntRef},
719*35238bceSAndroid Build Coastguard Worker {s_unsignedInt8In, DE_LENGTH_OF_ARRAY(s_unsignedInt8In), s_unsignedInt8FloatRef, s_unsignedInt8IntRef,
720*35238bceSAndroid Build Coastguard Worker s_unsignedInt8UintRef},
721*35238bceSAndroid Build Coastguard Worker {s_unsignedInt16In, DE_LENGTH_OF_ARRAY(s_unsignedInt16In), s_unsignedInt16FloatRef, s_unsignedInt16IntRef,
722*35238bceSAndroid Build Coastguard Worker s_unsignedInt16UintRef},
723*35238bceSAndroid Build Coastguard Worker {s_unsignedInt24In, DE_LENGTH_OF_ARRAY(s_unsignedInt24In), s_unsignedInt24FloatRef, s_unsignedInt24IntRef,
724*35238bceSAndroid Build Coastguard Worker s_unsignedInt24UintRef},
725*35238bceSAndroid Build Coastguard Worker {s_unsignedInt32In, DE_LENGTH_OF_ARRAY(s_unsignedInt32In), s_unsignedInt32FloatRef, s_unsignedInt32IntRef,
726*35238bceSAndroid Build Coastguard Worker s_unsignedInt32UintRef},
727*35238bceSAndroid Build Coastguard Worker {s_Int64In, DE_LENGTH_OF_ARRAY(s_Int64In), s_Int64FloatRef, s_Int64IntRef, s_Int64IntRef},
728*35238bceSAndroid Build Coastguard Worker
729*35238bceSAndroid Build Coastguard Worker {s_halfFloatIn, DE_LENGTH_OF_ARRAY(s_halfFloatIn), s_halfFloatFloatRef, s_halfFloatIntRef, s_halfFloatUintRef},
730*35238bceSAndroid Build Coastguard Worker {s_floatIn, DE_LENGTH_OF_ARRAY(s_floatIn), s_floatFloatRef, s_floatIntRef, s_floatUintRef},
731*35238bceSAndroid Build Coastguard Worker {s_float64In, DE_LENGTH_OF_ARRAY(s_float64In), s_float64FloatRef, s_float64IntRef, s_float64IntRef},
732*35238bceSAndroid Build Coastguard Worker {s_floatUnsignedInt248RevIn, DE_LENGTH_OF_ARRAY(s_floatUnsignedInt248RevIn), s_floatUnsignedInt248RevFloatRef,
733*35238bceSAndroid Build Coastguard Worker DE_NULL, s_floatUnsignedInt248RevUintRef},
734*35238bceSAndroid Build Coastguard Worker
735*35238bceSAndroid Build Coastguard Worker {s_unormShort10In, DE_LENGTH_OF_ARRAY(s_unormShort10In), s_unormShort10FloatRef, s_unormShort10IntRef,
736*35238bceSAndroid Build Coastguard Worker s_unormShort10UintRef},
737*35238bceSAndroid Build Coastguard Worker {s_unormShort12In, DE_LENGTH_OF_ARRAY(s_unormShort12In), s_unormShort12FloatRef, s_unormShort12IntRef,
738*35238bceSAndroid Build Coastguard Worker s_unormShort12UintRef},
739*35238bceSAndroid Build Coastguard Worker
740*35238bceSAndroid Build Coastguard Worker {s_unsignedInt8In, DE_LENGTH_OF_ARRAY(s_unsignedInt8In), s_unsignedInt8FloatRef, s_unsignedInt8IntRef,
741*35238bceSAndroid Build Coastguard Worker s_unsignedInt8UintRef},
742*35238bceSAndroid Build Coastguard Worker {s_unsignedInt16In, DE_LENGTH_OF_ARRAY(s_unsignedInt16In), s_unsignedInt16FloatRef, s_unsignedInt16IntRef,
743*35238bceSAndroid Build Coastguard Worker s_unsignedInt16UintRef},
744*35238bceSAndroid Build Coastguard Worker {s_signedInt8In, DE_LENGTH_OF_ARRAY(s_signedInt8In), s_signedInt8FloatRef, s_signedInt8IntRef, s_signedInt8UintRef},
745*35238bceSAndroid Build Coastguard Worker {s_signedInt16In, DE_LENGTH_OF_ARRAY(s_signedInt16In), s_signedInt16FloatRef, s_signedInt16IntRef,
746*35238bceSAndroid Build Coastguard Worker s_signedInt16UintRef},
747*35238bceSAndroid Build Coastguard Worker {s_unsignedInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt1010102RevIn), s_unsignedInt1010102RevFloatRef,
748*35238bceSAndroid Build Coastguard Worker s_unsignedInt1010102RevIntRef, s_unsignedInt1010102RevIntRef},
749*35238bceSAndroid Build Coastguard Worker {s_unsignedInt1010102RevIn, DE_LENGTH_OF_ARRAY(s_unsignedInt1010102RevIn), s_signedInt1010102RevFloatRef,
750*35238bceSAndroid Build Coastguard Worker s_signedInt1010102RevIntRef, s_signedInt1010102RevIntRef}};
751*35238bceSAndroid Build Coastguard Worker DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_formatData) == TextureFormat::CHANNELTYPE_LAST);
752*35238bceSAndroid Build Coastguard Worker
getBaseFormat(TextureFormat format)753*35238bceSAndroid Build Coastguard Worker TextureFormat getBaseFormat(TextureFormat format)
754*35238bceSAndroid Build Coastguard Worker {
755*35238bceSAndroid Build Coastguard Worker const TextureFormat::ChannelOrder baseOrders[] = {TextureFormat::RGBA, TextureFormat::RGB, TextureFormat::DS};
756*35238bceSAndroid Build Coastguard Worker
757*35238bceSAndroid Build Coastguard Worker for (int baseOrderNdx = 0; baseOrderNdx < DE_LENGTH_OF_ARRAY(baseOrders); baseOrderNdx++)
758*35238bceSAndroid Build Coastguard Worker {
759*35238bceSAndroid Build Coastguard Worker const TextureFormat curBaseFmt(baseOrders[baseOrderNdx], format.type);
760*35238bceSAndroid Build Coastguard Worker if (isValid(curBaseFmt))
761*35238bceSAndroid Build Coastguard Worker return curBaseFmt;
762*35238bceSAndroid Build Coastguard Worker }
763*35238bceSAndroid Build Coastguard Worker
764*35238bceSAndroid Build Coastguard Worker return format;
765*35238bceSAndroid Build Coastguard Worker }
766*35238bceSAndroid Build Coastguard Worker
getInputAccess(TextureFormat format)767*35238bceSAndroid Build Coastguard Worker ConstPixelBufferAccess getInputAccess(TextureFormat format)
768*35238bceSAndroid Build Coastguard Worker {
769*35238bceSAndroid Build Coastguard Worker const TextureFormat inputFormat = getBaseFormat(format);
770*35238bceSAndroid Build Coastguard Worker const int inputPixelSize = getPixelSize(inputFormat);
771*35238bceSAndroid Build Coastguard Worker const int numPixels = s_formatData[format.type].inputSize / inputPixelSize;
772*35238bceSAndroid Build Coastguard Worker
773*35238bceSAndroid Build Coastguard Worker DE_ASSERT(numPixels == 4);
774*35238bceSAndroid Build Coastguard Worker DE_ASSERT(numPixels * inputPixelSize == s_formatData[format.type].inputSize);
775*35238bceSAndroid Build Coastguard Worker
776*35238bceSAndroid Build Coastguard Worker return ConstPixelBufferAccess(format, IVec3(numPixels, 1, 1), IVec3(inputPixelSize, 0, 0),
777*35238bceSAndroid Build Coastguard Worker s_formatData[format.type].input);
778*35238bceSAndroid Build Coastguard Worker }
779*35238bceSAndroid Build Coastguard Worker
780*35238bceSAndroid Build Coastguard Worker template <typename T>
781*35238bceSAndroid Build Coastguard Worker const uint32_t *getRawReference(TextureFormat format);
782*35238bceSAndroid Build Coastguard Worker
783*35238bceSAndroid Build Coastguard Worker template <>
getRawReference(TextureFormat format)784*35238bceSAndroid Build Coastguard Worker const uint32_t *getRawReference<float>(TextureFormat format)
785*35238bceSAndroid Build Coastguard Worker {
786*35238bceSAndroid Build Coastguard Worker return s_formatData[format.type].floatRef;
787*35238bceSAndroid Build Coastguard Worker }
788*35238bceSAndroid Build Coastguard Worker
789*35238bceSAndroid Build Coastguard Worker template <>
getRawReference(TextureFormat format)790*35238bceSAndroid Build Coastguard Worker const uint32_t *getRawReference<int32_t>(TextureFormat format)
791*35238bceSAndroid Build Coastguard Worker {
792*35238bceSAndroid Build Coastguard Worker return s_formatData[format.type].intRef;
793*35238bceSAndroid Build Coastguard Worker }
794*35238bceSAndroid Build Coastguard Worker
795*35238bceSAndroid Build Coastguard Worker template <>
getRawReference(TextureFormat format)796*35238bceSAndroid Build Coastguard Worker const uint32_t *getRawReference<uint32_t>(TextureFormat format)
797*35238bceSAndroid Build Coastguard Worker {
798*35238bceSAndroid Build Coastguard Worker return s_formatData[format.type].uintRef;
799*35238bceSAndroid Build Coastguard Worker }
800*35238bceSAndroid Build Coastguard Worker
801*35238bceSAndroid Build Coastguard Worker template <typename T>
getReferenceValues(TextureFormat storageFormat,TextureFormat viewFormat,vector<Vector<T,4>> & dst)802*35238bceSAndroid Build Coastguard Worker void getReferenceValues(TextureFormat storageFormat, TextureFormat viewFormat, vector<Vector<T, 4>> &dst)
803*35238bceSAndroid Build Coastguard Worker {
804*35238bceSAndroid Build Coastguard Worker const int numPixels = getInputAccess(storageFormat).getWidth();
805*35238bceSAndroid Build Coastguard Worker const uint32_t *const rawValues = getRawReference<T>(storageFormat);
806*35238bceSAndroid Build Coastguard Worker const tcu::TextureSwizzle &swizzle = tcu::getChannelReadSwizzle(viewFormat.order);
807*35238bceSAndroid Build Coastguard Worker
808*35238bceSAndroid Build Coastguard Worker dst.resize(numPixels);
809*35238bceSAndroid Build Coastguard Worker
810*35238bceSAndroid Build Coastguard Worker for (int pixelNdx = 0; pixelNdx < numPixels; pixelNdx++)
811*35238bceSAndroid Build Coastguard Worker {
812*35238bceSAndroid Build Coastguard Worker const uint32_t *srcPixPtr = rawValues + pixelNdx * 4;
813*35238bceSAndroid Build Coastguard Worker T *dstPixPtr = (T *)&dst[pixelNdx];
814*35238bceSAndroid Build Coastguard Worker
815*35238bceSAndroid Build Coastguard Worker for (int c = 0; c < 4; c++)
816*35238bceSAndroid Build Coastguard Worker {
817*35238bceSAndroid Build Coastguard Worker switch (swizzle.components[c])
818*35238bceSAndroid Build Coastguard Worker {
819*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_0:
820*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_1:
821*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_2:
822*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_3:
823*35238bceSAndroid Build Coastguard Worker deMemcpy(dstPixPtr + c, srcPixPtr + (int)swizzle.components[c], sizeof(uint32_t));
824*35238bceSAndroid Build Coastguard Worker break;
825*35238bceSAndroid Build Coastguard Worker
826*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_ZERO:
827*35238bceSAndroid Build Coastguard Worker dstPixPtr[c] = T(0);
828*35238bceSAndroid Build Coastguard Worker break;
829*35238bceSAndroid Build Coastguard Worker
830*35238bceSAndroid Build Coastguard Worker case tcu::TextureSwizzle::CHANNEL_ONE:
831*35238bceSAndroid Build Coastguard Worker dstPixPtr[c] = T(1);
832*35238bceSAndroid Build Coastguard Worker break;
833*35238bceSAndroid Build Coastguard Worker
834*35238bceSAndroid Build Coastguard Worker default:
835*35238bceSAndroid Build Coastguard Worker DE_FATAL("Unknown swizzle");
836*35238bceSAndroid Build Coastguard Worker }
837*35238bceSAndroid Build Coastguard Worker }
838*35238bceSAndroid Build Coastguard Worker }
839*35238bceSAndroid Build Coastguard Worker }
840*35238bceSAndroid Build Coastguard Worker
841*35238bceSAndroid Build Coastguard Worker template <typename T>
componentEqual(T a,T b)842*35238bceSAndroid Build Coastguard Worker bool componentEqual(T a, T b)
843*35238bceSAndroid Build Coastguard Worker {
844*35238bceSAndroid Build Coastguard Worker return a == b;
845*35238bceSAndroid Build Coastguard Worker }
846*35238bceSAndroid Build Coastguard Worker
847*35238bceSAndroid Build Coastguard Worker template <>
componentEqual(float a,float b)848*35238bceSAndroid Build Coastguard Worker bool componentEqual<float>(float a, float b)
849*35238bceSAndroid Build Coastguard Worker {
850*35238bceSAndroid Build Coastguard Worker return (a == b) || (deFloatIsNaN(a) && deFloatIsNaN(b));
851*35238bceSAndroid Build Coastguard Worker }
852*35238bceSAndroid Build Coastguard Worker
853*35238bceSAndroid Build Coastguard Worker template <typename T, int Size>
allComponentsEqual(const Vector<T,Size> & a,const Vector<T,Size> & b)854*35238bceSAndroid Build Coastguard Worker bool allComponentsEqual(const Vector<T, Size> &a, const Vector<T, Size> &b)
855*35238bceSAndroid Build Coastguard Worker {
856*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < Size; ndx++)
857*35238bceSAndroid Build Coastguard Worker {
858*35238bceSAndroid Build Coastguard Worker if (!componentEqual(a[ndx], b[ndx]))
859*35238bceSAndroid Build Coastguard Worker return false;
860*35238bceSAndroid Build Coastguard Worker }
861*35238bceSAndroid Build Coastguard Worker
862*35238bceSAndroid Build Coastguard Worker return true;
863*35238bceSAndroid Build Coastguard Worker }
864*35238bceSAndroid Build Coastguard Worker
865*35238bceSAndroid Build Coastguard Worker template <typename T>
copyPixels(const ConstPixelBufferAccess & src,const PixelBufferAccess & dst)866*35238bceSAndroid Build Coastguard Worker void copyPixels(const ConstPixelBufferAccess &src, const PixelBufferAccess &dst)
867*35238bceSAndroid Build Coastguard Worker {
868*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < src.getWidth(); ndx++)
869*35238bceSAndroid Build Coastguard Worker dst.setPixel(src.getPixelT<T>(ndx, 0, 0), ndx, 0, 0);
870*35238bceSAndroid Build Coastguard Worker }
871*35238bceSAndroid Build Coastguard Worker
copyGetSetDepth(const ConstPixelBufferAccess & src,const PixelBufferAccess & dst)872*35238bceSAndroid Build Coastguard Worker void copyGetSetDepth(const ConstPixelBufferAccess &src, const PixelBufferAccess &dst)
873*35238bceSAndroid Build Coastguard Worker {
874*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < src.getWidth(); ndx++)
875*35238bceSAndroid Build Coastguard Worker dst.setPixDepth(src.getPixDepth(ndx, 0, 0), ndx, 0, 0);
876*35238bceSAndroid Build Coastguard Worker }
877*35238bceSAndroid Build Coastguard Worker
copyGetSetStencil(const ConstPixelBufferAccess & src,const PixelBufferAccess & dst)878*35238bceSAndroid Build Coastguard Worker void copyGetSetStencil(const ConstPixelBufferAccess &src, const PixelBufferAccess &dst)
879*35238bceSAndroid Build Coastguard Worker {
880*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < src.getWidth(); ndx++)
881*35238bceSAndroid Build Coastguard Worker dst.setPixStencil(src.getPixStencil(ndx, 0, 0), ndx, 0, 0);
882*35238bceSAndroid Build Coastguard Worker }
883*35238bceSAndroid Build Coastguard Worker
copyPixels(const ConstPixelBufferAccess & src,const PixelBufferAccess & dst)884*35238bceSAndroid Build Coastguard Worker void copyPixels(const ConstPixelBufferAccess &src, const PixelBufferAccess &dst)
885*35238bceSAndroid Build Coastguard Worker {
886*35238bceSAndroid Build Coastguard Worker switch (getTextureChannelClass(dst.getFormat().type))
887*35238bceSAndroid Build Coastguard Worker {
888*35238bceSAndroid Build Coastguard Worker case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
889*35238bceSAndroid Build Coastguard Worker case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
890*35238bceSAndroid Build Coastguard Worker case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
891*35238bceSAndroid Build Coastguard Worker copyPixels<float>(src, dst);
892*35238bceSAndroid Build Coastguard Worker break;
893*35238bceSAndroid Build Coastguard Worker
894*35238bceSAndroid Build Coastguard Worker case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
895*35238bceSAndroid Build Coastguard Worker copyPixels<int32_t>(src, dst);
896*35238bceSAndroid Build Coastguard Worker break;
897*35238bceSAndroid Build Coastguard Worker
898*35238bceSAndroid Build Coastguard Worker case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
899*35238bceSAndroid Build Coastguard Worker copyPixels<uint32_t>(src, dst);
900*35238bceSAndroid Build Coastguard Worker break;
901*35238bceSAndroid Build Coastguard Worker
902*35238bceSAndroid Build Coastguard Worker default:
903*35238bceSAndroid Build Coastguard Worker DE_FATAL("Unknown channel class");
904*35238bceSAndroid Build Coastguard Worker }
905*35238bceSAndroid Build Coastguard Worker }
906*35238bceSAndroid Build Coastguard Worker
getTextureAccessTypeDescription(TextureAccessType type)907*35238bceSAndroid Build Coastguard Worker const char *getTextureAccessTypeDescription(TextureAccessType type)
908*35238bceSAndroid Build Coastguard Worker {
909*35238bceSAndroid Build Coastguard Worker static const char *s_desc[] = {"floating-point", "signed integer", "unsigned integer"};
910*35238bceSAndroid Build Coastguard Worker return de::getSizedArrayElement<tcu::TEXTUREACCESSTYPE_LAST>(s_desc, type);
911*35238bceSAndroid Build Coastguard Worker }
912*35238bceSAndroid Build Coastguard Worker
913*35238bceSAndroid Build Coastguard Worker template <typename T>
914*35238bceSAndroid Build Coastguard Worker TextureAccessType getTextureAccessType(void);
915*35238bceSAndroid Build Coastguard Worker
916*35238bceSAndroid Build Coastguard Worker template <>
getTextureAccessType(void)917*35238bceSAndroid Build Coastguard Worker TextureAccessType getTextureAccessType<float>(void)
918*35238bceSAndroid Build Coastguard Worker {
919*35238bceSAndroid Build Coastguard Worker return tcu::TEXTUREACCESSTYPE_FLOAT;
920*35238bceSAndroid Build Coastguard Worker }
921*35238bceSAndroid Build Coastguard Worker
922*35238bceSAndroid Build Coastguard Worker template <>
getTextureAccessType(void)923*35238bceSAndroid Build Coastguard Worker TextureAccessType getTextureAccessType<int32_t>(void)
924*35238bceSAndroid Build Coastguard Worker {
925*35238bceSAndroid Build Coastguard Worker return tcu::TEXTUREACCESSTYPE_SIGNED_INT;
926*35238bceSAndroid Build Coastguard Worker }
927*35238bceSAndroid Build Coastguard Worker
928*35238bceSAndroid Build Coastguard Worker template <>
getTextureAccessType(void)929*35238bceSAndroid Build Coastguard Worker TextureAccessType getTextureAccessType<uint32_t>(void)
930*35238bceSAndroid Build Coastguard Worker {
931*35238bceSAndroid Build Coastguard Worker return tcu::TEXTUREACCESSTYPE_UNSIGNED_INT;
932*35238bceSAndroid Build Coastguard Worker }
933*35238bceSAndroid Build Coastguard Worker
getCaseName(TextureFormat format)934*35238bceSAndroid Build Coastguard Worker static std::string getCaseName(TextureFormat format)
935*35238bceSAndroid Build Coastguard Worker {
936*35238bceSAndroid Build Coastguard Worker std::ostringstream str;
937*35238bceSAndroid Build Coastguard Worker
938*35238bceSAndroid Build Coastguard Worker str << format.type << "_" << format.order;
939*35238bceSAndroid Build Coastguard Worker
940*35238bceSAndroid Build Coastguard Worker return de::toLower(str.str());
941*35238bceSAndroid Build Coastguard Worker }
942*35238bceSAndroid Build Coastguard Worker
943*35238bceSAndroid Build Coastguard Worker class TextureFormatCase : public tcu::TestCase
944*35238bceSAndroid Build Coastguard Worker {
945*35238bceSAndroid Build Coastguard Worker public:
TextureFormatCase(tcu::TestContext & testCtx,TextureFormat format)946*35238bceSAndroid Build Coastguard Worker TextureFormatCase(tcu::TestContext &testCtx, TextureFormat format)
947*35238bceSAndroid Build Coastguard Worker : tcu::TestCase(testCtx, getCaseName(format).c_str(), "")
948*35238bceSAndroid Build Coastguard Worker , m_format(format)
949*35238bceSAndroid Build Coastguard Worker {
950*35238bceSAndroid Build Coastguard Worker DE_ASSERT(isValid(format));
951*35238bceSAndroid Build Coastguard Worker }
952*35238bceSAndroid Build Coastguard Worker
953*35238bceSAndroid Build Coastguard Worker protected:
954*35238bceSAndroid Build Coastguard Worker template <typename T>
verifyRead(const ConstPixelBufferAccess & src)955*35238bceSAndroid Build Coastguard Worker void verifyRead(const ConstPixelBufferAccess &src)
956*35238bceSAndroid Build Coastguard Worker {
957*35238bceSAndroid Build Coastguard Worker const int numPixels = src.getWidth();
958*35238bceSAndroid Build Coastguard Worker vector<Vector<T, 4>> res(numPixels);
959*35238bceSAndroid Build Coastguard Worker vector<Vector<T, 4>> ref;
960*35238bceSAndroid Build Coastguard Worker
961*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Verifying "
962*35238bceSAndroid Build Coastguard Worker << getTextureAccessTypeDescription(getTextureAccessType<T>()) << " access"
963*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
964*35238bceSAndroid Build Coastguard Worker
965*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < numPixels; ndx++)
966*35238bceSAndroid Build Coastguard Worker res[ndx] = src.getPixelT<T>(ndx, 0, 0);
967*35238bceSAndroid Build Coastguard Worker
968*35238bceSAndroid Build Coastguard Worker // \note m_format != src.getFormat() for DS formats, and we specifically need to
969*35238bceSAndroid Build Coastguard Worker // use the combined format as storage format to get right reference values.
970*35238bceSAndroid Build Coastguard Worker getReferenceValues<T>(m_format, src.getFormat(), ref);
971*35238bceSAndroid Build Coastguard Worker
972*35238bceSAndroid Build Coastguard Worker for (int pixelNdx = 0; pixelNdx < numPixels; pixelNdx++)
973*35238bceSAndroid Build Coastguard Worker {
974*35238bceSAndroid Build Coastguard Worker if (!allComponentsEqual(res[pixelNdx], ref[pixelNdx]))
975*35238bceSAndroid Build Coastguard Worker {
976*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "ERROR: at pixel " << pixelNdx << ": expected "
977*35238bceSAndroid Build Coastguard Worker << ref[pixelNdx] << ", got " << res[pixelNdx] << TestLog::EndMessage;
978*35238bceSAndroid Build Coastguard Worker
979*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Comparison failed");
980*35238bceSAndroid Build Coastguard Worker }
981*35238bceSAndroid Build Coastguard Worker }
982*35238bceSAndroid Build Coastguard Worker }
983*35238bceSAndroid Build Coastguard Worker
verifyRead(const ConstPixelBufferAccess & src)984*35238bceSAndroid Build Coastguard Worker void verifyRead(const ConstPixelBufferAccess &src)
985*35238bceSAndroid Build Coastguard Worker {
986*35238bceSAndroid Build Coastguard Worker // \todo [2016-08-04 pyry] Overflow in float->int conversion is not defined and
987*35238bceSAndroid Build Coastguard Worker // produces different results depending on arch.
988*35238bceSAndroid Build Coastguard Worker const bool isFloat32Or64 =
989*35238bceSAndroid Build Coastguard Worker src.getFormat().type == tcu::TextureFormat::FLOAT || src.getFormat().type == tcu::TextureFormat::FLOAT64;
990*35238bceSAndroid Build Coastguard Worker
991*35238bceSAndroid Build Coastguard Worker if (isAccessValid(src.getFormat(), tcu::TEXTUREACCESSTYPE_FLOAT))
992*35238bceSAndroid Build Coastguard Worker verifyRead<float>(src);
993*35238bceSAndroid Build Coastguard Worker
994*35238bceSAndroid Build Coastguard Worker if (isAccessValid(src.getFormat(), tcu::TEXTUREACCESSTYPE_UNSIGNED_INT) && !isFloat32Or64)
995*35238bceSAndroid Build Coastguard Worker verifyRead<uint32_t>(src);
996*35238bceSAndroid Build Coastguard Worker
997*35238bceSAndroid Build Coastguard Worker if (isAccessValid(src.getFormat(), tcu::TEXTUREACCESSTYPE_SIGNED_INT) && !isFloat32Or64)
998*35238bceSAndroid Build Coastguard Worker verifyRead<int32_t>(src);
999*35238bceSAndroid Build Coastguard Worker }
1000*35238bceSAndroid Build Coastguard Worker
verifyGetPixDepth(const ConstPixelBufferAccess & refAccess,const ConstPixelBufferAccess & combinedAccess)1001*35238bceSAndroid Build Coastguard Worker void verifyGetPixDepth(const ConstPixelBufferAccess &refAccess, const ConstPixelBufferAccess &combinedAccess)
1002*35238bceSAndroid Build Coastguard Worker {
1003*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Verifying getPixDepth()" << TestLog::EndMessage;
1004*35238bceSAndroid Build Coastguard Worker
1005*35238bceSAndroid Build Coastguard Worker for (int pixelNdx = 0; pixelNdx < refAccess.getWidth(); pixelNdx++)
1006*35238bceSAndroid Build Coastguard Worker {
1007*35238bceSAndroid Build Coastguard Worker const float ref = refAccess.getPixel(pixelNdx, 0, 0).x();
1008*35238bceSAndroid Build Coastguard Worker const float res = combinedAccess.getPixDepth(pixelNdx, 0, 0);
1009*35238bceSAndroid Build Coastguard Worker
1010*35238bceSAndroid Build Coastguard Worker if (!componentEqual(res, ref))
1011*35238bceSAndroid Build Coastguard Worker {
1012*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "ERROR: at pixel " << pixelNdx << ": expected " << ref
1013*35238bceSAndroid Build Coastguard Worker << ", got " << res << TestLog::EndMessage;
1014*35238bceSAndroid Build Coastguard Worker
1015*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Comparison failed");
1016*35238bceSAndroid Build Coastguard Worker }
1017*35238bceSAndroid Build Coastguard Worker }
1018*35238bceSAndroid Build Coastguard Worker }
1019*35238bceSAndroid Build Coastguard Worker
verifyGetPixStencil(const ConstPixelBufferAccess & refAccess,const ConstPixelBufferAccess & combinedAccess)1020*35238bceSAndroid Build Coastguard Worker void verifyGetPixStencil(const ConstPixelBufferAccess &refAccess, const ConstPixelBufferAccess &combinedAccess)
1021*35238bceSAndroid Build Coastguard Worker {
1022*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Verifying getPixStencil()" << TestLog::EndMessage;
1023*35238bceSAndroid Build Coastguard Worker
1024*35238bceSAndroid Build Coastguard Worker for (int pixelNdx = 0; pixelNdx < refAccess.getWidth(); pixelNdx++)
1025*35238bceSAndroid Build Coastguard Worker {
1026*35238bceSAndroid Build Coastguard Worker const int ref = refAccess.getPixelInt(pixelNdx, 0, 0).x();
1027*35238bceSAndroid Build Coastguard Worker const int res = combinedAccess.getPixStencil(pixelNdx, 0, 0);
1028*35238bceSAndroid Build Coastguard Worker
1029*35238bceSAndroid Build Coastguard Worker if (!componentEqual(res, ref))
1030*35238bceSAndroid Build Coastguard Worker {
1031*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "ERROR: at pixel " << pixelNdx << ": expected " << ref
1032*35238bceSAndroid Build Coastguard Worker << ", got " << res << TestLog::EndMessage;
1033*35238bceSAndroid Build Coastguard Worker
1034*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Comparison failed");
1035*35238bceSAndroid Build Coastguard Worker }
1036*35238bceSAndroid Build Coastguard Worker }
1037*35238bceSAndroid Build Coastguard Worker }
1038*35238bceSAndroid Build Coastguard Worker
verifyInfoQueries(void)1039*35238bceSAndroid Build Coastguard Worker void verifyInfoQueries(void)
1040*35238bceSAndroid Build Coastguard Worker {
1041*35238bceSAndroid Build Coastguard Worker const tcu::TextureChannelClass chnClass = tcu::getTextureChannelClass(m_format.type);
1042*35238bceSAndroid Build Coastguard Worker const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(m_format);
1043*35238bceSAndroid Build Coastguard Worker
1044*35238bceSAndroid Build Coastguard Worker if (tcu::isCombinedDepthStencilType(m_format.type))
1045*35238bceSAndroid Build Coastguard Worker TCU_CHECK(chnClass == tcu::TEXTURECHANNELCLASS_LAST);
1046*35238bceSAndroid Build Coastguard Worker else
1047*35238bceSAndroid Build Coastguard Worker TCU_CHECK(de::inBounds(chnClass, (tcu::TextureChannelClass)0, tcu::TEXTURECHANNELCLASS_LAST));
1048*35238bceSAndroid Build Coastguard Worker
1049*35238bceSAndroid Build Coastguard Worker DE_UNREF(fmtInfo);
1050*35238bceSAndroid Build Coastguard Worker }
1051*35238bceSAndroid Build Coastguard Worker
1052*35238bceSAndroid Build Coastguard Worker const TextureFormat m_format;
1053*35238bceSAndroid Build Coastguard Worker };
1054*35238bceSAndroid Build Coastguard Worker
1055*35238bceSAndroid Build Coastguard Worker class ColorFormatCase : public TextureFormatCase
1056*35238bceSAndroid Build Coastguard Worker {
1057*35238bceSAndroid Build Coastguard Worker public:
ColorFormatCase(tcu::TestContext & testCtx,TextureFormat format)1058*35238bceSAndroid Build Coastguard Worker ColorFormatCase(tcu::TestContext &testCtx, TextureFormat format) : TextureFormatCase(testCtx, format)
1059*35238bceSAndroid Build Coastguard Worker {
1060*35238bceSAndroid Build Coastguard Worker DE_ASSERT(format.order != TextureFormat::D && format.order != TextureFormat::S &&
1061*35238bceSAndroid Build Coastguard Worker format.order != TextureFormat::DS);
1062*35238bceSAndroid Build Coastguard Worker }
1063*35238bceSAndroid Build Coastguard Worker
iterate(void)1064*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
1065*35238bceSAndroid Build Coastguard Worker {
1066*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputAccess = getInputAccess(m_format);
1067*35238bceSAndroid Build Coastguard Worker vector<uint8_t> tmpMem(getPixelSize(inputAccess.getFormat()) * inputAccess.getWidth());
1068*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpAccess(inputAccess.getFormat(), inputAccess.getWidth(), 1, 1, &tmpMem[0]);
1069*35238bceSAndroid Build Coastguard Worker
1070*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
1071*35238bceSAndroid Build Coastguard Worker
1072*35238bceSAndroid Build Coastguard Worker verifyInfoQueries();
1073*35238bceSAndroid Build Coastguard Worker
1074*35238bceSAndroid Build Coastguard Worker verifyRead(inputAccess);
1075*35238bceSAndroid Build Coastguard Worker
1076*35238bceSAndroid Build Coastguard Worker // \todo [2015-10-12 pyry] Handle lossy conversion with *NORM_INT32
1077*35238bceSAndroid Build Coastguard Worker if (m_format.type != TextureFormat::UNORM_INT32 && m_format.type != TextureFormat::SNORM_INT32)
1078*35238bceSAndroid Build Coastguard Worker {
1079*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying with getPixel() -> setPixel()" << TestLog::EndMessage;
1080*35238bceSAndroid Build Coastguard Worker copyPixels(inputAccess, tmpAccess);
1081*35238bceSAndroid Build Coastguard Worker verifyRead(tmpAccess);
1082*35238bceSAndroid Build Coastguard Worker }
1083*35238bceSAndroid Build Coastguard Worker
1084*35238bceSAndroid Build Coastguard Worker return STOP;
1085*35238bceSAndroid Build Coastguard Worker }
1086*35238bceSAndroid Build Coastguard Worker };
1087*35238bceSAndroid Build Coastguard Worker
1088*35238bceSAndroid Build Coastguard Worker class DepthFormatCase : public TextureFormatCase
1089*35238bceSAndroid Build Coastguard Worker {
1090*35238bceSAndroid Build Coastguard Worker public:
DepthFormatCase(tcu::TestContext & testCtx,TextureFormat format)1091*35238bceSAndroid Build Coastguard Worker DepthFormatCase(tcu::TestContext &testCtx, TextureFormat format) : TextureFormatCase(testCtx, format)
1092*35238bceSAndroid Build Coastguard Worker {
1093*35238bceSAndroid Build Coastguard Worker DE_ASSERT(format.order == TextureFormat::D);
1094*35238bceSAndroid Build Coastguard Worker }
1095*35238bceSAndroid Build Coastguard Worker
iterate(void)1096*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
1097*35238bceSAndroid Build Coastguard Worker {
1098*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputAccess = getInputAccess(m_format);
1099*35238bceSAndroid Build Coastguard Worker vector<uint8_t> tmpMem(getPixelSize(inputAccess.getFormat()) * inputAccess.getWidth());
1100*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpAccess(inputAccess.getFormat(), inputAccess.getWidth(), 1, 1, &tmpMem[0]);
1101*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputDepthAccess =
1102*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(inputAccess, tcu::Sampler::MODE_DEPTH);
1103*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpDepthAccess = getEffectiveDepthStencilAccess(tmpAccess, tcu::Sampler::MODE_DEPTH);
1104*35238bceSAndroid Build Coastguard Worker
1105*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
1106*35238bceSAndroid Build Coastguard Worker
1107*35238bceSAndroid Build Coastguard Worker verifyInfoQueries();
1108*35238bceSAndroid Build Coastguard Worker
1109*35238bceSAndroid Build Coastguard Worker verifyRead(inputDepthAccess);
1110*35238bceSAndroid Build Coastguard Worker
1111*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying with getPixel() -> setPixel()" << TestLog::EndMessage;
1112*35238bceSAndroid Build Coastguard Worker copyPixels(inputDepthAccess, tmpDepthAccess);
1113*35238bceSAndroid Build Coastguard Worker verifyRead(tmpDepthAccess);
1114*35238bceSAndroid Build Coastguard Worker
1115*35238bceSAndroid Build Coastguard Worker verifyGetPixDepth(inputDepthAccess, inputAccess);
1116*35238bceSAndroid Build Coastguard Worker
1117*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying both depth getPixDepth() -> setPixDepth()"
1118*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1119*35238bceSAndroid Build Coastguard Worker tcu::clear(tmpDepthAccess, tcu::Vec4(0.0f));
1120*35238bceSAndroid Build Coastguard Worker copyGetSetDepth(inputAccess, tmpAccess);
1121*35238bceSAndroid Build Coastguard Worker verifyGetPixDepth(tmpDepthAccess, tmpAccess);
1122*35238bceSAndroid Build Coastguard Worker
1123*35238bceSAndroid Build Coastguard Worker return STOP;
1124*35238bceSAndroid Build Coastguard Worker }
1125*35238bceSAndroid Build Coastguard Worker };
1126*35238bceSAndroid Build Coastguard Worker
1127*35238bceSAndroid Build Coastguard Worker class StencilFormatCase : public TextureFormatCase
1128*35238bceSAndroid Build Coastguard Worker {
1129*35238bceSAndroid Build Coastguard Worker public:
StencilFormatCase(tcu::TestContext & testCtx,TextureFormat format)1130*35238bceSAndroid Build Coastguard Worker StencilFormatCase(tcu::TestContext &testCtx, TextureFormat format) : TextureFormatCase(testCtx, format)
1131*35238bceSAndroid Build Coastguard Worker {
1132*35238bceSAndroid Build Coastguard Worker DE_ASSERT(format.order == TextureFormat::S);
1133*35238bceSAndroid Build Coastguard Worker }
1134*35238bceSAndroid Build Coastguard Worker
iterate(void)1135*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
1136*35238bceSAndroid Build Coastguard Worker {
1137*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputAccess = getInputAccess(m_format);
1138*35238bceSAndroid Build Coastguard Worker vector<uint8_t> tmpMem(getPixelSize(inputAccess.getFormat()) * inputAccess.getWidth());
1139*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpAccess(inputAccess.getFormat(), inputAccess.getWidth(), 1, 1, &tmpMem[0]);
1140*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputStencilAccess =
1141*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(inputAccess, tcu::Sampler::MODE_STENCIL);
1142*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpStencilAccess =
1143*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(tmpAccess, tcu::Sampler::MODE_STENCIL);
1144*35238bceSAndroid Build Coastguard Worker
1145*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
1146*35238bceSAndroid Build Coastguard Worker
1147*35238bceSAndroid Build Coastguard Worker verifyInfoQueries();
1148*35238bceSAndroid Build Coastguard Worker
1149*35238bceSAndroid Build Coastguard Worker verifyRead(inputStencilAccess);
1150*35238bceSAndroid Build Coastguard Worker
1151*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying with getPixel() -> setPixel()" << TestLog::EndMessage;
1152*35238bceSAndroid Build Coastguard Worker copyPixels(inputStencilAccess, tmpStencilAccess);
1153*35238bceSAndroid Build Coastguard Worker verifyRead(tmpStencilAccess);
1154*35238bceSAndroid Build Coastguard Worker
1155*35238bceSAndroid Build Coastguard Worker verifyGetPixStencil(inputStencilAccess, inputAccess);
1156*35238bceSAndroid Build Coastguard Worker
1157*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying both depth getPixStencil() -> setPixStencil()"
1158*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1159*35238bceSAndroid Build Coastguard Worker tcu::clear(tmpStencilAccess, tcu::IVec4(0));
1160*35238bceSAndroid Build Coastguard Worker copyGetSetStencil(inputAccess, tmpAccess);
1161*35238bceSAndroid Build Coastguard Worker verifyGetPixStencil(tmpStencilAccess, tmpAccess);
1162*35238bceSAndroid Build Coastguard Worker
1163*35238bceSAndroid Build Coastguard Worker return STOP;
1164*35238bceSAndroid Build Coastguard Worker }
1165*35238bceSAndroid Build Coastguard Worker };
1166*35238bceSAndroid Build Coastguard Worker
1167*35238bceSAndroid Build Coastguard Worker class DepthStencilFormatCase : public TextureFormatCase
1168*35238bceSAndroid Build Coastguard Worker {
1169*35238bceSAndroid Build Coastguard Worker public:
DepthStencilFormatCase(tcu::TestContext & testCtx,TextureFormat format)1170*35238bceSAndroid Build Coastguard Worker DepthStencilFormatCase(tcu::TestContext &testCtx, TextureFormat format) : TextureFormatCase(testCtx, format)
1171*35238bceSAndroid Build Coastguard Worker {
1172*35238bceSAndroid Build Coastguard Worker DE_ASSERT(format.order == TextureFormat::DS);
1173*35238bceSAndroid Build Coastguard Worker }
1174*35238bceSAndroid Build Coastguard Worker
iterate(void)1175*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
1176*35238bceSAndroid Build Coastguard Worker {
1177*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputAccess = getInputAccess(m_format);
1178*35238bceSAndroid Build Coastguard Worker vector<uint8_t> tmpMem(getPixelSize(inputAccess.getFormat()) * inputAccess.getWidth());
1179*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpAccess(inputAccess.getFormat(), inputAccess.getWidth(), 1, 1, &tmpMem[0]);
1180*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputDepthAccess =
1181*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(inputAccess, tcu::Sampler::MODE_DEPTH);
1182*35238bceSAndroid Build Coastguard Worker const ConstPixelBufferAccess inputStencilAccess =
1183*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(inputAccess, tcu::Sampler::MODE_STENCIL);
1184*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpDepthAccess = getEffectiveDepthStencilAccess(tmpAccess, tcu::Sampler::MODE_DEPTH);
1185*35238bceSAndroid Build Coastguard Worker const PixelBufferAccess tmpStencilAccess =
1186*35238bceSAndroid Build Coastguard Worker getEffectiveDepthStencilAccess(tmpAccess, tcu::Sampler::MODE_STENCIL);
1187*35238bceSAndroid Build Coastguard Worker
1188*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
1189*35238bceSAndroid Build Coastguard Worker
1190*35238bceSAndroid Build Coastguard Worker verifyInfoQueries();
1191*35238bceSAndroid Build Coastguard Worker
1192*35238bceSAndroid Build Coastguard Worker verifyRead(inputDepthAccess);
1193*35238bceSAndroid Build Coastguard Worker verifyRead(inputStencilAccess);
1194*35238bceSAndroid Build Coastguard Worker
1195*35238bceSAndroid Build Coastguard Worker verifyGetPixDepth(inputDepthAccess, inputAccess);
1196*35238bceSAndroid Build Coastguard Worker verifyGetPixStencil(inputStencilAccess, inputAccess);
1197*35238bceSAndroid Build Coastguard Worker
1198*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message << "Copying both depth and stencil with getPixel() -> setPixel()"
1199*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1200*35238bceSAndroid Build Coastguard Worker copyPixels(inputDepthAccess, tmpDepthAccess);
1201*35238bceSAndroid Build Coastguard Worker copyPixels(inputStencilAccess, tmpStencilAccess);
1202*35238bceSAndroid Build Coastguard Worker verifyRead(tmpDepthAccess);
1203*35238bceSAndroid Build Coastguard Worker verifyRead(tmpStencilAccess);
1204*35238bceSAndroid Build Coastguard Worker
1205*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message
1206*35238bceSAndroid Build Coastguard Worker << "Copying both depth and stencil with getPix{Depth,Stencil}() -> setPix{Depth,Stencil}()"
1207*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1208*35238bceSAndroid Build Coastguard Worker copyGetSetDepth(inputDepthAccess, tmpDepthAccess);
1209*35238bceSAndroid Build Coastguard Worker copyGetSetStencil(inputStencilAccess, tmpStencilAccess);
1210*35238bceSAndroid Build Coastguard Worker verifyRead(tmpDepthAccess);
1211*35238bceSAndroid Build Coastguard Worker verifyRead(tmpStencilAccess);
1212*35238bceSAndroid Build Coastguard Worker
1213*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message
1214*35238bceSAndroid Build Coastguard Worker << "Verifying that clearing depth component with clearDepth() doesn't affect stencil"
1215*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1216*35238bceSAndroid Build Coastguard Worker tcu::copy(tmpAccess, inputAccess);
1217*35238bceSAndroid Build Coastguard Worker tcu::clearDepth(tmpAccess, 0.0f);
1218*35238bceSAndroid Build Coastguard Worker verifyRead(tmpStencilAccess);
1219*35238bceSAndroid Build Coastguard Worker
1220*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message
1221*35238bceSAndroid Build Coastguard Worker << "Verifying that clearing stencil component with clearStencil() doesn't affect depth"
1222*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1223*35238bceSAndroid Build Coastguard Worker tcu::copy(tmpAccess, inputAccess);
1224*35238bceSAndroid Build Coastguard Worker tcu::clearStencil(tmpAccess, 0);
1225*35238bceSAndroid Build Coastguard Worker verifyRead(tmpDepthAccess);
1226*35238bceSAndroid Build Coastguard Worker
1227*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message
1228*35238bceSAndroid Build Coastguard Worker << "Verifying that clearing depth component with setPixDepth() doesn't affect stencil"
1229*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1230*35238bceSAndroid Build Coastguard Worker tcu::copy(tmpAccess, inputAccess);
1231*35238bceSAndroid Build Coastguard Worker
1232*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < tmpAccess.getWidth(); ndx++)
1233*35238bceSAndroid Build Coastguard Worker tmpAccess.setPixDepth(0.0f, ndx, 0, 0);
1234*35238bceSAndroid Build Coastguard Worker
1235*35238bceSAndroid Build Coastguard Worker verifyRead(tmpStencilAccess);
1236*35238bceSAndroid Build Coastguard Worker
1237*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Message
1238*35238bceSAndroid Build Coastguard Worker << "Verifying that clearing stencil component with setPixStencil() doesn't affect depth"
1239*35238bceSAndroid Build Coastguard Worker << TestLog::EndMessage;
1240*35238bceSAndroid Build Coastguard Worker tcu::copy(tmpAccess, inputAccess);
1241*35238bceSAndroid Build Coastguard Worker
1242*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < tmpAccess.getWidth(); ndx++)
1243*35238bceSAndroid Build Coastguard Worker tmpAccess.setPixStencil(0, ndx, 0, 0);
1244*35238bceSAndroid Build Coastguard Worker
1245*35238bceSAndroid Build Coastguard Worker verifyRead(tmpDepthAccess);
1246*35238bceSAndroid Build Coastguard Worker
1247*35238bceSAndroid Build Coastguard Worker return STOP;
1248*35238bceSAndroid Build Coastguard Worker }
1249*35238bceSAndroid Build Coastguard Worker };
1250*35238bceSAndroid Build Coastguard Worker
1251*35238bceSAndroid Build Coastguard Worker } // namespace
1252*35238bceSAndroid Build Coastguard Worker
createTextureFormatTests(tcu::TestContext & testCtx)1253*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *createTextureFormatTests(tcu::TestContext &testCtx)
1254*35238bceSAndroid Build Coastguard Worker {
1255*35238bceSAndroid Build Coastguard Worker de::MovePtr<tcu::TestCaseGroup> group(new tcu::TestCaseGroup(testCtx, "texture_format", "Texture format tests"));
1256*35238bceSAndroid Build Coastguard Worker
1257*35238bceSAndroid Build Coastguard Worker for (int channelType = 0; channelType < TextureFormat::CHANNELTYPE_LAST; channelType++)
1258*35238bceSAndroid Build Coastguard Worker {
1259*35238bceSAndroid Build Coastguard Worker // \todo [2020-04-08] Missing tests for SIGNED_INT64 and UNSIGNED_INT64
1260*35238bceSAndroid Build Coastguard Worker if (TextureFormat::SIGNED_INT64 == channelType || channelType == TextureFormat::UNSIGNED_INT64)
1261*35238bceSAndroid Build Coastguard Worker continue;
1262*35238bceSAndroid Build Coastguard Worker
1263*35238bceSAndroid Build Coastguard Worker for (int channelOrder = 0; channelOrder < TextureFormat::CHANNELORDER_LAST; channelOrder++)
1264*35238bceSAndroid Build Coastguard Worker {
1265*35238bceSAndroid Build Coastguard Worker const TextureFormat format((TextureFormat::ChannelOrder)channelOrder,
1266*35238bceSAndroid Build Coastguard Worker (TextureFormat::ChannelType)channelType);
1267*35238bceSAndroid Build Coastguard Worker
1268*35238bceSAndroid Build Coastguard Worker if (!isValid(format))
1269*35238bceSAndroid Build Coastguard Worker continue;
1270*35238bceSAndroid Build Coastguard Worker
1271*35238bceSAndroid Build Coastguard Worker if (tcu::isSRGB(format))
1272*35238bceSAndroid Build Coastguard Worker continue; // \todo [2015-10-12 pyry] Tests for sRGB formats (need thresholds)
1273*35238bceSAndroid Build Coastguard Worker
1274*35238bceSAndroid Build Coastguard Worker if (format.order == TextureFormat::DS)
1275*35238bceSAndroid Build Coastguard Worker group->addChild(new DepthStencilFormatCase(testCtx, format));
1276*35238bceSAndroid Build Coastguard Worker else if (format.order == TextureFormat::D)
1277*35238bceSAndroid Build Coastguard Worker group->addChild(new DepthFormatCase(testCtx, format));
1278*35238bceSAndroid Build Coastguard Worker else if (format.order == TextureFormat::S)
1279*35238bceSAndroid Build Coastguard Worker group->addChild(new StencilFormatCase(testCtx, format));
1280*35238bceSAndroid Build Coastguard Worker else
1281*35238bceSAndroid Build Coastguard Worker group->addChild(new ColorFormatCase(testCtx, format));
1282*35238bceSAndroid Build Coastguard Worker }
1283*35238bceSAndroid Build Coastguard Worker }
1284*35238bceSAndroid Build Coastguard Worker
1285*35238bceSAndroid Build Coastguard Worker return group.release();
1286*35238bceSAndroid Build Coastguard Worker }
1287*35238bceSAndroid Build Coastguard Worker
1288*35238bceSAndroid Build Coastguard Worker } // namespace dit
1289