#include <stdexcept>
#include <msp/core/algorithm.h>
+#include <msp/io/print.h>
#include "error.h"
#include "pipelinestate.h"
+#include "program.h"
#include "uniformblock.h"
using namespace std;
set(blend, b, BLEND);
}
+void PipelineState::check_bound_resources() const
+{
+ if(!shprog)
+ return;
+
+ for(const ReflectData::UniformBlockInfo &b: shprog->get_uniform_blocks())
+ if(b.bind_point!=ReflectData::DEFAULT_BLOCK)
+ {
+ auto i = lower_bound_member(resources, b.bind_point, &PipelineState::BoundResource::binding);
+ if(i==resources.end() || i->binding!=b.bind_point)
+ IO::print(IO::cerr, "Warning: No resource present for uniform block binding %d:%d (%s)\n", b.bind_point>>20, b.bind_point&0xFFFFF, b.name);
+ }
+
+ for(const ReflectData::UniformInfo &u: shprog->get_uniforms())
+ if(u.binding>=0 && is_image(u.type))
+ {
+ auto i = lower_bound_member(resources, u.binding, &PipelineState::BoundResource::binding);
+ if(i==resources.end() || i->binding!=u.binding)
+ IO::print(IO::cerr, "Warning: No resource present for texture binding %d:%d (%s)\n", u.binding>>20, u.binding&0xFFFFF, u.name);
+ }
+}
+
} // namespace GL
} // namespace Msp
const VertexSetup *get_vertex_setup() const { return vertex_setup; }
FaceWinding get_front_face() const { return front_face; }
CullMode get_face_cull() const { return face_cull; }
+
+private:
+ void check_bound_resources() const;
};
} // namespace GL