本文整理汇总了C++中ConstantArray::back方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstantArray::back方法的具体用法?C++ ConstantArray::back怎么用?C++ ConstantArray::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstantArray
的用法示例。
在下文中一共展示了ConstantArray::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
//.........这里部分代码省略.........
}
// Get the variable name.
std::string name = tokens[2];
// Test whether the variable is a singleton or was declared as an
// array. If it is an array, we need to determine how many registers
// it uses. This requires processing variable lines with the same
// variable index.
bool varArray;
begin = name.find("[", 0);
if (begin != std::string::npos)
{
varArray = true;
name = name.substr(0, begin); // strip off "[register]"
}
else
{
varArray = false;
}
// Get the separator before the classifier.
if (tokens[3] != ":")
{
ReportError("Expecting separator character at index 3", &tokens);
return false;
}
// Get the classifier.
begin = tokens[4].find("$vin.", 0);
if (begin != std::string::npos)
{
// The variable is a shader input.
if (!GetInput(tokens, name, vartype, inputs))
{
return false;
}
continue;
}
begin = tokens[4].find("$vout.", 0);
if (begin != std::string::npos)
{
// The variable is a shader output.
if (!GetOutput(tokens, name, vartype, outputs))
{
return false;
}
continue;
}
if (tokens[4] == ":")
{
begin = tokens[1].find("sampler", 0);
if (begin != std::string::npos)
{
// The variable is a shader sampler.
if (!GetSampler(tokens, name, samtype, samplers))
{
return false;
}
}
else
{
// The variable is a shader constant.
if (varArray)
{
if (constants.size() > 0 && name == constants.back().Name)
{
// This is another occurrence of the array variable.
// Just increment the register count.
++constants.back().NumRegistersUsed;
}
else
{
// Create the constant with the first occurrence of
// the array variable.
if (!GetConstant(tokens, name, vartype, constants))
{
return false;
}
}
}
else
{
if (!GetConstant(tokens, name, vartype, constants))
{
return false;
}
}
}
continue;
}
ReportError("Failed to find classifier", &tokens);
return false;
}
return true;
}