Texture Management

Texture Management#

HIP Runtime API Reference: Texture Management
Texture Management
Collaboration diagram for Texture Management:

Modules

 Texture Management [Deprecated]
 

Functions

hipError_t hipCreateTextureObject (hipTextureObject_t *pTexObject, const hipResourceDesc *pResDesc, const hipTextureDesc *pTexDesc, const struct hipResourceViewDesc *pResViewDesc)
 Creates a texture object.
 
hipError_t hipDestroyTextureObject (hipTextureObject_t textureObject)
 Destroys a texture object.
 
hipError_t hipGetChannelDesc (hipChannelFormatDesc *desc, hipArray_const_t array)
 Gets the channel descriptor in an array.
 
hipError_t hipGetTextureObjectResourceDesc (hipResourceDesc *pResDesc, hipTextureObject_t textureObject)
 Gets resource descriptor for the texture object.
 
hipError_t hipGetTextureObjectResourceViewDesc (struct hipResourceViewDesc *pResViewDesc, hipTextureObject_t textureObject)
 Gets resource view descriptor for the texture object.
 
hipError_t hipGetTextureObjectTextureDesc (hipTextureDesc *pTexDesc, hipTextureObject_t textureObject)
 Gets texture descriptor for the texture object.
 
hipError_t hipTexObjectCreate (hipTextureObject_t *pTexObject, const HIP_RESOURCE_DESC *pResDesc, const HIP_TEXTURE_DESC *pTexDesc, const HIP_RESOURCE_VIEW_DESC *pResViewDesc)
 Creates a texture object.
 
hipError_t hipTexObjectDestroy (hipTextureObject_t texObject)
 Destroys a texture object.
 
hipError_t hipTexObjectGetResourceDesc (HIP_RESOURCE_DESC *pResDesc, hipTextureObject_t texObject)
 Gets resource descriptor of a texture object.
 
hipError_t hipTexObjectGetResourceViewDesc (HIP_RESOURCE_VIEW_DESC *pResViewDesc, hipTextureObject_t texObject)
 Gets resource view descriptor of a texture object.
 
hipError_t hipTexObjectGetTextureDesc (HIP_TEXTURE_DESC *pTexDesc, hipTextureObject_t texObject)
 Gets texture descriptor of a texture object.
 
hipError_t hipMallocMipmappedArray (hipMipmappedArray_t *mipmappedArray, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int numLevels, unsigned int flags)
 Allocate a mipmapped array on the device.
 
hipError_t hipFreeMipmappedArray (hipMipmappedArray_t mipmappedArray)
 Frees a mipmapped array on the device.
 
hipError_t hipGetMipmappedArrayLevel (hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
 Gets a mipmap level of a HIP mipmapped array.
 
hipError_t hipMipmappedArrayCreate (hipMipmappedArray_t *pHandle, HIP_ARRAY3D_DESCRIPTOR *pMipmappedArrayDesc, unsigned int numMipmapLevels)
 Create a mipmapped array.
 
hipError_t hipMipmappedArrayDestroy (hipMipmappedArray_t hMipmappedArray)
 Destroy a mipmapped array.
 
hipError_t hipMipmappedArrayGetLevel (hipArray_t *pLevelArray, hipMipmappedArray_t hMipMappedArray, unsigned int level)
 Get a mipmapped array on a mipmapped level.
 

Detailed Description



This section describes the texture management functions of HIP runtime API.

Function Documentation

◆ hipCreateTextureObject()

hipError_t hipCreateTextureObject ( hipTextureObject_t pTexObject,
const hipResourceDesc pResDesc,
const hipTextureDesc pTexDesc,
const struct hipResourceViewDesc pResViewDesc 
)

Creates a texture object.

Parameters
[out]pTexObjectpointer to the texture object to create
[in]pResDescpointer to resource descriptor
[in]pTexDescpointer to texture descriptor
[in]pResViewDescpointer to resource view descriptor
Returns
hipSuccess, hipErrorInvalidValue, hipErrorNotSupported, hipErrorOutOfMemory
Note
3D linear filter isn't supported on GFX90A boards, on which the API hipCreateTextureObject will return hipErrorNotSupported.

◆ hipDestroyTextureObject()

hipError_t hipDestroyTextureObject ( hipTextureObject_t  textureObject)

Destroys a texture object.

Parameters
[in]textureObjecttexture object to destroy
Returns
hipSuccess, hipErrorInvalidValue

◆ hipFreeMipmappedArray()

hipError_t hipFreeMipmappedArray ( hipMipmappedArray_t  mipmappedArray)

Frees a mipmapped array on the device.

Parameters
[in]mipmappedArray- Pointer to mipmapped array to free
Returns
hipSuccess, hipErrorInvalidValue
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipGetChannelDesc()

hipError_t hipGetChannelDesc ( hipChannelFormatDesc desc,
hipArray_const_t  array 
)

Gets the channel descriptor in an array.

Parameters
[in]descpointer to channel format descriptor
[out]arraymemory array on the device
Returns
hipSuccess, hipErrorInvalidValue

◆ hipGetMipmappedArrayLevel()

hipError_t hipGetMipmappedArrayLevel ( hipArray_t levelArray,
hipMipmappedArray_const_t  mipmappedArray,
unsigned int  level 
)

Gets a mipmap level of a HIP mipmapped array.

Parameters
[out]levelArray- Returned mipmap level HIP array
[in]mipmappedArray- HIP mipmapped array
[in]level- Mipmap level
Returns
hipSuccess, hipErrorInvalidValue
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipGetTextureObjectResourceDesc()

hipError_t hipGetTextureObjectResourceDesc ( hipResourceDesc pResDesc,
hipTextureObject_t  textureObject 
)

Gets resource descriptor for the texture object.

Parameters
[out]pResDescpointer to resource descriptor
[in]textureObjecttexture object
Returns
hipSuccess, hipErrorInvalidValue

◆ hipGetTextureObjectResourceViewDesc()

hipError_t hipGetTextureObjectResourceViewDesc ( struct hipResourceViewDesc pResViewDesc,
hipTextureObject_t  textureObject 
)

Gets resource view descriptor for the texture object.

Parameters
[out]pResViewDescpointer to resource view descriptor
[in]textureObjecttexture object
Returns
hipSuccess, hipErrorInvalidValue

◆ hipGetTextureObjectTextureDesc()

hipError_t hipGetTextureObjectTextureDesc ( hipTextureDesc pTexDesc,
hipTextureObject_t  textureObject 
)

Gets texture descriptor for the texture object.

Parameters
[out]pTexDescpointer to texture descriptor
[in]textureObjecttexture object
Returns
hipSuccess, hipErrorInvalidValue

◆ hipMallocMipmappedArray()

hipError_t hipMallocMipmappedArray ( hipMipmappedArray_t *  mipmappedArray,
const struct hipChannelFormatDesc desc,
struct hipExtent  extent,
unsigned int  numLevels,
unsigned int  flags 
)

Allocate a mipmapped array on the device.

Parameters
[out]mipmappedArray- Pointer to allocated mipmapped array in device memory
[in]desc- Requested channel format
[in]extent- Requested allocation size (width field in elements)
[in]numLevels- Number of mipmap levels to allocate
[in]flags- Flags for extensions
Returns
hipSuccess, hipErrorInvalidValue, hipErrorMemoryAllocation
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipMipmappedArrayCreate()

hipError_t hipMipmappedArrayCreate ( hipMipmappedArray_t *  pHandle,
HIP_ARRAY3D_DESCRIPTOR pMipmappedArrayDesc,
unsigned int  numMipmapLevels 
)

Create a mipmapped array.

Parameters
[out]pHandlepointer to mipmapped array
[in]pMipmappedArrayDescmipmapped array descriptor
[in]numMipmapLevelsmipmap level
Returns
hipSuccess, hipErrorNotSupported, hipErrorInvalidValue
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipMipmappedArrayDestroy()

hipError_t hipMipmappedArrayDestroy ( hipMipmappedArray_t  hMipmappedArray)

Destroy a mipmapped array.

Parameters
[out]hMipmappedArraypointer to mipmapped array to destroy
Returns
hipSuccess, hipErrorInvalidValue
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipMipmappedArrayGetLevel()

hipError_t hipMipmappedArrayGetLevel ( hipArray_t pLevelArray,
hipMipmappedArray_t  hMipMappedArray,
unsigned int  level 
)

Get a mipmapped array on a mipmapped level.

Parameters
[in]pLevelArrayPointer of array
[out]hMipMappedArrayPointer of mipmapped array on the requested mipmap level
[out]levelMipmap level
Returns
hipSuccess, hipErrorInvalidValue
Note
This API is implemented on Linux and is under development on Microsoft Windows.

◆ hipTexObjectCreate()

hipError_t hipTexObjectCreate ( hipTextureObject_t pTexObject,
const HIP_RESOURCE_DESC pResDesc,
const HIP_TEXTURE_DESC pTexDesc,
const HIP_RESOURCE_VIEW_DESC pResViewDesc 
)

Creates a texture object.

Parameters
[out]pTexObjectpointer to texture object to create
[in]pResDescpointer to resource descriptor
[in]pTexDescpointer to texture descriptor
[in]pResViewDescpointer to resource view descriptor
Returns
hipSuccess, hipErrorInvalidValue

◆ hipTexObjectDestroy()

hipError_t hipTexObjectDestroy ( hipTextureObject_t  texObject)

Destroys a texture object.

Parameters
[in]texObjecttexture object to destroy
Returns
hipSuccess, hipErrorInvalidValue

◆ hipTexObjectGetResourceDesc()

hipError_t hipTexObjectGetResourceDesc ( HIP_RESOURCE_DESC pResDesc,
hipTextureObject_t  texObject 
)

Gets resource descriptor of a texture object.

Parameters
[out]pResDescpointer to resource descriptor
[in]texObjecttexture object
Returns
hipSuccess, hipErrorNotSupported, hipErrorInvalidValue

◆ hipTexObjectGetResourceViewDesc()

hipError_t hipTexObjectGetResourceViewDesc ( HIP_RESOURCE_VIEW_DESC pResViewDesc,
hipTextureObject_t  texObject 
)

Gets resource view descriptor of a texture object.

Parameters
[out]pResViewDescpointer to resource view descriptor
[in]texObjecttexture object
Returns
hipSuccess, hipErrorNotSupported, hipErrorInvalidValue

◆ hipTexObjectGetTextureDesc()

hipError_t hipTexObjectGetTextureDesc ( HIP_TEXTURE_DESC pTexDesc,
hipTextureObject_t  texObject 
)

Gets texture descriptor of a texture object.

Parameters
[out]pTexDescpointer to texture descriptor
[in]texObjecttexture object
Returns
hipSuccess, hipErrorNotSupported, hipErrorInvalidValue