/// <summary> /// Loads at specific address with mipmap and offset. /// </summary> public T Load([NotNull] Integerx4 position, Integerx3 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])); }
/// <summary> /// Sample at specific address. /// </summary> public T Sample([NotNull] SamplerBinder sampler, [NotNull] Floatx3 address, Integerx3 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])); }
/// <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)); }
/// <summary> /// Loads at specific address with mipmap. /// </summary> public T Load([NotNull] Integerx3 position) { return(Load(position, null)); }