shader-slang / slang

Making it easier to work with shaders
MIT License
2.07k stars 178 forks source link

Capabilities System: Inclusive join logic bug #4293

Closed ArielG-NV closed 4 months ago

ArielG-NV commented 4 months ago

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".

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;
        }

The correct behavior is "if the set we are going to add is a sub set of an element, ignore it"