microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] Requesting useless OpCapability StoragePushConstant16 when using vk::BufferPointer
Nobody has claimed this yet.
- 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.
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::BufferPointermust correctly extractuint16_tvalues- no require
OpCapability StoragePushConstant16in 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 --inithas been invoked before buildhctbuildbuild 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.exev1.9.2607.10104 executable, commit SHA-11b949a448e4c9e821f010c488defebfbb1a50b27
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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