本文整理汇总了C#中DX11RenderSettings.GetPreferredTechnique方法的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderSettings.GetPreferredTechnique方法的具体用法?C# DX11RenderSettings.GetPreferredTechnique怎么用?C# DX11RenderSettings.GetPreferredTechnique使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DX11RenderSettings
的用法示例。
在下文中一共展示了DX11RenderSettings.GetPreferredTechnique方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
//.........这里部分代码省略.........
DX11RenderObject o = new DX11RenderObject();
o.ObjectType = g.PrimitiveType;
o.Descriptor = g.Tag;
o.Transforms = new Matrix[1];
o.Transforms[0] = this.mworld[i % this.mworldcount];
group.RenderObjects.Add(o);
}
}
settings.SceneDescriptor.Groups.Add(group);
}
}
return;
}
DX11ShaderData shaderdata = this.deviceshaderdata[context];
if ((shaderdata.IsValid &&
(this.geomconnected || settings.Geometry != null)
&& this.spmax > 0 && this.varmanager.SetGlobalSettings(shaderdata.ShaderInstance, settings))
|| this.FInApplyOnly[0])
{
this.OnBeginQuery(context);
//Select preferred technique if available
if (settings.PreferredTechniques.Count == 0 && this.techniqueindex != this.FInTechnique[0].Index)
{
this.techniqueindex = this.FInTechnique[0].Index;
this.techniquechanged = true;
}
else if (settings.PreferredTechniques.Count > 0)
{
int i = settings.GetPreferredTechnique(this.FShader);
if (i == -1)
{
i = this.FInTechnique[0].Index;
}
if (i != this.techniqueindex)
{
this.techniqueindex = i;
this.techniquechanged = true;
}
}
//Need to build input layout
if (this.FGeometry.IsChanged || this.techniquechanged || shaderdata.LayoutValid.Count == 0)
{
shaderdata.Update(this.techniqueindex, 0, this.FGeometry);
this.FOutLayoutValid.AssignFrom(shaderdata.LayoutValid);
this.FOutLayoutMsg.AssignFrom(shaderdata.LayoutMsg);
int errorCount = 0;
StringBuilder sbMsg = new StringBuilder();
sbMsg.Append("Invalid layout detected for slices:");
for(int i = 0; i < shaderdata.LayoutValid.Count; i++)
{
if (shaderdata.LayoutValid[i] == false)
{
errorCount++;
sbMsg.Append(i + ",");
}
}
if (errorCount > 0)
{