[SPIR-V] Implement WaveMultiPrefixCountBits code generation

Open
#9,127 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
compilers

Research direction

Start by reading PR #6608 and the SPIR-V code generation for the other WaveMultiPrefix* operations; the issue does not name source files or tests. Reproduce with the provided HLSL shader and DXC command, then compare the generated output for the implemented operations. Done means this shader compiles with -spirv and produces valid SPIR-V for WaveMultiPrefixCountBits.

Written by the indexing model from the issue text.

Description

bug needs-triage spirv

DXC reports WaveMultiPrefixCountBits as unimplemented when compiling to
SPIR-V. The same shader compiles to DXIL.

PR #6608 adds the other WaveMultiPrefix* operations but explicitly leaves
WaveMultiPrefixCountBits unimplemented.

Reproduction

Save this shader as repro.hlsl:

RWStructuredBuffer<uint> Output : register(u0);

[numthreads(1, 1, 1)]
void main() {
  Output[0] = WaveMultiPrefixCountBits(true, uint4(1, 0, 0, 0));
}

Compile with:

dxc -spirv "-fspv-target-env=vulkan1.3" -T cs_6_5 -E main repro.hlsl
Actual result
error: WaveMultiPrefixCountBits intrinsic function unimplemented
Expected result

DXC generates valid SPIR-V for WaveMultiPrefixCountBits.

The shader compiles successfully without -spirv and -fspv-target-env.

Dominant language
C++
Stars
3.7k
Forks
926
Avg merge
3d 22h
Merged PRs (30d)
45

Getting set up

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.

More from microsoft/DirectXShaderCompiler

All issues in microsoft/DirectXShaderCompiler

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.