本文整理汇总了C#中SharpDX.SetShaderResource方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.SetShaderResource方法的具体用法?C# SharpDX.SetShaderResource怎么用?C# SharpDX.SetShaderResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX
的用法示例。
在下文中一共展示了SharpDX.SetShaderResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearTargets
private void ClearTargets(RenderTargetBinding[] targets, SharpDX.Direct3D11.CommonShaderStage shaderStage)
{
// NOTE: We make the assumption here that the caller has
// locked the d3dContext for us to use.
// We assume 4 targets to avoid a loop within a loop below.
var target0 = targets[0].RenderTarget;
var target1 = targets[1].RenderTarget;
var target2 = targets[2].RenderTarget;
var target3 = targets[3].RenderTarget;
// Make one pass across all the texture slots.
for (var i = 0; i < _textures.Length; i++)
{
if (_textures[i] == null)
continue;
if (_textures[i] != target0 &&
_textures[i] != target1 &&
_textures[i] != target2 &&
_textures[i] != target3)
continue;
// Immediately clear the texture from the device.
_dirty &= ~(1 << i);
_textures[i] = null;
shaderStage.SetShaderResource(i, null);
}
}