本文整理汇总了C++中ArgumentArray::GetArray方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentArray::GetArray方法的具体用法?C++ ArgumentArray::GetArray怎么用?C++ ArgumentArray::GetArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentArray
的用法示例。
在下文中一共展示了ArgumentArray::GetArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DefaultLoadProgram
bool csShaderGLCGCommon::DefaultLoadProgram (iShaderProgramCG* cgResolve,
const char* programStr, ProgramType _type,
const ProfileLimitsPair& customLimitsPair, uint flags)
{
if (!programStr || !*programStr) return false;
const ProfileLimits& customLimits = (_type == progVP) ?
customLimitsPair.vp : customLimitsPair.fp;
CGGLenum type = (_type == progVP) ? CG_GL_VERTEX : CG_GL_FRAGMENT;
size_t i;
csString augmentedProgramStr = GetAugmentedProgram (programStr,
(flags & loadFlagUnusedV2FForInit) != 0);
programStr = augmentedProgramStr;
CGprofile profile = customLimits.profile;
CS::PluginCommon::ShaderProgramPluginGL::HardwareVendor vendor =
customLimits.vendor;
if (shaderPlug->doVerbose || shaderPlug->doVerbosePrecache)
{
shaderPlug->Report (CS_REPORTER_SEVERITY_NOTIFY,
"Cg %s program %s: using profile %s[%d]", GetProgramType(),
CS::Quote::Single (description.GetData ()),
cgGetProfileString (profile), profile);
}
ArgumentArray args;
shaderPlug->GetProfileCompilerArgs (GetProgramType(), profile,
customLimitsPair,
vendor,
(flags & loadIgnoreConfigProgramOpts) ? csGLShader_CG::argsNoConfig
: csGLShader_CG::argsAll, args);
for (i = 0; i < compilerArgs.GetSize(); i++)
args.Push (compilerArgs[i]);
programPositionInvariant = false;
for (i = 0; i < args.GetSize(); )
{
if (strcmp (args[i], "-posinv") == 0)
{
if (profile >= CG_PROFILE_GPU_VP)
{
/* Work around Cg 2.0 and above (including 3.0) bug: it emits
"OPTION ARB_position_invariant;" AND computes result.position in
the VP - doing both is verboten.
Affected are the GP4VP and higher profiles.
Remedy: remove -posinv argument
*/
args.DeleteIndex (i);
continue;
}
programPositionInvariant = true;
}
i++;
}
customLimits.ToCgOptions (args);
args.Push (0);
if (program)
{
cgDestroyProgram (program);
}
shaderPlug->SetCompiledSource (programStr);
shaderPlug->SetIgnoreErrors (true);
program = cgCreateProgram (shaderPlug->context,
CG_SOURCE, programStr,
profile, !entrypoint.IsEmpty() ? entrypoint : "main", args.GetArray());
shaderPlug->SetIgnoreErrors (false);
if (!(flags & loadIgnoreErrors)) shaderPlug->PrintAnyListing();
if (!program)
{
shaderPlug->SetCompiledSource (0);
/*if (shaderPlug->debugDump)
{
EnsureDumpFile();
WriteAdditionalDumpInfo ("Failed program source", programStr);
}*/
return false;
}
programProfile = cgGetProgramProfile (program);
GetParamsFromVmapConstants();
if (flags & loadApplyVmap)
GetParamsFromVmap();
if (flags & loadIgnoreErrors) shaderPlug->SetIgnoreErrors (true);
cgCompileProgram (program);
if (flags & loadIgnoreErrors)
shaderPlug->SetIgnoreErrors (false);
else
shaderPlug->PrintAnyListing();
if (flags & loadApplyVmap)
GetPostCompileParamProps ();
if (flags & loadLoadToGL)
{
cgGetError(); // Clear error
//.........这里部分代码省略.........