Skip to main content

cudaCreateTextureObject

Function cudaCreateTextureObject 

Source
pub unsafe extern "C" fn cudaCreateTextureObject(
    pTexObject: *mut cudaTextureObject_t,
    pResDesc: *const cudaResourceDesc,
    pTexDesc: *const cudaTextureDesc,
    pResViewDesc: *const cudaResourceViewDesc,
) -> cudaError_t
Expand description

Creates a texture object.

Creates a texture object and returns it in pTexObject. pResDesc describes the data to texture from. pTexDesc describes how the data should be sampled. pResViewDesc 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 not in a block compressed format.

Texture objects are only supported on devices of compute capability 3.0 or higher. Additionally, a texture object is an opaque value, and, as such, should only be accessed through CUDA API calls.

The cudaResourceDesc structure is defined as:

The cudaTextureDesc struct is defined as

The cudaResourceViewDesc struct is defined as.

ยงParameters

  • pTexObject: Texture object to create.
  • pResDesc: Resource descriptor.
  • pTexDesc: Texture descriptor.
  • pResViewDesc: Resource view descriptor.