KhronosGroup / KhronosGroup/glslang

Provide option to skip default binding decoration, or a mechanism for tracking where the defaults have been set.

Open
#2,218 14 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Quoting from my previous comment in an older issue:

> "The tool I'm working on is feeding ESSL through and producing SPIRV, with the intention to patch any blocks which haven't been given explicit bindings by generating them ourselves. This becomes difficult with the changes in the PR you referenced as a binding of 0 is perfectly valid and offers no way of knowing that this uniform wasn't given an explicit binding.
>
> I'm wondering if you have any suggestions on how I could work around this problem? Currently I have subclassed `TGlslIoMapper` to modify the binding values when not explicitly provided to a sentinel value which we check for later, i.e.
>
> `if (!qualifier.hasBinding()) qualifier.layoutBinding = sentinel;`
> But this feels like a hack and may be fragile.
>
> Perhaps instead of just setting the binding to zero, these uniforms could also be tracked by the shader so we can at least tell where default values have been assigned?"

It was suggested that the option `--shift-ssbo-binding` could be of use. Does this option apply to all ssbos or just the ones that have been given the default binding of `0`. In any case, this is a possible way to recreate the work around I am already using, when the ideal case would be to avoid decorating them with a binding.

## Edit
The PR mentioned above is this one: https://github.com/KhronosGroup/glslang/pull/1625

Contributor guide

Open the contributing guide

Research direction

Start by reviewing TGlslIoMapper and the behavior of --shift-ssbo-binding, then read the linked PR 1625 for how default bindings are currently assigned. Determine whether the option distinguishes explicitly assigned bindings from defaults and document the intended behavior. Done means the default-binding state can be identified or skipped without relying on a sentinel-value workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.