Skip to main content

cuTexObjectCreate

Function cuTexObjectCreate 

Source
pub unsafe extern "C" fn cuTexObjectCreate(
    pTexObject: *mut CUtexObject,
    pResDesc: *const CUDA_RESOURCE_DESC,
    pTexDesc: *const CUDA_TEXTURE_DESC,
    pResViewDesc: *const CUDA_RESOURCE_VIEW_DESC,
) -> CUresult
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 CUDA_RESOURCE_DESC structure is defined as:

The CUDA_TEXTURE_DESC struct is defined as

The CUDA_RESOURCE_VIEW_DESC struct is defined as.

ยงParameters

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