Skip to content

Conversation

@V-FEXrt
Copy link
Collaborator

@V-FEXrt V-FEXrt commented Nov 7, 2025

Fixes #7846

Implments:

  • the HLSL type __builtin_la_MatrixRef
  • the HLSL intrinsic __builtin_la_CreateMatrix()
  • the DXIL type %dx.types.MatrixRef
  • the DXIL op @dx.op.createMatrix(i32 312)

Note: The DXIL op codes will change in response to microsoft/hlsl-specs#698

@@ -0,0 +1,8 @@
// RUN: %dxc -T cs_6_9 -E main %s -verify
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pretty sure I also want a .ll test but I don't know the magic incantation to generate the IR upto but right before the dxilgen pass

Copy link
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

I've read through this and didn't spot any obvious typos.

Do we need to apply the same "experimental DXIL" stuff to this that we're talking about for other SM 6.10 features?

Comment on lines +140 to 144
LICOMPTYPE_VK_BUFFER_POINTER = 55,
LICOMPTYPE_COUNT = 56
#else
LICOMPTYPE_COUNT = 54
LICOMPTYPE_COUNT = 55
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Does it matter that these values have changed?

I've no reason to think it does, just checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm assuming no but maybe someone else can weigh in. The ifdef basically forces them to change though since the last number is only incremented for SPIRV. Beyond that this seems to be an internal enum so changing it shouldn't be observable to end users.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are mostly internal details, but the built-in intrinsic extension mechanism relies on this header (and this enum) as well. That's currently only used by Xbox backend, and wouldn't be impacted by these changes unless updated to depend on them, and even then, using the latest header would keep it in sync.

Ideally, I think we should get rid of the ifdef here (so LICOMPTYPE_VK_BUFFER_POINTER is always part of the enumeration), and update the corresponding table g_LegalIntrinsicCompTypes in SemaHLSL.cpp. But that should be a separate change.

@V-FEXrt
Copy link
Collaborator Author

V-FEXrt commented Nov 7, 2025

Do we need to apply the same "experimental DXIL" stuff to this that we're talking about for other SM 6.10 features?

Yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Enable creation of a LinAlg Matrix (type, intrinsic, dxil op)

3 participants