microsoft / microsoft/DirectXShaderCompiler

[SPIR-V] Requesting useless OpCapability StoragePushConstant16 when using vk::BufferPointer

Open
#8,895 1 comment 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

Description
I was trying to use latest vk::BufferPointer pattern instead vk::RawBufferLoad. I only modified single shader. C++ code is the same. VVL with sync validation and GPUAV does not report any problems. Here what I got so far.

Image

I see the requirement to use OpCapability StoragePushConstant16 in SPIR-V which does not make any sense for this shader scope. ⚠️This feature is not used but forces the developer to request this feature from VkDevice. It automatically limits available devices for application and produces VVL errors. Many downsides without any benefits.

Steps to Reproduce
Compile this shaders: preprocess.zip

with DXC flags:

-HV 2021
-spirv
-fvk-use-dx-layout
-fspv-reduce-load-size
-fspv-target-env=vulkan1.1spirv1.4
-ffinite-math-only
-enable-16bit-types
-WX
-O3
-E VS
-T vs_6_10
-Fo <output.hlsl.spv>
<source.hlsl>

Expected

  • vk::BufferPointer must correctly extract uint16_t values
  • no require OpCapability StoragePushConstant16 in SPIR-V
  • no compile warnings
  • 🙏please fix this issue #8543 - it causes a lot of friction when debugging with RenderDoc/Nsight/Aftermath

Environment

  • git submodule update --init has been invoked before build
  • hctbuild build parameters: -official -rel -x64 -vs2026 -speak-up -no-dxilconv -spirv -lto
  • Visual Studio 2026 Community components were up to date.
  • Windows 11 Pro (25H2, Build 26200.9278)
  • dxc.exe v1.9.2607.10104 executable, commit SHA-1 1b949a448e4c9e821f010c488defebfbb1a50b27

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 preprocess.zip and compile its source.hlsl using the reported DXC flags and the VS entry point. Inspect the generated SPIR-V and compiler warnings; done means uint16_t extraction works without requiring OpCapability StoragePushConstant16 or emitting warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.