-
Notifications
You must be signed in to change notification settings - Fork 722
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
Support Long Vectors in HLSL #7067
Comments
btw @Przemog1 found a nasty partial specialization bug where one tries to partially specialize where an integer (not a type) is involved in the template specialization declaration. E.g. I want to partial spec for Which is why we had to partial spec only on the type, and go explicit for every single N from 1 to 4 with a macro Would be nice if we could get that fixed for when long vectors come around. |
Can you paste a link to the issue with a repro for this please? |
Add support for vectors longer than 4 (long vectors) with some restrictions.
Is your feature request related to a problem? Please describe.
ML applications require vectors longer than the graphics-centric limit of 4 vector elements. Allowing longer vectors will better enable these applications to take advantage of hardware support and ease novel ML application development.
Describe the solution you'd like
Allow declaration and use of vectors longer than 4 elements (long vectors) as locals, groupshared, non-entry parameters, non-entry return types, and contents of raw buffers. These should be useable by HLSL operators and elementwise builtins.
These vectors will be declared using the existing template declarations. Existing defaults such as default vector length will be maintained to preserve behavior of existing shaders. Accessing such vectors will be exclusively through existing subscript operation as the member-style xyzw (or rgba) are specific to the interpretation of shorter vectors in a graphics context.
Describe alternatives you've considered
A bespoke, opaque vector type intended for ML applications was considered, but discarded in favor of extending the existing vector representations.
Additional context
While all elementwise DXIL intrinsics are supported, initial support might implement such support as scalarized breakdowns.
Support for this feature may be implemented in stages:
Where matrices are represented as vectors, the max size is actually 16. There are many places in the DXC code where the lenght limit of 4 or 16 is pervasive. There are several esoteric changes that need to be made besides just allowing the validator to accept such vectors. Many of these will be included in the changes that require them, but others might require more individual changes along the way.
The text was updated successfully, but these errors were encountered: