-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce really rough linalg matrix proposal #404
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT, a great starting point for discussions.
necessarily what they do. One big part of this proposal is to take 5 steps back | ||
and talk about what they do: linear algebra. | ||
|
||
## Motivation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth calling out relationship to https://github.com/microsoft/hlsl-specs/blob/main/proposals/0031-hlsl-vector-matrix-operations.md?
Matrix operator+(Matrix); | ||
Matrix operator-(Matrix); | ||
Matrix operator*(Matrix); | ||
Matrix operator/(Matrix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does operator/
do on a matrix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elementwise division, will add comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the operators are element wise aligning with our conventions for vector
and matrix
types.
template <typename T> | ||
requires ArithmeticScalar<T> | ||
Matrix operator+(T); | ||
template <typename T> | ||
requires ArithmeticScalar<T> | ||
Matrix operator-(T); | ||
template <typename T> | ||
requires ArithmeticScalar<T> | ||
Matrix operator*(T); | ||
template <typename T> | ||
requires ArithmeticScalar<T> | ||
Matrix operator/(T); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these element-wise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I'll add comments. This aligns with our convention for matrix and vector operators for other builtin types
requires ArithmeticScalar<T> | ||
Matrix operator/(T); | ||
|
||
static Matrix Splat(ElTy Val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static Matrix Splat(ElTy Val); | |
static Matrix Splat(ComponentTy Val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I suspect that this code might have used all of T
, ElTy
and ComponentTy
at some point to refer to the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... yea I crossed some template wires. Let me do fix that.
|
||
## Detailed design | ||
|
||
## Outstanding Questions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Support for packed types?
- Support for other number formats that aren't natively supported by HLSL?
Co-authored-by: Damyan Pepper <[email protected]>
This is more as a straw man to start discussion than an actual proposal we'll move forward with as it is. This is a clear gap in the Direct3D and core HLSL feature sets and we should seek to address it.