Skip to content

Commit a709e02

Browse files
authored
Update capability-generator-main.cpp (shader-slang#4295)
fixes: shader-slang#4293 Currently the code does: ``` void inclusiveJoinConjunction(CapabilitySharedContext& context, CapabilityConjunction& c, List<CapabilityConjunction>& toAddAfter) { if (c.isImpossible()) return; for (auto& conjunction : conjunctions) { if (c.implies(conjunction)) return; } ``` This is incorrect because it means that "if the set we are going to add is a super set of an element, don't add it". This does not make sense since inclusive join is meant to be 'additive' of super sets. Correct behavior code: ``` void inclusiveJoinConjunction(CapabilitySharedContext& context, CapabilityConjunction& c, List<CapabilityConjunction>& toAddAfter) { if (c.isImpossible()) return; for (auto& conjunction : conjunctions) { if (conjunction.implies(c)) return; } ``` This is correct behavior because it means that: "if the set we are going to add is a sub set of an element, ignore it". This makes sense since inclusive join can then add super sets in-place of subsets
1 parent d301267 commit a709e02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/slang-capability-generator/capability-generator-main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ struct CapabilityDisjunction
517517
return;
518518
for (auto& conjunction : conjunctions)
519519
{
520-
if (c.implies(conjunction))
520+
if (conjunction.implies(c))
521521
return;
522522
}
523523
for (Index i = 0; i < conjunctions.getCount();)

0 commit comments

Comments
 (0)