MCPcopy Create free account
hub / github.com/Ipotrick/Daxa / intersects

Method intersects

src/cpp_wrapper.cpp:2241–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2239 b_arr_p1 <= a_arr_p1;
2240 }
2241 auto ImageMipArraySlice::intersects(ImageMipArraySlice const & slice) const -> bool
2242 {
2243 u32 const a_mip_p0 = this->base_mip_level;
2244 u32 const a_mip_p1 = this->base_mip_level + this->level_count - 1;
2245 u32 const b_mip_p0 = slice.base_mip_level;
2246 u32 const b_mip_p1 = slice.base_mip_level + slice.level_count - 1;
2247
2248 u32 const a_arr_p0 = this->base_array_layer;
2249 u32 const a_arr_p1 = this->base_array_layer + this->layer_count - 1;
2250 u32 const b_arr_p0 = slice.base_array_layer;
2251 u32 const b_arr_p1 = slice.base_array_layer + slice.layer_count - 1;
2252
2253 bool const mip_disjoint = (a_mip_p1 < b_mip_p0) || (b_mip_p1 < a_mip_p0);
2254 bool const arr_disjoint = (a_arr_p1 < b_arr_p0) || (b_arr_p1 < a_arr_p0);
2255
2256 return !mip_disjoint && !arr_disjoint;
2257 }
2258 auto ImageMipArraySlice::intersect(ImageMipArraySlice const & slice) const -> ImageMipArraySlice
2259 {
2260 u32 const a_mip_p0 = this->base_mip_level;

Callers 1

subtractMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected