renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
// Accumulate bindings and offsets, and check for collisions
// as the accumulation is done.
//
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
//
Accumulate bindings and offsets, and check for collisions
as the accumulation is done.

Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
Accumulate bindings and offsets and check for collisions as the accumulation is done . Returns < 0 if no collision > = 0 if collision and the value returned is a colliding value .
int TIntermediate::addUsedOffsets(int binding, int offset, int numOffsets)
{
    TRange bindingRange(binding, binding);
    TRange offsetRange(offset, offset + numOffsets - 1);
    TOffsetRange range(bindingRange, offsetRange);
    for (size_t r = 0; r < usedAtomics.size(); ++r) {
        if (range.overlap(usedAtomics[r])) {
            return std::max(offset, usedAtomics[r].offset.start);
        }
    }
    usedAtomics.push_back(range);
    return -1; 
}
int TIntermediate :: addUsedOffsets ( int binding , int offset , int numOffsets ) { TRange bindingRange ( binding , binding ) ; TRange offsetRange ( offset , offset + numOffsets - 1 ) ; TOffsetRange range ( bindingRange , offsetRange ) ; for ( size_t r = 0 ; r < usedAtomics . size ( ) ; ++ r ) { if ( range . overlap ( usedAtomics [ r ] ) ) { return std :: max ( offset , usedAtomics [ r ] . offset . start ) ; } } usedAtomics . push_back ( range ) ; return -1 ; }
Accumulate bindings and offsets, and check for collisions
as the accumulation is done.
Accumulate bindings and offsets and check for collisions as the accumulation is done .
// check for collisions, except for vertex inputs on desktop // there is a collision; pick one // no collision