コード例 #1
0
        public void RunChainedCS(ShaderResourceView source, TexturePingPong resources, string[] names, ComputeConfig[] configuration = null)
        {
            long dispatchTicks = 0;
            ShaderResourceView input = source;

            if (configuration != null && names.Length != configuration.Length)
                throw new ArgumentOutOfRangeException("configuration", "If not null, configuration must have the same number of elements as names");

            for (var i = 0; i < names.Length; i++)
            {
                var name = names[i];
                if (configuration != null)
                {
                    this.Constants = configuration[i].Constants;
                    this.ThreadsX = configuration[i].ThreadsX;
                    this.ThreadsY = configuration[i].ThreadsY;
                }
                RunCS(name, input, resources.GetNextAsUAV());
                dispatchTicks += LastDispatchTicks;
                input = resources.GetCurrentAsSRV();
            }
            LastDispatchTicks = dispatchTicks;
        }
コード例 #2
0
 public void RunChainedCS(TexturePingPong resources, string[] names, ComputeConfig[] configuration = null)
 {
     RunChainedCS(sourceTextureSRV, resources, names, configuration);
 }