GetDimensions (DirectX HLSL 紋理物件)

取得紋理大小資訊。 語法區塊會顯示方法宣告中可能的所有參數。 一節中的表格會顯示針對每個紋理物件類型實作的參數。

void Object.GetDimensions ( UINT MipLevel, typeX Width, typeX Height, typeX Elements, typeX Depth, typeX NumberOfLevels, typeX NumberOfSamples ) ;

typeX 表示有兩種可能的類型: uintfloat

參數

項目 描述
物件
Buffer物件以外的任何紋理物件類型。
MipLevel
[in]識別 mipmap 層級之以零起始的索引。 如果未使用此引數,則會假設第一個 mip 層級。
寬度
[out]紋理寬度,以紋素表示。
高度
[out]紋理高度,以紋素表示。
元素
[out]陣列中的專案數目。
深度
[out]紋理深度,以紋素表示。
NumberOfLevels
[out]mipmap 層級的數目。
NumberOfSamples
[out]樣本數目。

傳回值

多載方法

下表列出方法的所有不同版本;版本與輸入參數的數目不同。 請注意,對於採用整數參數的每個方法,都有採用浮點參數的多載方法。

Texture-Object類型 輸入參數
Texture1D UINT MipLevel、UINT Width、UINT NumberOfLevels
Texture1D UINT 寬度
Texture1D UINT MipLevel, float Width, float NumberOfLevels
Texture1D float Width
Texture1DArray UINT MipLevel、UINT Width、UINT 元素、UINT NumberOfLevels
Texture1DArray UINT 寬度、UINT 元素
Texture1DArray UINT MipLevel, float Width, float Elements, float NumberOfLevels
Texture1DArray float Width、float Elements
Texture2D UINT MipLevel、UINT Width、UINT Height、UINT NumberOfLevels
Texture2D UINT 寬度、UINT 高度
Texture2D UINT MipLevel, float Width, float Height, float NumberOfLevels
Texture2D float Width、float Height
Texture2DArray UINT MipLevel、UINT Width、UINT Height、UINT Elements、UINT NumberOfLevels
Texture2DArray UINT 寬度、UINT 高度、UINT 元素
Texture2DArray UINT MipLevel, float Width, float Height, float Elements, float NumberOfLevels
Texture2DArray float Width, float Height, float Elements
Texture3D UINT MipLevel、UINT Width、UINT Height、UINT Depth、UINT NumberOfLevels
Texture3D UINT 寬度、UINT 高度、UINT 深度
Texture3D UINT MipLevel, float Width, float Height, float Depth, float NumberOfLevels
Texture3D float Width, float Height, float Depth
TextureCube UINT MipLevel、UINT Width、UINT Height、UINT NumberOfLevels
TextureCube UINT 寬度、UINT 高度
TextureCube UINT 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 寬度、UINT 高度、UINT 元素
TextureCubeArray UINT MipLevel, float Width, float Height, float Elements, float NumberOfLevels
TextureCubeArray float Width, float Height, float Elements
Texture2DMS UINT 寬度、UINT 高度、UINT 範例
Texture2DMS float Width, float Height, float Samples
Texture2DMSArray UINT Width、UINT Height、UINT 元素、UINT 範例
Texture2DMSArray float Width, float Height, float Elements, float Samples

最小著色器模型

下列著色器模型中支援此函式。

vs_4_0 vs_4_1 ps_4_0 ps_4_1 gs_4_0 gs_4_1
x x x x x x
  1. 傳回最大 () mipmap 層級的維度。
  2. TextureCubeArray 可在著色器模型 4.1 或更高版本中使用。
  3. 著色器模型 4.1 可在 Direct3D 10.1 或更高版本中使用。

Texture-Object