Lines Matching refs:Array
21 * \brief Vertex array and buffer tests
67 std::string Array::targetToString(Target target)
72 "array" // TARGET_ARRAY,
75 return de::getSizedArrayElement<Array::TARGET_LAST>(targets, (int)target);
78 std::string Array::inputTypeToString(InputType type)
99 return de::getSizedArrayElement<Array::INPUTTYPE_LAST>(types, (int)type);
102 std::string Array::outputTypeToString(OutputType type)
123 return de::getSizedArrayElement<Array::OUTPUTTYPE_LAST>(types, (int)type);
126 std::string Array::usageTypeToString(Usage usage)
144 return de::getSizedArrayElement<Array::USAGE_LAST>(usages, (int)usage);
147 std::string Array::storageToString (Storage storage)
155 return de::getSizedArrayElement<Array::STORAGE_LAST>(storages, (int)storage);
158 std::string Array::primitiveToString (Primitive primitive)
168 return de::getSizedArrayElement<Array::PRIMITIVE_LAST>(primitives, (int)primitive);
171 int Array::inputTypeSize (InputType type)
192 return de::getSizedArrayElement<Array::INPUTTYPE_LAST>(size, (int)type);
195 static bool inputTypeIsFloatType (Array::InputType type)
197 if (type == Array::INPUTTYPE_FLOAT)
199 if (type == Array::INPUTTYPE_FIXED)
201 if (type == Array::INPUTTYPE_DOUBLE)
203 if (type == Array::INPUTTYPE_HALF)
208 static bool outputTypeIsFloatType (Array::OutputType type)
210 if (type == Array::OUTPUTTYPE_FLOAT
211 || type == Array::OUTPUTTYPE_VEC2
212 || type == Array::OUTPUTTYPE_VEC3
213 || type == Array::OUTPUTTYPE_VEC4)
457 , m_target (Array::TARGET_ARRAY)
458 , m_inputType (Array::INPUTTYPE_FLOAT)
459 , m_outputType (Array::OUTPUTTYPE_VEC4)
484 Array* ContextArrayPack::getArray (int i)
544 void ContextArray::bindIndexArray (Array::Target target)
629 GLenum ContextArray::targetToGL (Array::Target target)
637 return de::getSizedArrayElement<Array::TARGET_LAST>(targets, (int)target);
640 GLenum ContextArray::usageToGL (Array::Usage usage)
658 return de::getSizedArrayElement<Array
661 GLenum ContextArray::inputTypeToGL (Array::InputType type)
680 return de::getSizedArrayElement<Array::INPUTTYPE_LAST>(types, (int)type);
683 std::string ContextArray::outputTypeToGLType (Array::OutputType type)
704 return de::getSizedArrayElement<Array::OUTPUTTYPE_LAST>(types, (int)type);
707 GLenum ContextArray::primitiveToGL (Array::Primitive primitive)
717 return de::getSizedArrayElement<Array::PRIMITIVE_LAST>(primitives, (int)primitive);
741 void ContextArrayPack::newArray (Array::Storage storage)
757 static rr::GenericVecType mapOutputType (const Array::OutputType& type);
758 static int getComponentCount (const Array::OutputType& type);
935 case (Array::OUTPUTTYPE_FLOAT):
940 case (Array::OUTPUTTYPE_VEC2):
945 case (Array::OUTPUTTYPE_VEC3):
951 case (Array::OUTPUTTYPE_VEC4):
957 case (Array::OUTPUTTYPE_IVEC2):
958 case (Array::OUTPUTTYPE_UVEC2):
963 case (Array::OUTPUTTYPE_IVEC3):
964 case (Array::OUTPUTTYPE_UVEC3):
970 case (Array::OUTPUTTYPE_IVEC4):
971 case (Array::OUTPUTTYPE_UVEC4):
986 case (Array::OUTPUTTYPE_FLOAT):
991 case (Array::OUTPUTTYPE_VEC2):
996 case (Array::OUTPUTTYPE_VEC3):
1001 case (Array::OUTPUTTYPE_VEC4):
1065 rr::GenericVecType ContextShaderProgram::mapOutputType (const Array::OutputType& type)
1069 case (Array::OUTPUTTYPE_FLOAT):
1070 case (Array::OUTPUTTYPE_VEC2):
1071 case (Array::OUTPUTTYPE_VEC3):
1072 case (Array::OUTPUTTYPE_VEC4):
1075 case (Array::OUTPUTTYPE_INT):
1076 case (Array::OUTPUTTYPE_IVEC2):
1077 case (Array::OUTPUTTYPE_IVEC3):
1078 case (Array::OUTPUTTYPE_IVEC4):
1081 case (Array::OUTPUTTYPE_UINT):
1082 case (Array::OUTPUTTYPE_UVEC2):
1083 case (Array::OUTPUTTYPE_UVEC3):
1084 case (Array::OUTPUTTYPE_UVEC4):
1093 int ContextShaderProgram::getComponentCount (const Array::OutputType& type)
1097 case (Array::OUTPUTTYPE_FLOAT):
1098 case (Array::OUTPUTTYPE_INT):
1099 case (Array::OUTPUTTYPE_UINT):
1102 case (Array::OUTPUTTYPE_VEC2):
1103 case (Array::OUTPUTTYPE_IVEC2):
1104 case (Array::OUTPUTTYPE_UVEC2):
1107 case (Array::OUTPUTTYPE_VEC3):
1108 case (Array::OUTPUTTYPE_IVEC3):
1109 case (Array::OUTPUTTYPE_UVEC3):
1112 case (Array::OUTPUTTYPE_VEC4):
1113 case (Array::OUTPUTTYPE_IVEC4):
1114 case (Array::OUTPUTTYPE_UVEC4):
1148 void ContextArrayPack::render (Array::Primitive primitive, int firstVertex, int vertexCount, bool useVao, float coordScale, float colorScale)
1216 GLValue GLValue::getMaxValue (Array::InputType type)
1218 GLValue rangesHi[(int)Array::INPUTTYPE_LAST];
1220 rangesHi[(int)Array::INPUTTYPE_FLOAT] = GLValue(Float::create(127.0f));
1221 rangesHi[(int)Array::INPUTTYPE_DOUBLE] = GLValue(Double::create(127.0f));
1222 rangesHi[(int)Array::INPUTTYPE_BYTE] = GLValue(Byte::create(127));
1223 rangesHi[(int)Array::INPUTTYPE_UNSIGNED_BYTE] = GLValue(Ubyte::create(255));
1224 rangesHi[(int)Array::INPUTTYPE_UNSIGNED_SHORT] = GLValue(Ushort::create(65530));
1225 rangesHi[(int)Array::INPUTTYPE_SHORT] = GLValue(Short::create(32760));
1226 rangesHi[(int)Array::INPUTTYPE_FIXED] = GLValue(Fixed::create(32760));
1227 rangesHi[(int)Array::INPUTTYPE_INT] = GLValue(Int::create(2147483647));
1228 rangesHi[(int)Array::INPUTTYPE_UNSIGNED_INT] = GLValue(Uint::create(4294967295u));
1229 rangesHi[(int)Array::INPUTTYPE_HALF] = GLValue(Half::create(256.0f));
1234 GLValue GLValue::getMinValue (Array::InputType type)
1236 GLValue rangesLo[(int)Array::INPUTTYPE_LAST];
1238 rangesLo[(int)Array::INPUTTYPE_FLOAT] = GLValue(Float::create(-127.0f));
1239 rangesLo[(int)Array::INPUTTYPE_DOUBLE] = GLValue(Double::create(-127.0f));
1240 rangesLo[(int)Array::INPUTTYPE_BYTE] = GLValue(Byte::create(-127));
1241 rangesLo[(int)Array::INPUTTYPE_UNSIGNED_BYTE] = GLValue(Ubyte::create(0));
1242 rangesLo[(int)Array::INPUTTYPE_UNSIGNED_SHORT] = GLValue(Ushort::create(0));
1243 rangesLo[(int)Array::INPUTTYPE_SHORT] = GLValue(Short::create(-32760));
1244 rangesLo[(int)Array::INPUTTYPE_FIXED] = GLValue(Fixed::create(-32760));
1245 rangesLo[(int)Array::INPUTTYPE_INT] = GLValue(Int::create(-2147483647));
1246 rangesLo[(int)Array::INPUTTYPE_UNSIGNED_INT] = GLValue(Uint::create(0));
1247 rangesLo[(int)Array::INPUTTYPE_HALF] = GLValue(Half::create(-256.0f));
1256 case Array::INPUTTYPE_FLOAT:
1260 case Array::INPUTTYPE_BYTE:
1264 case Array::INPUTTYPE_UNSIGNED_BYTE:
1268 case Array::INPUTTYPE_SHORT:
1272 case Array::INPUTTYPE_UNSIGNED_SHORT:
1276 case Array::INPUTTYPE_FIXED:
1284 case Array::INPUTTYPE_UNSIGNED_INT:
1288 case Array::INPUTTYPE_INT:
1292 case Array::INPUTTYPE_HALF:
1296 case Array::INPUTTYPE_DOUBLE:
1310 static char* generateArray (int seed, GLValue min, GLValue max, int count, int componentCount, int stride, Array::InputType type);
1311 static char* generateQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, Array::InputType type, GLValue min, GLValue max, float gridSize);
1312 static char* generatePerQuad (int seed, int count, int componentCount, int stride, Array::Primitive primitive, Array::InputType type, GLValue min, GLValue max);
1316 static char* createQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, T min, T max, float gridSize);
1318 static char* createPerQuads (int seed, int count, int componentCount, int stride, Array::Primitive primitive, T min, T max);
1319 static char* createQuadsPacked (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive);
1320 static void setData (char* data, Array::InputType type, deRandom& rnd, GLValue min, GLValue max);
1323 void RandomArrayGenerator::setData (char* data, Array::InputType type, deRandom& rnd, GLValue min, GLValue max)
1327 case Array::INPUTTYPE_FLOAT:
1333 case Array::INPUTTYPE_DOUBLE:
1339 case Array::INPUTTYPE_SHORT:
1345 case Array::INPUTTYPE_UNSIGNED_SHORT:
1351 case Array::INPUTTYPE_BYTE:
1357 case Array::INPUTTYPE_UNSIGNED_BYTE:
1363 case Array::INPUTTYPE_FIXED:
1369 case Array::INPUTTYPE_INT:
1375 case Array::INPUTTYPE_UNSIGNED_INT:
1381 case Array::INPUTTYPE_HALF:
1393 char* RandomArrayGenerator::generateArray (int seed, GLValue min, GLValue max, int count, int componentCount, int stride, Array::InputType type)
1401 stride = componentCount * Array::inputTypeSize(type);
1409 setData(&(data[vertexNdx * stride + Array::inputTypeSize(type) * componentNdx]), type, rnd, min, max);
1416 char* RandomArrayGenerator::generateQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, Array::InputType type, GLValue min, GLValue max, float gridSize)
1422 case Array::INPUTTYPE_FLOAT:
1426 case Array::INPUTTYPE_FIXED:
1430 case Array::INPUTTYPE_DOUBLE:
1434 case Array::INPUTTYPE_BYTE:
1438 case Array::INPUTTYPE_SHORT:
1442 case Array::INPUTTYPE_UNSIGNED_BYTE:
1446 case Array::INPUTTYPE_UNSIGNED_SHORT:
1450 case Array::INPUTTYPE_UNSIGNED_INT:
1454 case Array::INPUTTYPE_INT:
1458 case Array::INPUTTYPE_HALF:
1462 case Array::INPUTTYPE_INT_2_10_10_10:
1463 case Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10:
1475 char* RandomArrayGenerator::createQuadsPacked (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive)
1486 case Array::PRIMITIVE_TRIANGLES:
1495 char* const _data = new char[offset + quadStride * (count - 1) + stride * 5 + componentCount * Array::inputTypeSize(Array::INPUTTYPE_INT_2_10_10_10)]; // last element must be fully in the array
1507 case Array::PRIMITIVE_TRIANGLES:
1554 char* RandomArrayGenerator::createQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, T min, T max, float gridSize)
1566 case Array::PRIMITIVE_TRIANGLES:
1584 case Array::PRIMITIVE_TRIANGLES:
1664 char* RandomArrayGenerator::generatePerQuad (int seed, int count, int componentCount, int stride, Array::Primitive primitive, Array::InputType type, GLValue min, GLValue max)
1670 case Array::INPUTTYPE_FLOAT:
1674 case Array::INPUTTYPE_FIXED:
1678 case Array::INPUTTYPE_DOUBLE:
1682 case Array::INPUTTYPE_BYTE:
1686 case Array::INPUTTYPE_SHORT:
1690 case Array::INPUTTYPE_UNSIGNED_BYTE:
1694 case Array::INPUTTYPE_UNSIGNED_SHORT:
1698 case Array::INPUTTYPE_UNSIGNED_INT:
1702 case Array::INPUTTYPE_INT:
1706 case Array
1719 char* RandomArrayGenerator::createPerQuads (int seed, int count, int componentCount, int stride, Array::Primitive primitive, T min, T max)
1733 case Array::PRIMITIVE_TRIANGLES:
1918 MultiVertexArrayTest::Spec::ArraySpec::ArraySpec(Array::InputType inputType_, Array::OutputType outputType_, Array::Storage storage_, Array::Usage usage_, int componentCount_, int offset_, int stride_, bool normalize_, GLValue min_, GLValue max_)
1938 const ArraySpec& array = arrays[ndx];
1941 name << "array" << ndx << "_";
1944 << Array::storageToString(array.storage) << "_"
1945 << array.offset << "_"
1946 << array.stride << "_"
1947 << Array::inputTypeToString((Array::InputType)array.inputType);
1948 if (array.inputType != Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 && array.inputType != Array::INPUTTYPE_INT_2_10_10_10)
1949 name << array.componentCount;
1952 << (array.normalize ? "normalized_" : "")
1953 << Array::outputTypeToString(array.outputType) << "_"
1954 << Array::usageTypeToString(array.usage) << "_";
1962 case Array::PRIMITIVE_TRIANGLES:
1965 case Array::PRIMITIVE_POINTS:
1985 const ArraySpec& array = arrays[ndx];
1988 << "Array " << ndx << ": "
1989 << "Storage in " << Array::storageToString(array.storage) << ", "
1990 << "stride " << array.stride << ", "
1991 << "input datatype " << Array::inputTypeToString((Array::InputType)array.inputType) << ", "
1992 << "input component count " << array.componentCount << ", "
1993 << (array.normalize ? "normalized, " : "")
1994 << "used as " << Array::outputTypeToString(array.outputType) << ", ";
2004 case Array::PRIMITIVE_TRIANGLES:
2007 case Array::PRIMITIVE_POINTS:
2035 const size_t primitiveSize = (m_spec.primitive == Array::PRIMITIVE_TRIANGLES) ? (6) : (1); // in non-indexed draw Triangles means rectangles
2045 // First array is always position
2048 if (arraySpec.inputType == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10)
2055 else if (arraySpec.inputType == Array::INPUTTYPE_INT_2_10_10_10)
2065 if (arraySpec.outputType == Array::OUTPUTTYPE_VEC3 || arraySpec.outputType == Array::OUTPUTTYPE_VEC4
2066 || arraySpec.outputType == Array::OUTPUTTYPE_IVEC3 || arraySpec.outputType == Array::OUTPUTTYPE_IVEC4
2067 || arraySpec.outputType == Array::OUTPUTTYPE_UVEC3 || arraySpec.outputType == Array::OUTPUTTYPE_UVEC4)
2077 if (arraySpec.outputType == Array::OUTPUTTYPE_VEC4)
2088 const size_t stride = (arraySpec.stride == 0) ? (arraySpec.componentCount * Array::inputTypeSize(arraySpec.inputType)) : (arraySpec.stride);
2089 const size_t bufferSize = arraySpec.offset + stride * (m_spec.drawCount * primitiveSize - 1) + arraySpec.componentCount * Array::inputTypeSize(arraySpec.inputType);
2095 // case Array::PRIMITIVE_POINTS:
2098 case Array::PRIMITIVE_TRIANGLES:
2118 m_glArrayPack->getArray(arrayNdx)->data(Array::TARGET_ARRAY, (int)bufferSize, data, arraySpec.usage);
2119 m_rrArrayPack->getArray(arrayNdx)->data(Array::TARGET_ARRAY, (int)bufferSize, data, arraySpec.usage);
2184 if (m_spec.arrays[i].storage == Array::STORAGE_BUFFER)
2186 const bool inputTypePacked = m_spec.arrays[i].inputType == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_spec.arrays[i].inputType == Array::INPUTTYPE_INT_2_10_10_10;
2188 int dataTypeSize = Array::inputTypeSize(m_spec.arrays[i].inputType);
2205 if (m_spec.arrays[i].storage == Array::STORAGE_BUFFER)
2207 const bool inputTypePacked = m_spec.arrays[i].inputType == Array::INPUTTYPE_UNSIGNED_INT_2_10_10_10 || m_spec.arrays[i].inputType == Array::INPUTTYPE_INT_2_10_10_10;
2209 int dataTypeSize = Array::inputTypeSize(m_spec.arrays[i].inputType);