Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="OpenCLSampler"/>.
        /// </summary>
        /// <param name="context"> A <see cref="OpenCLContext"/>. </param>
        /// <param name="normalizedCoords"> The usage state of normalized coordinates when accessing a <see cref="OpenCLImage"/> in a <see cref="OpenCLKernel"/>. </param>
        /// <param name="addressing"> The <see cref="OpenCLImageAddressing"/> mode of the <see cref="OpenCLSampler"/>. Specifies how out-of-range image coordinates are handled while reading. </param>
        /// <param name="filtering"> The <see cref="OpenCLImageFiltering"/> mode of the <see cref="OpenCLSampler"/>. Specifies the type of filter that must be applied when reading data from an image. </param>
        public OpenCLSampler(OpenCLContext context, bool normalizedCoords, OpenCLImageAddressing addressing, OpenCLImageFiltering filtering)
        {
            OpenCLErrorCode error = OpenCLErrorCode.Success;

            Handle = CL10.CreateSampler(context.Handle, normalizedCoords, addressing, filtering, out error);
            OpenCLException.ThrowOnError(error);

            SetID(Handle.Value);

            this.addressing       = addressing;
            this.context          = context;
            this.filtering        = filtering;
            this.normalizedCoords = normalizedCoords;

            //Trace.WriteLine("Create " + this + " in Thread(" + Thread.CurrentThread.ManagedThreadId + ").", "Information");
        }
Esempio n. 2
0
 public extern static CLSamplerHandle CreateSampler(
     CLContextHandle context,
     [MarshalAs(UnmanagedType.Bool)] bool normalized_coords,
     OpenCLImageAddressing addressing_mode,
     OpenCLImageFiltering filter_mode,
     out OpenCLErrorCode errcode_ret);
Esempio n. 3
0
        /// <summary>
        /// Creates a new <see cref="OpenCLSampler"/>.
        /// </summary>
        /// <param name="context"> A <see cref="OpenCLContext"/>. </param>
        /// <param name="normalizedCoords"> The usage state of normalized coordinates when accessing a <see cref="OpenCLImage"/> in a <see cref="OpenCLKernel"/>. </param>
        /// <param name="addressing"> The <see cref="OpenCLImageAddressing"/> mode of the <see cref="OpenCLSampler"/>. Specifies how out-of-range image coordinates are handled while reading. </param>
        /// <param name="filtering"> The <see cref="OpenCLImageFiltering"/> mode of the <see cref="OpenCLSampler"/>. Specifies the type of filter that must be applied when reading data from an image. </param>
        public OpenCLSampler(OpenCLContext context, bool normalizedCoords, OpenCLImageAddressing addressing, OpenCLImageFiltering filtering)
        {
            OpenCLErrorCode error = OpenCLErrorCode.Success;
            Handle = CL10.CreateSampler(context.Handle, normalizedCoords, addressing, filtering, out error);
            OpenCLException.ThrowOnError(error);

            SetID(Handle.Value);
            
            this.addressing = addressing;
            this.context = context;
            this.filtering = filtering;
            this.normalizedCoords = normalizedCoords;

            //Trace.WriteLine("Create " + this + " in Thread(" + Thread.CurrentThread.ManagedThreadId + ").", "Information");
        }
Esempio n. 4
0
 public extern static CLSamplerHandle CreateSampler(
     CLContextHandle context,
     [MarshalAs(UnmanagedType.Bool)] bool normalized_coords,
     OpenCLImageAddressing addressing_mode,
     OpenCLImageFiltering filter_mode,
     out OpenCLErrorCode errcode_ret);