本文整理汇总了C#中DX11RenderSettings.ValidateObject方法的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderSettings.ValidateObject方法的具体用法?C# DX11RenderSettings.ValidateObject怎么用?C# DX11RenderSettings.ValidateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DX11RenderSettings
的用法示例。
在下文中一共展示了DX11RenderSettings.ValidateObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
//.........这里部分代码省略.........
this.OnBeginQuery(context);
//Need to build input layout
if (this.FGeometry.IsChanged || this.FInTechnique.IsChanged || shaderdata.LayoutValid.Count == 0)
{
shaderdata.Update(this.FInTechnique[0].Index, 0, this.FGeometry);
this.FOutLayoutValid.AssignFrom(shaderdata.LayoutValid);
this.FOutLayoutMsg.AssignFrom(shaderdata.LayoutMsg);
}
if (this.stateconnected && !multistate)
{
context.RenderStateStack.Push(this.FInState[0]);
popstate = true;
}
if (!settings.PreserveShaderStages)
{
shaderdata.ResetShaderStages(ctx);
}
settings.DrawCallCount = spmax; //Set number of draw calls
this.varmanager.ApplyGlobal(shaderdata.ShaderInstance);
//IDX11Geometry drawgeom = null;
objectsettings.Geometry = null;
DX11Resource<IDX11Geometry> pg = null;
for (int i = 0; i < this.spmax; i++)
{
if (multistate)
{
context.RenderStateStack.Push(this.FInState[i]);
}
if (shaderdata.IsLayoutValid(i) || settings.Geometry != null)
{
objectsettings.IterationCount = this.FIter[i];
for (int k = 0; k < objectsettings.IterationCount; k++)
{
objectsettings.IterationIndex = k;
if (settings.Geometry == null)
{
if (this.FGeometry[i] != pg)
{
pg = this.FGeometry[i];
objectsettings.Geometry = pg[context];
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
}
else
{
objectsettings.Geometry = settings.Geometry;
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
//Prepare settings
objectsettings.DrawCallIndex = i;
objectsettings.WorldTransform = this.mworld[i % this.mworldcount];
if (settings.ValidateObject(objectsettings))
{
this.varmanager.ApplyPerObject(context, shaderdata.ShaderInstance, this.objectsettings, i);
shaderdata.ApplyPass(ctx);
if (settings.DepthOnly) { ctx.PixelShader.Set(null); }
objectsettings.Geometry.Draw();
shaderdata.ShaderInstance.CleanUp();
}
}
}
if (multistate)
{
context.RenderStateStack.Pop();
}
}
this.OnEndQuery(context);
}
//this.query.End();
}
if (popstate)
{
context.RenderStateStack.Pop();
}
else
{
//Since shaders can define their own states, reapply top of the stack
context.RenderStateStack.Apply();
}
}
示例2: Render
//.........这里部分代码省略.........
int drawCount = doOrder ? orderedSlices.Count : this.spmax;
if (this.spmax == 0)
{
drawCount = 0;
}
for (int i = 0; i < drawCount; i++)
{
int idx = doOrder ? orderedSlices[i] : i;
if (multistate)
{
context.RenderStateStack.Push(this.FInState[idx]);
}
if (shaderdata.IsLayoutValid(idx) || settings.Geometry != null)
{
objectsettings.IterationCount = this.FIter[idx];
objectsettings.RenderStateTag = this.FInState[idx] != null ? this.FInState[idx].Tag : null;
for (int k = 0; k < objectsettings.IterationCount; k++)
{
objectsettings.IterationIndex = k;
if (settings.Geometry == null)
{
if (this.FGeometry[idx] != pg)
{
pg = this.FGeometry[idx];
objectsettings.Geometry = pg[context];
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, idx);
}
}
else
{
objectsettings.Geometry = settings.Geometry;
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, idx);
}
//Prepare settings
objectsettings.DrawCallIndex = idx;
objectsettings.WorldTransform = this.mworld[idx % this.mworldcount];
if (settings.ValidateObject(objectsettings))
{
this.varmanager.ApplyPerObject(context, shaderdata.ShaderInstance, this.objectsettings, idx);
for (int ip = 0; ip < shaderdata.PassCount;ip++)
{
shaderdata.ApplyPass(ctx, ip);
if (settings.DepthOnly) { ctx.PixelShader.Set(null); }
if (settings.PostPassAction != null) { settings.PostPassAction(context); }
objectsettings.Geometry.Draw();
shaderdata.ShaderInstance.CleanUp();
}
}
}
}
if (multistate)
{
context.RenderStateStack.Pop();
}
if (settings.PostShaderAction != null)
{
settings.PostShaderAction(context);
}
}
if (pipelineState != null)
{
pipelineState.Restore(context);
}
this.OnEndQuery(context);
}
//this.query.End();
}
if (popstate)
{
context.RenderStateStack.Pop();
}
else
{
//Since shaders can define their own states, reapply top of the stack
context.RenderStateStack.Apply();
}
if (this.FInLayer.IsConnected && this.FInEnabled[0])
{
this.FInLayer[0][context].Render(this.FInLayer.PluginIO, context, settings);
}
}
示例3: Render
public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
{
Device device = context.Device;
DeviceContext ctx = context.CurrentDeviceContext;
bool popstate = false;
if (this.FInEnabled[0])
{
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);
//Need to build input layout
if (this.FGeometry.IsChanged || this.FInTechnique.IsChanged || shaderdata.LayoutValid.Count == 0)
{
shaderdata.Update(this.FInTechnique[0].Index, 0, this.FGeometry);
this.FOutLayoutValid.AssignFrom(shaderdata.LayoutValid);
this.FOutLayoutMsg.AssignFrom(shaderdata.LayoutMsg);
}
if (this.stateconnected)
{
context.RenderStateStack.Push(this.FInState[0]);
popstate = true;
}
if (!settings.PreserveShaderStages)
{
shaderdata.ResetShaderStages(ctx);
}
settings.DrawCallCount = spmax; //Set number of draw calls
this.varmanager.ApplyGlobal(shaderdata.ShaderInstance);
//IDX11Geometry drawgeom = null;
objectsettings.Geometry = null;
DX11Resource<IDX11Geometry> pg = null;
for (int i = 0; i < this.spmax; i++)
{
if (shaderdata.IsLayoutValid(i) || settings.Geometry != null)
{
objectsettings.IterationCount = this.FIter[i];
for (int k = 0; k < objectsettings.IterationCount; k++)
{
objectsettings.IterationIndex = k;
if (settings.Geometry == null)
{
if (this.FGeometry[i] != pg)
{
pg = this.FGeometry[i];
objectsettings.Geometry = pg[context];
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
}
else
{
objectsettings.Geometry = settings.Geometry;
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
//Prepare settings
objectsettings.DrawCallIndex = i;
objectsettings.WorldTransform = this.mworld[i % this.mworldcount];
if (settings.ValidateObject(objectsettings))
{
this.varmanager.ApplyPerObject(context, shaderdata.ShaderInstance, this.objectsettings, i);
shaderdata.ApplyPass(ctx);
if (settings.DepthOnly) { ctx.PixelShader.Set(null); }
objectsettings.Geometry.Draw();
shaderdata.ShaderInstance.CleanUp();
}
}
}
}
this.OnEndQuery(context);
}
//this.query.End();
}
if (popstate)
{
context.RenderStateStack.Pop();
}
//.........这里部分代码省略.........