}
}
-const string specializeCompositeShaderTemplate (const NumberType type, const map<string, string>& params)
+const string getAssemblyTypeDeclaration (const NumberType type)
{
- map<string, string> parameters(params);
-
- string typeAssembly;
-
switch (type)
{
- case TYPE_INT: typeAssembly = "OpTypeInt 32 1"; break;
- case TYPE_UINT: typeAssembly = "OpTypeInt 32 0"; break;
- case TYPE_FLOAT: typeAssembly = "OpTypeFloat 32"; break;
- default: DE_ASSERT(false);
+ case TYPE_INT: return "OpTypeInt 32 1";
+ case TYPE_UINT: return "OpTypeInt 32 0";
+ case TYPE_FLOAT: return "OpTypeFloat 32";
+ default: DE_ASSERT(false); return "";
}
+}
+
+const string specializeCompositeInsertShaderTemplate (const NumberType type, const map<string, string>& params)
+{
+ map<string, string> parameters(params);
- parameters["typeDeclaration"] = typeAssembly;
+ parameters["typeDeclaration"] = getAssemblyTypeDeclaration(type);
return StringTemplate (
"OpCapability Shader\n"
{
ComputeShaderSpec spec;
- spec.assembly = specializeCompositeShaderTemplate(numberType, *test);
+ spec.assembly = specializeCompositeInsertShaderTemplate(numberType, *test);
switch (numberType)
{