This allows adding more types of information.
FrameFormat SequenceBuilder::create_frame_format() const
{
- unsigned samples = min(tmpl.get_maximum_multisample(), Limits::get_global().max_samples);
+ unsigned samples = min(tmpl.get_maximum_multisample(), DeviceInfo::get_global().limits.max_samples);
if(samples<tmpl.get_required_multisample())
throw invalid_operation("SequenceBuilder::create_frame_format");
{
if(find_member(planes, &p, &AttachedPlane::plane)!=planes.end())
return;
- if(planes.size()>=Limits::get_global().max_clip_planes)
+ if(planes.size()>=DeviceInfo::get_global().limits.max_clip_planes)
throw invalid_operation("Clipping::attach");
planes.push_back(&p);
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, reinterpret_cast<int *>(&max_color_attachments));
}
-const Limits &Limits::get_global()
+
+const DeviceInfo &DeviceInfo::get_global()
{
- static Limits limits;
- return limits;
+ static DeviceInfo info;
+ return info;
}
} // namespace GL
unsigned max_color_attachments;
Limits();
+};
+
+struct DeviceInfo
+{
+ Limits limits;
+
+ DeviceInfo();
- static const Limits &get_global();
+ static const DeviceInfo &get_global();
};
} // namespace GL
changes(0)
{
if(bound_tex_targets.empty())
- bound_tex_targets.resize(Limits::get_global().max_texture_bindings);
+ bound_tex_targets.resize(DeviceInfo::get_global().limits.max_texture_bindings);
if(bound_uniform_blocks.empty())
- bound_uniform_blocks.resize(Limits::get_global().max_uniform_bindings);
+ bound_uniform_blocks.resize(DeviceInfo::get_global().limits.max_uniform_bindings);
}
PipelineState::~PipelineState()
if(mask&CLIP_PLANES)
{
- unsigned max_clip_planes = Limits::get_global().max_clip_planes;
+ unsigned max_clip_planes = DeviceInfo::get_global().limits.max_clip_planes;
for(unsigned i=0; i<max_clip_planes; ++i)
{
if((enabled_clip_planes>>i)&1)
glUseProgram(0);
glBindVertexArray(0);
- unsigned max_clip_planes = Limits::get_global().max_clip_planes;
+ unsigned max_clip_planes = DeviceInfo::get_global().limits.max_clip_planes;
for(unsigned i=0; i<max_clip_planes; ++i)
if((last_applied->enabled_clip_planes>>i)&1)
glDisable(GL_CLIP_PLANE0+i);
}
if(wd==0 || ht==0)
throw invalid_argument("Texture2DMultisample::storage");
- if(!sm || sm>Limits::get_global().max_samples)
+ if(!sm || sm>DeviceInfo::get_global().limits.max_samples)
throw invalid_argument("Texture2DMultisample::storage");
set_format(fmt);
unsigned UniformBlock::get_alignment() const
{
- return Limits::get_global().uniform_buffer_alignment;
+ return DeviceInfo::get_global().limits.uniform_buffer_alignment;
}
void UniformBlock::store(const ReflectData::UniformInfo &info, unsigned array_size, const void *value)
if(fmt.empty())
return false;
- unsigned max_attribs = Limits::get_global().max_vertex_attributes;
+ unsigned max_attribs = DeviceInfo::get_global().limits.max_vertex_attributes;
for(VertexAttribute a: fmt)
if(get_attribute_semantic(a)>=max_attribs)
features.arb_uniform_buffer_object = ARB_uniform_buffer_object;
features.ext_gpu_shader4 = EXT_gpu_shader4;
features.ext_texture_array = EXT_texture_array;
- const Limits &limits = Limits::get_global();
+ const Limits &limits = DeviceInfo::get_global().limits;
features.uniform_binding_range = limits.max_uniform_bindings;
features.texture_binding_range = limits.max_texture_bindings;
return features;