Share via


mul

使用矩陣數學乘以 x 和 y。 內部維度 x-columns 和 y-rows 必須相等。

ret mul (x, y)

參數

項目 描述
X
[in]x 輸入值。 如果 x 是向量,則會將它視為資料列向量。
Y
[in]y 輸入值。 如果 y 是向量,則會將其視為資料行向量。

傳回值

x 次 y 的結果。 結果具有維度 x-rows x y-columns。

類型描述

此函式有 9 個多載版本;多載版本會處理輸入引數類型和大小的不同案例。

版本 名稱 目的 範本類型 元件類型 大小
1
x in 純量 (scalar) float、int 1
y in 純量 (scalar) 與輸入 x 相同 1
Ret out 純量 (scalar) 與輸入 x 相同 1
2
x in 純量 (scalar) float、int 1
y in 向量 float、int 任意
Ret out 向量 float、int 與輸入 y 相同的維度 (s)
3
x in 純量 (scalar) float、int 1
y in 矩陣 float、int 任意
Ret out 矩陣 與輸入 y 相同 與輸入 y 相同的維度 (s)
4
x in 向量 float、int 任意
y in 純量 (scalar) float、int 1
Ret out 向量 float、int 與輸入 x 相同的維度 ()
5
x in 向量 float、int 任意
y in 向量 float、int 與輸入 x 相同的維度 ()
Ret out 純量 (scalar) float、int 1
6
x in 向量 float、int 任意
y in 矩陣 float、int rows = 與輸入 x 相同的維度 () ,資料行 = 任何
Ret out 向量 float、int 與輸入 y 資料行相同的維度 ()
7
x in 矩陣 float、int 任意
y in 純量 (scalar) float、int 1
Ret out 矩陣 float、int 與輸入 x 相同的維度 ()
8
x in 矩陣 float、int 任意
y in 向量 float、int 輸入 x 中的資料行數目
Ret out 向量 float、int 輸入 x 中的資料列數目
9
x in 矩陣 float、int 任意
y in 矩陣 float、int rows = 輸入 x 中的資料行數目
Ret out 矩陣 float、int rows = 輸入 x 中的資料列數目,資料行 = 輸入 y 中的資料行數目

最小著色器模型

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

著色器模型 支援
著色器模型 1 (DirectX HLSL) 和更高的著色器模型

另請參閱

DirectX HLSL (內建函式)