Fix crash with --resource-set-binding [n] (common set form, not per-register form)
--resource-set-binding has a mode which allows per-register assignments of bindings and descriptor sets on the command line, and another accepting a single descriptor set value to assign to all variables. The former worked, but the latter would crash when assigning the values. This fixes it, and makes the former case a bit more robust against premature termination of the pre-register values, which must come in (regname,set,binding) triples. This also allows the form "--resource-set-binding stage setnum", which was mentioned in the usage message, but did not parse. The operation of the per-register form of this option is unchanged.
This commit is contained in:
parent
91e69c03bd
commit
52017192e5
7 changed files with 191 additions and 26 deletions
|
|
@ -404,6 +404,11 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
|||
{
|
||||
if (type.getQualifier().hasSet())
|
||||
return type.getQualifier().layoutSet;
|
||||
|
||||
// If a command line or API option requested a single descriptor set, use that (if not overrided by spaceN)
|
||||
if (baseResourceSetBinding.size() == 1)
|
||||
return atoi(baseResourceSetBinding[0].c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue