Skip to content

Commit 05bb15b

Browse files
Merge pull request #1643 from vsg-dev/DescriptorSetCompile
Added checks for invald DescriptorSet setup.
2 parents 585222d + b85149c commit 05bb15b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/vsg/state/DescriptorSet.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,19 @@ void DescriptorSet::compile(Context& context)
7171
{
7272
if (!_implementation[context.deviceID])
7373
{
74+
if (!setLayout)
75+
{
76+
throw Exception{"Error: invalid DescriptorSet as no setLayout assigned.", VK_INCOMPLETE};
77+
}
78+
79+
if (setLayout->bindings.size() != descriptors.size())
80+
{
81+
throw Exception{make_string("Error: invalid DescriptorSet as setLayout bindings size (", setLayout->bindings.size(), ") and descriptors size ", descriptors.size(), ") not equal."), VK_INCOMPLETE};
82+
}
83+
7484
// make sure all the contributing objects are compiled
75-
if (setLayout) setLayout->compile(context);
85+
setLayout->compile(context);
86+
7687
for (auto& descriptor : descriptors) descriptor->compile(context);
7788

7889
_implementation[context.deviceID] = context.allocateDescriptorSet(setLayout);

0 commit comments

Comments
 (0)