2026-05-07 - HLSL Working Group Minutes
Discussion Topics
- SPIR-V matrix legalization: Many intrinsics are not legalized for matrix types larger than a 2x2
- ConstantBuffer
and constructor work
Meeting Notes
SPIR-V matrix legalization
Steven and Farzon discussed how to get legalization working across all of the matrix intrinsics, and whether we need to handle each manually. A few options were identified:
- Use the approach we’ve used for constant buffers and represent matrices in the frontend using arrays-of-vectors.
- Generically legalize using scalarization.
- Build a library of legalization helpers and implement legalization op by op.
There was some concern that the frontend approach feels like it might be papering over the problem, but the only real downside would be a potential compile time cost due to having more code during optimization. Generic legalization using scalarization will not be optimal, so it would probably just be a stopgap. Legalization helpers might work, but due to the legalizer’s love of powers of two it may end up suboptimal for things like 3x3 matrices, whereas the frontend approach would be able to handle this trivially.
ConstantBuffer and constructors
Steven and Helena discussed coordinating getting the ConstantBuffer
Issues with ConstantBuffer