Skip to content

Commit

Permalink
cleanup on asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
fairywreath committed Dec 9, 2024
1 parent 220a97b commit 3adc914
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions source/slang/slang-check-modifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ AttributeBase* SemanticsVisitor::checkGLSLLayoutAttribute(
{
uncheckedAttr->args.add(uncheckedAttr->args[0]);
uncheckedAttr->args[0] = nullptr;
SLANG_ASSERT(uncheckedAttr->args[1] != nullptr);
}

SLANG_ASSERT(uncheckedAttr->args.getCount() == 2);
Expand Down Expand Up @@ -2043,13 +2042,13 @@ void SemanticsVisitor::checkModifiers(ModifiableSyntaxNode* syntaxNode)
}
else
{
const auto constVal = checkConstantIntVal(glslOffsetAttribute->args[0]);
SLANG_ASSERT(constVal != nullptr);

glslOffsetAttribute->offset = uint64_t(constVal->getValue());
getGLSLBindingOffsetTracker()->setBindingOffset(
glslBindingAttribute->binding,
glslOffsetAttribute->offset);
if (const auto constVal = checkConstantIntVal(glslOffsetAttribute->args[0]))
{
glslOffsetAttribute->offset = uint64_t(constVal->getValue());
getGLSLBindingOffsetTracker()->setBindingOffset(
glslBindingAttribute->binding,
glslOffsetAttribute->offset);
}
}
}
else
Expand Down

0 comments on commit 3adc914

Please sign in to comment.