Exemplo n.º 1
0
		/// <summary>
		/// Creates a texture object. ResDesc describes the data to texture from. TexDesc
		/// describes how the data should be sampled. resViewDesc is an optional argument that specifies an alternate format
		/// for the data described by pResDesc, and also describes the subresource region to restrict access to when texturing.
		/// pResViewDesc can only be specified if the type of resource is a CUDA array or a CUDA mipmapped array.
		/// </summary>
		/// <param name="resDesc">Describes the data to texture from.</param>
		/// <param name="texDesc">Describes how the data should be sampled.</param>
		/// <param name="resViewDesc">CudaResourceViewDesc. Only valid if type of resource is a CUDA array or a CUDA mipmapped array</param>
		public CudaTexObject(CudaResourceDesc resDesc, CudaTextureDescriptor texDesc, CudaResourceViewDesc resViewDesc)
		{
			_resDesc = resDesc;
			_texDesc = texDesc;
			_resViewDesc = resViewDesc;

			_texObject = new CUtexObject();
			res = DriverAPINativeMethods.TextureObjects.cuTexObjectCreate(ref _texObject, ref _resDesc, ref _texDesc, ref _resViewDesc);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexObjectCreate", res));
			if (res != CUResult.Success) throw new CudaException(res);


		}
Exemplo n.º 2
0
			public static extern CUResult cuTexObjectGetResourceViewDesc(ref CudaResourceViewDesc pResViewDesc, CUtexObject texObject);
Exemplo n.º 3
0
			public static extern CUResult cuTexObjectCreate(ref CUtexObject pTexObject, ref CudaResourceDesc pResDesc, ref CudaTextureDescriptor pTexDesc, ref CudaResourceViewDesc pResViewDesc);