KhronosGroup / KhronosGroup/SPIRV-Tools

Validator should check storage class of builtin variables

Open
#770 12 comments 0 reactions 0 assignees View on GitHub
component:validation enhancement
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

For example, this SPIR-V shader says that FragCoord is an output, and the validator is perfectly happy with that.

000000 07230203 00010200 00000000 00000010
000010 00000000 00020011 00000001 0003000e
000020 00000000 00000000 0005000f 00000000
000030 00000001 6e69616d 00000000 0005000f
000040 00000004 00000002 6e69616d 00000000
000050 00040047 00000003 0000000b 00000000
000060 00040047 0000000f 0000000b 0000000f
000070 00020013 00000004 00030021 00000005
000080 00000004 00030016 00000006 00000020
000090 00040017 00000007 00000006 00000004
0000a0 00040020 00000008 00000001 00000007
0000b0 00040020 00000009 00000003 00000007
0000c0 0004003b 00000009 0000000f 00000003
0000d0 0004003b 00000008 00000003 00000001
0000e0 0004003b 00000009 0000000c 00000003
0000f0 0004002b 00000006 0000000b 00000000
000100 0007002c 00000007 0000000a 0000000b
000110 0000000b 0000000b 0000000b 00050036
000120 00000004 00000001 00000000 00000005
000130 000200f8 0000000d 0003003e 00000003
000140 0000000a 000100fd 00010038 00050036
000150 00000004 00000002 00000000 00000005
000160 000200f8 0000000e 0003003e 0000000c
000170 0000000a 000100fd 00010038

I would have attached this shader as a binary, but Github would not let me.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the report with the supplied SPIR-V shader and trace the validator's handling of builtin variables and their storage classes. Done means the validator rejects FragCoord when it is declared with the invalid storage class, with a regression test for this shader.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.