1 #include <msp/core/algorithm.h>
4 #include "deviceinfo.h"
12 void Clipping::attach(const ClipPlane &p)
14 if(find_member(planes, &p, &AttachedPlane::plane)!=planes.end())
16 if(planes.size()>=Limits::get_global().max_clip_planes)
17 throw invalid_operation("Clipping::attach");
22 void Clipping::detach(const ClipPlane &p)
24 auto i = find_member(planes, &p, &AttachedPlane::plane);
29 const ProgramData &Clipping::get_shader_data() const
31 for(unsigned i=0; i<planes.size(); ++i)
32 if(planes[i].plane->get_generation()!=planes[i].generation)
34 planes[i].plane->update_shader_data(shdata, i);
35 planes[i].generation = planes[i].plane->get_generation();