}
}
-const char* getShaderTypeString (const glu::ShaderType shaderType)
-{
- switch (shaderType) {
- case glu::SHADERTYPE_FRAGMENT: return "fragment";
- case glu::SHADERTYPE_COMPUTE: return "compute";
- default: DE_FATAL("Invalid shader type"); return "";
- }
-}
-
const char* getSSBOAtomicTypeString (SSBOAtomicType type)
{
switch (type)
for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(shaderTypes); ++shaderNdx)
{
const glu::ShaderType shaderType = shaderTypes[shaderNdx];
- const std::string shaderName = getShaderTypeString(shaderType);
+ const std::string shaderName = glu::getShaderTypeName(shaderType);
const std::string shaderGroupDesc = "Storage buffer tests for shader type: " + shaderName;
de::MovePtr<tcu::TestCaseGroup> testShaderGroup (new tcu::TestCaseGroup(testCtx, shaderName.c_str(), shaderGroupDesc.c_str()));
for (int shaderNdx = 0; shaderNdx < DE_LENGTH_OF_ARRAY(shaderTypes); ++shaderNdx)
{
const glu::ShaderType shaderType = shaderTypes[shaderNdx];
- const std::string shaderName = getShaderTypeString(shaderType);
+ const std::string shaderName = glu::getShaderTypeName(shaderType);
const std::string shaderDesc = "Storage Buffer Atomic Tests for shader type: " + shaderName;
de::MovePtr<tcu::TestCaseGroup> atomicShaderGroup (new tcu::TestCaseGroup(testctx, shaderName.c_str(), shaderDesc.c_str()));
return str;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
return pointers;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getIntegerFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
return str << v.value << " / " << tcu::toHex(tcu::Float32(v.value).bits());
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
} // anonymous
// ShaderPackingFunctionCase
void populatePerFormatGroup (tcu::TestCaseGroup* group, VkFormat format)
{
- const UVec2 size (66, 32);
- const struct
- {
- const char* name;
- glu::ShaderType value;
- } shaderTypes[] =
+ const UVec2 size (66, 32);
+ const glu::ShaderType shaderTypes[] =
{
- { "vertex", glu::SHADERTYPE_VERTEX },
- { "fragment", glu::SHADERTYPE_FRAGMENT },
- { "geometry", glu::SHADERTYPE_GEOMETRY },
- { "tess_control", glu::SHADERTYPE_TESSELLATION_CONTROL },
- { "tess_eval", glu::SHADERTYPE_TESSELLATION_EVALUATION },
- { "compute", glu::SHADERTYPE_COMPUTE }
+ glu::SHADERTYPE_VERTEX,
+ glu::SHADERTYPE_FRAGMENT,
+ glu::SHADERTYPE_GEOMETRY,
+ glu::SHADERTYPE_TESSELLATION_CONTROL,
+ glu::SHADERTYPE_TESSELLATION_EVALUATION,
+ glu::SHADERTYPE_COMPUTE
};
const struct
{
{ "linear", VK_IMAGE_TILING_LINEAR }
};
- for (int shaderTypeNdx = 0; shaderTypeNdx < DE_LENGTH_OF_ARRAY(shaderTypes); shaderTypeNdx++)
+ for (glu::ShaderType shaderType : shaderTypes)
for (int tilingNdx = 0; tilingNdx < DE_LENGTH_OF_ARRAY(tilings); tilingNdx++)
for (int useArrayLayers = 0; useArrayLayers < 2; useArrayLayers++)
{
const VkImageTiling tiling = tilings[tilingNdx].value;
const char* const tilingName = tilings[tilingNdx].name;
- const glu::ShaderType shaderType = shaderTypes[shaderTypeNdx].value;
- const char* const shaderTypeName = shaderTypes[shaderTypeNdx].name;
+ const char* const shaderTypeName = glu::getShaderTypeName(shaderType);
const string name = string(shaderTypeName) + "_" + tilingName + ((useArrayLayers) ? "_array" : "");
addFunctionCaseWithPrograms(group, name, "", checkSupport, initPrograms, testFormat, TestParameters(format, size, 0u, tiling, shaderType, false, useArrayLayers));
return s_names[(int)shaderType];
}
+std::string getShaderTypePostfix (ShaderType shaderType)
+{
+ return "_" + std::string(getShaderTypeName(shaderType));
+}
+
// Precision
const char* getPrecisionName (Precision precision)
return s_names[(int)precision];
}
+std::string getPrecisionPostfix (Precision precision)
+{
+ return "_" + std::string(getPrecisionName(precision));
+}
+
// DataType
const char* getDataTypeName (DataType dataType)
SHADERTYPE_LAST
};
-const char* getShaderTypeName (ShaderType shaderType);
+const char* getShaderTypeName (ShaderType shaderType);
+std::string getShaderTypePostfix (ShaderType shaderType);
// Precision
PRECISION_LAST
};
-const char* getPrecisionName (Precision precision);
+const char* getPrecisionName (Precision precision);
+std::string getPrecisionPostfix (Precision precision);
// DataType
return STOP;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
// Test cases
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
class PackSnorm2x16Case : public ShaderPackingFunctionCase
{
public:
return STOP;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
return STOP;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getIntegerFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
// Test cases
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "_lowp",
- "_mediump",
- "_highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
class PackSnorm2x16Case : public ShaderPackingFunctionCase
{
public:
return STOP;
}
-static const char* getPrecisionPostfix (glu::Precision precision)
-{
- static const char* s_postfix[] =
- {
- "lowp",
- "mediump",
- "highp"
- };
- DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
- DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[precision];
-}
-
-static const char* getShaderTypePostfix (glu::ShaderType shaderType)
-{
- static const char* s_postfix[] =
- {
- "_vertex",
- "_fragment",
- "_geometry",
- "_tess_control",
- "_tess_eval",
- "_compute"
- };
- DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
- return s_postfix[shaderType];
-}
-
static std::string getCaseName (glu::Precision precision, glu::ShaderType shaderType)
{
- return string(getPrecisionPostfix(precision)) + getShaderTypePostfix(shaderType);
+ return string(getPrecisionName(precision)) + getShaderTypePostfix(shaderType);
}
static int findMSB (deInt32 value)