KhronosGroup / KhronosGroup/SPIRV-Cross
pVectorExtractDynamic with spec constant index is not correct
- Dominant language
- GLSL
- Stars
- 2.5k
- Forks
- 713
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 16
Description
I am running into #1178 when targeting metal:
- `half4 foo; foo[specialization constant]` ends up `foo[0]` in metal shader.
- Putting specialization constant first into a temp variable works around the issue, but only if optimizations are not used.
- A silly switch case successfully works around the issue even when optimizations are used.
I will try to fill in more details later.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with issue #1178 and the reported Metal shader output for pVectorExtractDynamic using a specialization-constant index. Compare the direct indexing case with the temporary-variable and switch-case workarounds, both with and without optimization. Done means the specialization-constant index is preserved correctly in optimized and unoptimized Metal output.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100