Skip to content
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

Initial HLSL matrix spec #63

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

pow2clk
Copy link
Collaborator

@pow2clk pow2clk commented Sep 9, 2024

This is preliminary, but hopefully contains enough information about some of the earliest developments to make some decisions to confidently guide that development.

Related to llvm/llvm-project#88060

This is preliminary, but hopefully contains enough information about
some of the earliest developments to make some decisions to confidently
guide that development.

Related to llvm/llvm-project#88060
@pow2clk pow2clk marked this pull request as draft September 9, 2024 15:58
Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For vectors, clang's vector type extension is a subset of HLSL vector's capabilities and we handle that by giving ext vectors new capabilities when the HLSL language mode is enabled. Is there a reason to create a new vector type instead of just making this a language-mode difference?

* Declare matrices in different scopes (local, global, param, templates, etc)
* Pass matrices as parameters
* Return from functions
* Lower to vector representations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to keep matrix information for SPIRV which has built-in matrix type.

matrix instead of `ConstantMatrixType`.
* Override dimension checks to limit the sizes to values 1-4.
* Override the element type check to allow for booleans.
* Adds point accessors for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Adds point accessors for....'. <-- Left me on the edge of my seat here :)

However, it is too permissive in the allowable dimensions
and lacking in various other ways that the matrices can be used.

HLSL matrices in DXC have the following features that Clang matrices lack:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some HLSL examples along with some of these descriptions to help better illustrate what is being presented here. You have some syntax here already which is nice.

### Mangling

Mangling of Clang matrices is supported for Itanium but not Microsoft-style
mangling.
Copy link
Collaborator

@coopp coopp Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your plan here to upgrade/add support for MS style mangling to the base clang matrices support which will be inherited into the HLSL derived type?.. Or are you saying we would only implement MS mangling in the HLSL derived type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants