GetDimensions (DirectX HLSL Texture Object)

Gets texture size information. The syntax block shows all the parameters that are possible in the method declaration. The table in the Remarks section shows which parameters are implemented for each texture-object type.

void Object.GetDimensions(

UINT MipLevel,

typeX Width,

typeX Height,

typeX Elements,

typeX Depth,

typeX NumberOfLevels,

typeX NumberOfSamples

);

 

typeX denotes that there are two possible types: uint or float.

Parameters

ItemDescription

Object

Any texture-object type except a Buffer object.

MipLevel

[in] A zero-based index that identifies the mipmap level. If this argument is not used, the first mip level is assumed.

Width

[out] The texture width, in texels.

Height

[out] The texture height, in texels.

Elements

[out] The number of elements in an array.

Depth

[out] The texture depth, in texels.

NumberOfLevels

[out] The number of mipmap levels.

NumberOfSamples

[out] The number of samples.

 

Return Value

None

Overloaded Methods

This table lists all the different versions of the method; versions differs by the number of input parameters. Notice that for every method that takes integer parameters, there is an overloaded method that takes floating-point parameters.

Texture-Object TypeInput Parameters
Texture1DUINT MipLevel, UINT Width, UINT NumberOfLevels
Texture1D¹UINT Width
Texture1DUINT MipLevel, float Width, float NumberOfLevels
Texture1D¹float Width
Texture1DArrayUINT MipLevel, UINT Width, UINT Elements, UINT NumberOfLevels
Texture1DArray¹UINT Width, UINT Elements
Texture1DArrayUINT MipLevel, float Width, float Elements, float NumberOfLevels
Texture1DArray¹float Width, float Elements
Texture2DUINT MipLevel, UINT Width, UINT Height, UINT NumberOfLevels
Texture2D¹UINT Width, UINT Height
Texture2DUINT MipLevel, float Width, float Height, float NumberOfLevels
Texture2D¹float Width, float Height
Texture2DArrayUINT MipLevel, UINT Width, UINT Height, UINT Elements, UINT NumberOfLevels
Texture2DArray¹UINT Width, UINT Height, UINT Elements
Texture2DArrayUINT MipLevel, float Width, float Height, float Elements, float NumberOfLevels
Texture2DArray¹float Width, float Height, float Elements
Texture3DUINT MipLevel, UINT Width, UINT Height, UINT Depth, UINT NumberOfLevels
Texture3D¹UINT Width, UINT Height, UINT Depth
Texture3DUINT MipLevel, float Width, float Height, float Depth, float NumberOfLevels
Texture3D¹float Width, float Height, float Depth
TextureCubeUINT MipLevel, UINT Width, UINT Height, UINT NumberOfLevels
TextureCube¹UINT Width, UINT Height
TextureCubeUINT MipLevel, float Width, float Height, UINT NumberOfLevels
TextureCube¹float Width, float Height
TextureCubeArray²UINT MipLevel, UINT Width, UINT Height, UINT Elements, UINT NumberOfLevels
TextureCubeArray ¹²UINT Width, UINT Height, UINT Elements
TextureCubeArray²UINT MipLevel, float Width, float Height, float Elements, float NumberOfLevels
TextureCubeArray¹²float Width, float Height, float Elements
Texture2DMS¹UINT Width, UINT Height, UINT Samples
Texture2DMS¹float Width, float Height, float Samples
Texture2DMSArray¹UINT Width, UINT Height, UINT Elements, UINT Samples
Texture2DMSArray¹float Width, float Height, float Elements, float Samples

 

Minimum Shader Model

This function is supported in the following shader models.

vs_4_0vs_4_1³ps_4_0ps_4_1³gs_4_0gs_4_1³
xxxxxx

 

  1. Returns dimensions for the largest (zeroth) mipmap level.
  2. TextureCubeArray is available in Shader Model 4.1 or higher.
  3. Shader Model 4.1 is available in Direct3D 10.1 or higher.

Related topics

Texture-Object

 

 

Show: