本文整理汇总了C++中PixelShader::GetStatements方法的典型用法代码示例。如果您正苦于以下问题:C++ PixelShader::GetStatements方法的具体用法?C++ PixelShader::GetStatements怎么用?C++ PixelShader::GetStatements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PixelShader
的用法示例。
在下文中一共展示了PixelShader::GetStatements方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Transform
PixelShader RemoveMaskedOutputWrites::Transform(const PixelShader& original)
{
PixelShader shader;
shader.SetInfo(original.GetInfo());
unsigned int i = 0;
target.reg.type = RegisterType::UNKNOWN;
for (const Statement& statement : original.GetStatements()) {
if (statement.destination.reg.type == RegisterType::OUTPUT && !statement.destination.mask.IsEmpty()) {
if (target.reg.type == RegisterType::UNKNOWN)
target = FindUnusedRegister(original, i);
Replace(&shader, statement, target);
}
else
shader.PushStatement(statement);
++i;
}
if (target.reg.type != RegisterType::UNKNOWN) {
Statement mov;
mov.opcode = Opcode::MOV;
mov.destination.reg.type = RegisterType::OUTPUT;
mov.source1.registerEntry = target;
shader.PushStatement(mov);
}
return shader;
}
示例2: WriteShader
void AGALWriter::WriteShader(const PixelShader& shader, std::ostream& stream)
{
stream << shader.GetInfo();
for (const Statement& statement : shader.GetStatements()) {
stream << statement;
if (statement.opcode == Opcode::TEXLD)
stream << " <2d, "
<< (wrapMode == TextureSampling::CLAMP? "clamp, " : "wrap, ")
<< (textureFiltering == TextureSampling::LINEAR? "linear, " : "nearest, ")
<< (mipFiltering == TextureSampling::MIPNONE? "mipnone" :
mipFiltering == TextureSampling::MIPLINEAR? "miplinear" :
"mipnearest")
<< ">";
stream << std::endl;
}
}
示例3: Transform
PixelShader RemoveMADTransformation::Transform(const PixelShader& original)
{
PixelShader shader;
shader.SetInfo(original.GetInfo());
unsigned int i = 0;
for (const Statement& statement : original.GetStatements()) {
if (statement.opcode == Opcode::MAD)
Replace(original, &shader, statement, i);
else
shader.PushStatement(statement);
++i;
}
return shader;
}
示例4: Transform
PixelShader RemoveNegationTransformation::Transform(const PixelShader& original)
{
PixelShader shader;
shader.SetInfo(original.GetInfo());
unsigned int i = 0;
for (const Statement& statement : original.GetStatements()) {
if (statement.source1.negated || statement.source2.negated) {
Replace(original, &shader, statement, i);
}
else
shader.PushStatement(statement);
++i;
}
return shader;
}