KhronosGroup / KhronosGroup/Vulkan-Docs

How much of the in/out interface between shaders has to match?

Open
#2,242 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

There seem to be two main ways to specify the user-defined in/out interface of a shader:

  • OpVariable decorated with a Location, with an OpTypePointer type, which then points to (possibly an array of) some other type (including an OpTypeStruct decorated with Block).
  • OpVariable not decorated with a Location, with an OpTypePointer type, which then points to (possibly an array of) an OpTypeStruct decorated with Block, of which every member is decorated with a Location.

If both sides of the interface of the first type, checking for a match seems pretty trivial: pair up the OpVariables by Location and Component and then check if everything else matches.

But for the second type it's less clear. Do only the members have to match individually? Can the members be in different orders, as long as members with the same Location still match? Can the output block have more members than the input? Can the OpVariable and OpTypePointer have different decorations, while the members themselves match? Can the second type even match with the first type, again as long as the members of the block have the same type and decorations as the individual variables in the other shader?

The spec says:

An output variable, block, or structure member in a given shader stage has an interface match with an input variable, block, or structure member in a subsequent shader stage [...]

...which seems to leave open the interpretation that only the structure members need to match individually, or that a variable can match with a structure member.

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

Review the cited shader interface-match wording in the Vulkan specification and resolve the listed cases for block members, ordering, decorations, and variable-to-member matching. Done means the specification explicitly defines which interface forms match and how matching is determined.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.