CopyTexture2DResourceLinearToBlock

nn::gd::CTR::Memory::CopyTexture2DResourceLinearToBlock Member Function

Syntax

static nnResult CopyTexture2DResourceLinearToBlock(
     u8 * srcAddr,
     u32 width,
     u32 height,
     const Texture2DResource * dest,
     s32 dstMipLevelIndex,
     u32 dstOffestY
);

Arguments

Name Description
in srcAddr Specifies the source address.
in width Specifies the width of data to be transferred. This value must be equal to or less than the width of the destination. (Including dstMipLevelIndex)
in height Specifies the height to transfer. This value must be equal to or less than the height of the destination. (Including dstMipLevelIndex and dstOffsetY)
in dest Pointer to the destination Texture2DResource resource.
in dstMipLevelIndex Specifies the index of the mipmap level of the transfer destination. If -1 is specified, the last mipmap level index is used.
in dstOffestY Specifies the Y offset of the transfer destination.

Return Values

Returns the result of the operation.
Value Description
Result::IsSuccess Process was successful.
ResultNullParameter NULL was specified for srcAddr or dest.
ResultInvalidMemoryLayout The destination memory layout is not LAYOUT_BLOCK_8 or LAYOUT_BLOCK_32.
ResultInvalidTextureMipLevelIndex The index of the destination mipmap level is invalid.
ResultInvalidTextureResolution dstOffsetY or the height or width of the source is not a multiple of the memory layout. Or, if the pixel format size of the source resource is 24-bit, the height of the destination resource is not a multiple of 32. Or, the resolution of the source and destination have different pixel sizes.
ResultInvalidTextureOffset The source offset is larger than the height of the resource.
ResultInvalidTextureFormat The pixel format of the destination mipmap level is invalid.

Description

Adds a command for converting the image at the specified address from a linear image to a block image and transferring it to the destination Texture2DResource to the current command list.

The following transfer destination pixel formats can be specified:
NATIVE_FORMAT_RGBA_8888
NATIVE_FORMAT_RGB_888
NATIVE_FORMAT_RGBA_4444
NATIVE_FORMAT_RGBA_5551
NATIVE_FORMAT_RGB_565
The memory layout of the transfer source must be LAYOUT_LINEAR. The transfer destination memory layout must be either LAYOUT_BLOCK_8 or LAYOUT_BLOCK_32. If the pixel size of the transfer destination image is 24 bits, the width must be a multiple of 32. This process calls the nngxAddL2BTransferCommand function. This function adds commands to the command list. Refer to the Programming Manual for details.

Revision History

2011/02/21
Initial version.

CONFIDENTIAL