Example #1
0
        protected void InitBase(ref ComputeStateDesc desc)
        {
            int constantBufferCount = desc.constantBuffers != null ? desc.constantBuffers.Length : 0;

            if (desc.computeShader.constantBufferCount != constantBufferCount)
            {
                throw new ArgumentException("ComputeStateDesc constant-buffer count doesn't match ComputeShader requirements");
            }

            int textureCount = desc.textures != null ? desc.textures.Length : 0;

            if (desc.computeShader.textureCount != textureCount)
            {
                throw new ArgumentException("ComputeStateDesc texture count doesn't match ComputeShader requirements");
            }

            int randomAccessBufferCount = desc.randomAccessBuffers != null ? desc.randomAccessBuffers.Length : 0;

            if (desc.computeShader.randomAccessBufferCount != randomAccessBufferCount)
            {
                throw new ArgumentException("ComputeStateDesc random access buffer count doesn't match ComputeShader requirements");
            }
        }
Example #2
0
 public abstract ComputeStateBase CreateComputeState(ComputeStateDesc desc);