MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / GetRangeIntersection

Function GetRangeIntersection

layers/containers/range.h:144–149  ·  view source on GitHub ↗

Returns the intersection of the ranges [x, x + x_size) and [y, y + y_size)

Source from the content-addressed store, hash-verified

142
143// Returns the intersection of the ranges [x, x + x_size) and [y, y + y_size)
144static inline vvl::range<int64_t> GetRangeIntersection(int64_t x, uint64_t x_size, int64_t y, uint64_t y_size) {
145 int64_t intersection_min = std::max(x, y);
146 int64_t intersection_max = std::min(x + static_cast<int64_t>(x_size), y + static_cast<int64_t>(y_size));
147
148 return {intersection_min, intersection_max};
149}

Callers 2

RangesIntersectFunction · 0.85
GetRegionIntersectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected