Ejemplo n.º 1
0
        /// <summary>
        /// Loads at specific address with mipmap and offset.
        /// </summary>
        public T Load([NotNull] Integerx3 position, Integerx2 offset)
        {
            if (position.Generator != this.Generator ||
                ((object)offset != null && offset.Generator != this.Generator))
            {
                throw new ArgumentException("Mixing generators not allowed.");
            }

            LoadOperation op = new LoadOperation();

            if ((object)offset != null)
            {
                op.BindInputs(pin, position.Pin, offset.Pin);
            }
            else
            {
                op.BindInputs(pin, position.Pin);
            }
            return((T)this.Generator.CreateFrom(op.Outputs[0]));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sample at specific address.
        /// </summary>
        public T Sample([NotNull] SamplerBinder sampler, [NotNull] Floatx2 address, Integerx2 offset)
        {
            if (address.Generator != this.Generator ||
                ((object)offset != null && offset.Generator != this.Generator) ||
                sampler.Generator != this.Generator)
            {
                throw new ArgumentException("Mixing generators not allowed.");
            }

            SampleOperation op = new SampleOperation();

            if ((object)offset != null)
            {
                op.BindInputs(sampler.Pin, pin, address.Pin, offset.Pin);
            }
            else
            {
                op.BindInputs(sampler.Pin, pin, address.Pin);
            }
            return((T)this.Generator.CreateFrom(op.Outputs[0]));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads at specific address at mipmap 0.
        /// </summary>
        public T Load([NotNull] Integerx2 position)
        {
            Integerx3 addr = position.Generator.Expand <Integerx3>(position, ExpandType.AddZeros);

            return(Load(addr));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Loads at specific address with mipmap.
 /// </summary>
 public T Load([NotNull] Integerx2 position)
 {
     return(Load(position, null));
 }