microsoft / microsoft/DirectXShaderCompiler

[SM6.10] Convert needs an overload that takes an InterpretedVector

Open
#8,418 2 comments 0 reactions 1 assignee View on GitHub

@V-FEXrt is already working on this.

Since Jul 22, 2026.

Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Convert currently does not support packed type vector sizes that are not a multiple of the number of elements per scalar.

For example, if we have packed vector with component type F8_E4M3FN and size 7, it gets loaded to into vector<uint, 2>. When we want to convert it to vector<half, 7>, the Convert function does not support that because it returns vector<half, 8>. It has no way of knowing that the vector<uint, 2> actually contains 7 valid packed element and not 8.

VectorRef<ComponentType::F8_E4M3FN, 7> vecRef = {Buf, 0};
vector<uint, 2> vecPacked = BiasRef.Buf.Load<vector<uint,2>(0);
vector<half, 7> vecConverted = Convert<ComponentType::F16, ComponentType::F8_E4M3FN>(vecPacked);

error: cannot initialize a variable of type 'vector<half, 7>' with an rvalue of type 'vector<half, 8>'

We should add a Convert function that takes an InterpretedVector that would carry the packed element count into Convert and enable returning of the correct vector type.

Once this is fixed, update MultiplyAdd implementations in the linalg.h header that take a VectorRef to use this new overload.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.