mul - HLSL
Microsoft DirectX 9.0 SDK Update (October 2004)

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

ret mul(x, y)

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.

VersionNamePurposeTemplate TypeComponent TypeSize
1
xinscalarfloat, int1
yinscalarsame as input x1
retoutscalarsame as input x1
2
xinscalarfloat, int1
yinvectorfloat, intany
retoutvectorfloat, intsame dimension(s) as input y
3
xinscalarfloat, int1
yinmatrixfloat, intany
retoutmatrixsame as input ysame dimension(s) as input y
4
xinvectorfloat, intany
yinscalarfloat, int1
retoutvectorfloat, intsame dimension(s) as input x
5
xinvectorfloat, intany
yinvectorfloat, intsame dimension(s) as input x
retoutscalarfloat, int1
6
xinvectorfloat, intany
yinmatrixfloat, introws = same dimension(s) as input x, columns = any
retoutvectorfloat, intsame dimension(s) as input y columns
7
xinmatrixfloat, intany
yinscalarfloat, int1
retoutmatrixfloat, intsame dimension(s) as input x
8
xinmatrixfloat, intany
yinvectorfloat, intnumber of columns in input x
retoutvectorfloat, intnumber of rows in input x
9
xinmatrixfloat, intany
yinmatrixfloat, introws = number of columns in input x, columns = number of rows in input x
retoutmatrixfloat, introws = 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 ShaderPixel Shader
vs_1_1ps_1_1


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.