本文整理汇总了C#中Axiom.Graphics.GpuProgramParameters.CopySharedParams方法的典型用法代码示例。如果您正苦于以下问题:C# GpuProgramParameters.CopySharedParams方法的具体用法?C# GpuProgramParameters.CopySharedParams怎么用?C# GpuProgramParameters.CopySharedParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Graphics.GpuProgramParameters
的用法示例。
在下文中一共展示了GpuProgramParameters.CopySharedParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindGpuProgramParameters
public override void BindGpuProgramParameters( GpuProgramType type, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
{
if ( ( mask & GpuProgramParameters.GpuParamVariability.Global ) == GpuProgramParameters.GpuParamVariability.Global )
{
//Just copy
parms.CopySharedParams();
}
switch ( type )
{
case GpuProgramType.Vertex:
activeVertexGpuProgramParameters = parms;
this.currentVertexProgram.BindProgramParameters( parms, (uint) mask );
break;
case GpuProgramType.Fragment:
activeFragmentGpuProgramParameters = parms;
this.currentFragmentProgram.BindProgramParameters( parms, (uint) mask );
break;
case GpuProgramType.Geometry:
default:
break;
}
}
示例2: BindGpuProgramParameters
public override void BindGpuProgramParameters(GpuProgramType gptype, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability variability)
{
// special case pass iteration
if (variability == GpuProgramParameters.GpuParamVariability.PassIterationNumber)
{
BindGpuProgramPassIterationParameters(gptype);
return;
}
if ((variability & GpuProgramParameters.GpuParamVariability.Global) != 0)
{
// D3D9 doesn't support shared constant buffers, so use copy routine
parms.CopySharedParams();
}
switch ( gptype )
{
case GpuProgramType.Vertex:
activeVertexGpuProgramParameters = parms;
if ( parms.HasFloatConstants )
{
for ( var index = 0; index < parms.FloatConstantCount; index++ )
{
var entry = parms.GetFloatConstant( index );
if ( entry.isSet )
{
ActiveD3D9Device.SetVertexShaderConstant(index, entry.val, 0, 1);
}
}
}
if (parms.HasIntConstants)
{
for (var index = 0; index < parms.IntConstantCount; index++)
{
var entry = parms.GetIntConstant(index);
if (entry.isSet)
{
ActiveD3D9Device.SetVertexShaderConstant(index, entry.val, 0, 1);
}
}
}
break;
case GpuProgramType.Fragment:
activeFragmentGpuProgramParameters = parms;
if (parms.HasFloatConstants)
{
for (var index = 0; index < parms.FloatConstantCount; index++)
{
var entry = parms.GetFloatConstant(index);
if (entry.isSet)
{
ActiveD3D9Device.SetPixelShaderConstant(index, entry.val, 0, 1);
}
}
}
if ( parms.HasIntConstants )
{
for ( var index = 0; index < parms.IntConstantCount; index++ )
{
var entry = parms.GetIntConstant( index );
if ( entry.isSet )
{
ActiveD3D9Device.SetPixelShaderConstant(index, entry.val, 0, 1);
}
}
}
break;
}
}
示例3: BindGpuProgramParameters
public override void BindGpuProgramParameters( GpuProgramType type, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
{
if ((mask & GpuProgramParameters.GpuParamVariability.Global) != 0)
{
// We could maybe use GL_EXT_bindable_uniform here to produce Dx10-style
// shared constant buffers, but GPU support seems fairly weak?
// for now, just copy
parms.CopySharedParams();
}
// store the current program in use for eas unbinding later);
switch (type)
{
case GpuProgramType.Vertex:
activeVertexGpuProgramParameters = parms;
currentVertexProgram.BindProgramParameters( parms, mask );
break;
case GpuProgramType.Geometry:
activeGeometryGpuProgramParameters = parms;
currentGeometryProgram.BindProgramParameters(parms, mask);
break;
case GpuProgramType.Fragment:
activeFragmentGpuProgramParameters = parms;
currentFragmentProgram.BindProgramParameters(parms, mask);
break;
}
}