Lines Matching refs:size
60 inline void readOrder (typename tcu::Vector<DstScalarType, 4>& dst, const int size, const void* ptr)
63 deMemcpy(aligned, ptr, size * sizeof(SrcScalarType));
66 if (size >= 2) dst[Order::T1] = DstScalarType(aligned[1]);
67 if (size >= 3) dst[Order::T2] = DstScalarType(aligned[2]);
68 if (size >= 4) dst[Order::T3] = DstScalarType(aligned[3]);
72 inline void readUnormOrder (tcu::Vec4& dst, const int size, const void* ptr)
77 deMemcpy(aligned, ptr, size * sizeof(SrcScalarType));
80 if (size >= 2) dst[Order::T1] = float(aligned[1]) / float(range);
81 if (size >= 3) dst[Order::T2] = float(aligned[2]) / float(range);
82 if (size >= 4) dst[Order::T3] = float(aligned[3]) / float(range);
86 inline void readSnormClamp (tcu::Vec4& dst, const int size, const void* ptr)
92 deMemcpy(aligned, ptr, size * sizeof(SrcScalarType));
95 if (size >= 2) dst[1] = de::max(-1.0f, float(aligned[1]) / float(range));
96 if (size >= 3) dst[2] = de::max(-1.0f, float(aligned[2]) / float(range));
97 if (size >= 4) dst[3] = de::max(-1.0f, float(aligned[3]) / float(range));
101 inline void readSnormScale (tcu::Vec4& dst, const int size, const void* ptr)
107 deMemcpy(aligned, ptr, size * sizeof(SrcScalarType));
110 if (size >= 2) dst[1] = (float(aligned[1]) * 2.0f + 1.0f) / float(range);
111 if (size >= 3) dst[2] = (float(aligned[2]) * 2.0f + 1.0f) / float(range);
112 if (size >= 4) dst[3] = (float(aligned[3]) * 2.0f + 1.0f) / float(range);
115 inline void readHalf (tcu::Vec4& dst, const int size, const void* ptr)
118 deMemcpy(aligned, ptr, size * sizeof(deUint16));
121 if (size >= 2) dst[1] = tcu::Float16(aligned[1]).asFloat();
122 if (size >= 3) dst[2] = tcu::Float16(aligned[2]).asFloat();
123 if (size >= 4) dst[3] = tcu::Float16(aligned[3]).asFloat();
126 inline void readFixed (tcu::Vec4& dst, const int size, const void* ptr)
129 deMemcpy(aligned, ptr, size * sizeof(deInt32));
132 if (size >= 2) dst[1] = float(aligned[1]) / float(1 << 16);
133 if (size >= 3) dst[2] = float(aligned[2]) / float(1 << 16);
134 if (size >= 4) dst[3] = float(aligned[3]) / float(1 << 16);
137 inline void readDouble (tcu::Vec4& dst, const int size, const void* ptr)
140 deMemcpy(aligned, ptr, size * sizeof(double));
143 if (size >= 2) dst[1] = float(aligned[1]);
144 if (size >= 3) dst[2] = float(aligned[2]);
145 if (size >= 4) dst[3] = float(aligned[3]);
155 inline void readUint2101010Rev (typename tcu::Vector<DstScalarType, 4>& dst, const int size, const void* ptr)
161 if (size >= 2) dst[1] = DstScalarType((aligned >> 10) & ((1 << 10) - 1));
162 if (size >= 3) dst[2] = DstScalarType((aligned >> 20) & ((1 << 10) - 1));
163 if (size >= 4) dst[3] = DstScalarType((aligned >> 30) & ((1 << 2) - 1));
167 inline void readInt2101010Rev (typename tcu::Vector<DstScalarType, 4>& dst, const int size, const void* ptr)
173 if (size >= 2) dst[1] = (DstScalarType)extendSign<10>((aligned >> 10) & ((1 << 10) - 1));
174 if (size >= 3) dst[2] = (DstScalarType)extendSign<10>((aligned >> 20) & ((1 << 10) - 1));
175 if (size >= 4) dst[3] = (DstScalarType)extendSign< 2>((aligned >> 30) & ((1 << 2) - 1));
179 inline void readUnorm2101010RevOrder (tcu::Vec4& dst, const int size, const void* ptr)
188 if (size >= 2) dst[Order::T1] = float((aligned >> 10) & ((1 << 10) - 1)) / float(range10);
189 if (size >= 3) dst[Order::T2] = float((aligned >> 20) & ((1 << 10) - 1)) / float(range10);
190 if (size >= 4) dst[Order::T3] = float((aligned >> 30) & ((1 << 2) - 1)) / float(range2);
194 inline void readSnorm2101010RevClampOrder (tcu::Vec4& dst, const int size, const void* ptr)
204 if (size >= 2) dst[Order::T1] = de::max(-1.0f, float(extendSign<10>((aligned >> 10) & ((1 << 10) - 1))) / float(range10));
205 if (size >= 3) dst[Order::T2] = de::max(-1.0f, float(extendSign<10>((aligned >> 20) & ((1 << 10) - 1))) / float(range10));
206 if (size >= 4) dst[Order::T3] = de::max(-1.0f, float(extendSign< 2>((aligned >> 30) & ((1 << 2) - 1))) / float(range2));
210 inline void readSnorm2101010RevScaleOrder (tcu::Vec4& dst, const int size, const void* ptr)
220 if (size >= 2) dst[Order::T1] = (float(extendSign<10>((aligned >> 10) & ((1 << 10) - 1))) * 2.0f + 1.0f) / float(range10);
221 if (size >= 3) dst[Order::T2] = (float(extendSign<10>((aligned >> 20) & ((1 << 10) - 1))) * 2.0f + 1.0f) / float(range10);
222 if (size >= 4) dst[Order::T3] = (float(extendSign< 2>((aligned >> 30) & ((1 << 2) - 1))) * 2.0f + 1.0f) / float(range2);
228 inline void read (typename tcu::Vector<DstScalarType, 4>& dst, const int size, const void* ptr)
230 readOrder<SrcScalarType, DstScalarType, NormalOrder>(dst, size, ptr);
234 inline void readUnorm (tcu::Vec4& dst, const int size, const void* ptr)
236 readUnormOrder<SrcScalarType, NormalOrder>(dst, size, ptr);
240 inline void readUnormBGRA (tcu::Vec4& dst, const int size, const void* ptr)
242 readUnormOrder<SrcScalarType, BGRAOrder>(dst, size, ptr);
245 inline void readUnorm2101010Rev (tcu::Vec4& dst, const int size, const void* ptr)
247 readUnorm2101010RevOrder<NormalOrder>(dst, size, ptr);
250 inline void readUnorm2101010RevBGRA (tcu::Vec4& dst, const int size, const void* ptr)
252 readUnorm2101010RevOrder<BGRAOrder>(dst, size, ptr);
255 inline void readSnorm2101010RevClamp (tcu::Vec4& dst, const int size, const void* ptr)
257 readSnorm2101010RevClampOrder<NormalOrder>(dst, size, ptr);
260 inline void readSnorm2101010RevClampBGRA (tcu::Vec4& dst, const int size, const void* ptr)
262 readSnorm2101010RevClampOrder<BGRAOrder>(dst, size, ptr);
265 inline void readSnorm2101010RevScale (tcu::Vec4& dst, const int size, const void* ptr)
267 readSnorm2101010RevScaleOrder<NormalOrder>(dst, size, ptr);
270 inline void readSnorm2101010RevScaleBGRA (tcu::Vec4& dst, const int size, const void* ptr)
272 readSnorm2101010RevScaleOrder<BGRAOrder>(dst, size, ptr);
277 void readFloat (tcu::Vec4& dst, const VertexAttribType type, const int size, const void* ptr)
281 case VERTEXATTRIBTYPE_FLOAT: read<float> (dst, size, ptr); break;
282 case VERTEXATTRIBTYPE_HALF: readHalf (dst, size, ptr); break;
283 case VERTEXATTRIBTYPE_FIXED: readFixed (dst, size, ptr); break;
284 case VERTEXATTRIBTYPE_DOUBLE: readDouble (dst, size, ptr); break;
285 case VERTEXATTRIBTYPE_NONPURE_UNORM8: readUnorm<deUint8> (dst, size, ptr); break;
286 case VERTEXATTRIBTYPE_NONPURE_UNORM16: readUnorm<deUint16> (dst, size, ptr); break;
287 case VERTEXATTRIBTYPE_NONPURE_UNORM32: readUnorm<deUint32> (dst, size, ptr); break;
288 case VERTEXATTRIBTYPE_NONPURE_UNORM_2_10_10_10_REV: readUnorm2101010Rev (dst, size, ptr); break;
289 case VERTEXATTRIBTYPE_NONPURE_SNORM8_CLAMP: readSnormClamp<deInt8> (dst, size, ptr); break;
290 case VERTEXATTRIBTYPE_NONPURE_SNORM16_CLAMP: readSnormClamp<deInt16> (dst, size, ptr); break;
291 case VERTEXATTRIBTYPE_NONPURE_SNORM32_CLAMP: readSnormClamp<deInt32> (dst, size, ptr); break;
292 case VERTEXATTRIBTYPE_NONPURE_SNORM_2_10_10_10_REV_CLAMP: readSnorm2101010RevClamp (dst, size, ptr); break;
293 case VERTEXATTRIBTYPE_NONPURE_SNORM8_SCALE: readSnormScale<deInt8> (dst, size, ptr); break;
294 case VERTEXATTRIBTYPE_NONPURE_SNORM16_SCALE: readSnormScale<deInt16> (dst, size, ptr); break;
295 case VERTEXATTRIBTYPE_NONPURE_SNORM32_SCALE: readSnormScale<deInt32> (dst, size, ptr); break;
296 case VERTEXATTRIBTYPE_NONPURE_SNORM_2_10_10_10_REV_SCALE: readSnorm2101010RevScale (dst, size, ptr); break;
297 case VERTEXATTRIBTYPE_NONPURE_UINT8: read<deUint8> (dst, size, ptr); break;
298 case VERTEXATTRIBTYPE_NONPURE_UINT16: read<deUint16> (dst, size, ptr); break;
299 case VERTEXATTRIBTYPE_NONPURE_UINT32: read<deUint32> (dst, size, ptr); break;
300 case VERTEXATTRIBTYPE_NONPURE_INT8: read<deInt8> (dst, size, ptr); break;
301 case VERTEXATTRIBTYPE_NONPURE_INT16: read<deInt16> (dst, size, ptr); break;
302 case VERTEXATTRIBTYPE_NONPURE_INT32: read<deInt32> (dst, size, ptr); break;
303 case VERTEXATTRIBTYPE_NONPURE_UINT_2_10_10_10_REV: readUint2101010Rev (dst, size, ptr); break;
304 case VERTEXATTRIBTYPE_NONPURE_INT_2_10_10_10_REV: readInt2101010Rev (dst, size, ptr); break;
305 case VERTEXATTRIBTYPE_NONPURE_UNORM8_BGRA: readUnormBGRA<deUint8> (dst, size, ptr); break;
306 case VERTEXATTRIBTYPE_NONPURE_UNORM_2_10_10_10_REV_BGRA: readUnorm2101010RevBGRA (dst, size, ptr); break;
307 case VERTEXATTRIBTYPE_NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: readSnorm2101010RevClampBGRA(dst, size, ptr); break;
308 case VERTEXATTRIBTYPE_NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: readSnorm2101010RevScaleBGRA(dst, size, ptr); break;
324 void readInt (tcu::IVec4& dst, const VertexAttribType type, const int size, const void* ptr)
328 case VERTEXATTRIBTYPE_PURE_INT8: read<deInt8> (dst, size, ptr); break;
329 case VERTEXATTRIBTYPE_PURE_INT16: read<deInt16> (dst, size, ptr); break;
330 case VERTEXATTRIBTYPE_PURE_INT32: read<deInt32> (dst, size, ptr); break;
371 void readUint (tcu::UVec4& dst, const VertexAttribType type, const int size, const void* ptr)
375 case VERTEXATTRIBTYPE_PURE_UINT8: read<deUint8> (dst, size, ptr); break;
376 case VERTEXATTRIBTYPE_PURE_UINT16: read<deUint16> (dst, size, ptr); break;
377 case VERTEXATTRIBTYPE_PURE_UINT32: read<deUint32> (dst, size, ptr); break;
468 !de::inRange(vertexAttrib.size, 0, 4) ||
485 vertexAttrib.size != 4)
499 const int stride = (vertexAttrib.stride != 0) ? (vertexAttrib.stride) : (vertexAttrib.size*compSize);
503 readFloat(dst, vertexAttrib.type, vertexAttrib.size, (const deUint8*)vertexAttrib.pointer + byteOffset);
519 const int stride = (vertexAttrib.stride != 0) ? (vertexAttrib.stride) : (vertexAttrib.size*compSize);
523 readInt(dst, vertexAttrib.type, vertexAttrib.size, (const deUint8*)vertexAttrib.pointer + byteOffset);
539 const int stride = (vertexAttrib.stride != 0) ? (vertexAttrib.stride) : (vertexAttrib.size*compSize);
543 readUint(dst, vertexAttrib.type, vertexAttrib.size, (const deUint8*)vertexAttrib.pointer + byteOffset);