microsoft / microsoft/DirectXShaderCompiler

[SPIR-V] support externally initialized non-floating-point column-major matrices

Open
#8,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The following code is supported when targeting DirectX but is gated by an error when targeting spirv
https://hlsl.godbolt.org/z/zr9P6GKhx

struct A {
  RWStructuredBuffer<int3x2> Buf;
};

A a1;
A a2;

[numthreads(1,1,1)]
void main() {
  int3x2 m = a1.Buf[0];
  a2.Buf[0] = m * 2;
}

https://github.com/microsoft/DirectXShaderCompiler/blob/b87d15dbd0bca2a1ef9c9f4d957de8784ec13fe5/tools/clang/test/CodeGenSPIRV/vk.layout.non-fp-matrix.array.struct.error.hlsl#L37
https://github.com/microsoft/DirectXShaderCompiler/blob/b87d15dbd0bca2a1ef9c9f4d957de8784ec13fe5/tools/clang/test/CodeGenSPIRV/vk.layout.non-fp-matrix.error.hlsl#L19

For now marking these as not supported for the offload test suite when targeting spirv.

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.

Research direction

Start with tools/clang/test/CodeGenSPIRV/vk.layout.non-fp-matrix.array.struct.error.hlsl and tools/clang/test/CodeGenSPIRV/vk.layout.non-fp-matrix.error.hlsl, then reproduce the linked HLSL example when targeting SPIR-V. Done means externally initialized non-floating-point column-major matrices are supported for this case and the relevant test coverage reflects the accepted behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.