mul - HLSL
Performs matrix multiplication between x and y. If x is a vector, it treated as a row vector. If y is a vector, it is treated as a column vector. The inner dimension x-columns and y-rows must be equal. The result has the dimension x-rows x y-columns.
Syntax
There are 9 overloaded versions of this function, to handle the different cases for the types and sizes of the x and y input arguments. The following table lists these versions.
Version |
Name |
Purpose |
Template Type |
Component Type |
Size |
1 |
|
|
|
|
|
|
x |
in |
scalar |
float, int |
1 |
|
y |
in |
scalar |
same as input x |
1 |
|
ret |
out |
scalar |
same as input x |
1 |
2 |
|
|
|
|
|
|
x |
in |
scalar |
float, int |
1 |
|
y |
in |
vector |
float, int |
any |
|
ret |
out |
vector |
float, int |
same dimension(s) as input y |
3 |
|
|
|
|
|
|
x |
in |
scalar |
float, int |
1 |
|
y |
in |
matrix |
float, int |
any |
|
ret |
out |
matrix |
same as input y |
same dimension(s) as input y |
4 |
|
|
|
|
|
|
x |
in |
vector |
float, int |
any |
|
y |
in |
scalar |
float, int |
1 |
|
ret |
out |
vector |
float, int |
same dimension(s) as input x |
5 |
|
|
|
|
|
|
x |
in |
vector |
float, int |
any |
|
y |
in |
vector |
float, int |
same dimension(s) as input x |
|
ret |
out |
scalar |
float, int |
1 |
6 |
|
|
|
|
|
|
x |
in |
vector |
float, int |
any |
|
y |
in |
matrix |
float, int |
rows = same dimension(s) as input x, columns = any |
|
ret |
out |
vector |
float, int |
same dimension(s) as input y columns |
7 |
|
|
|
|
|
|
x |
in |
matrix |
float, int |
any |
|
y |
in |
scalar |
float, int |
1 |
|
ret |
out |
matrix |
float, int |
same dimension(s) as input x |
8 |
|
|
|
|
|
|
x |
in |
matrix |
float, int |
any |
|
y |
in |
vector |
float, int |
number of columns in input x |
|
ret |
out |
vector |
float, int |
number of rows in input x |
9 |
|
|
|
|
|
|
x |
in |
matrix |
float, int |
any |
|
y |
in |
matrix |
float, int |
rows = number of columns in input x |
|
ret |
out |
matrix |
float, int |
rows = number of rows in input x, columns = number of columns in input y |
Minimum Shader Version
This intrinsic function is supported in the following (or above) shader versions:
Vertex Shader |
Pixel Shader |
vs_1_1 |
ps_1_1 |
See Also
HLSL Intrinsic Functions