1 #include <msp/gl/extensions/arb_enhanced_layouts.h>
2 #include <msp/gl/extensions/arb_explicit_attrib_location.h>
3 #include <msp/gl/extensions/arb_explicit_uniform_location.h>
4 #include <msp/gl/extensions/arb_gpu_shader5.h>
5 #include <msp/gl/extensions/arb_separate_shader_objects.h>
6 #include <msp/gl/extensions/arb_uniform_buffer_object.h>
7 #include <msp/gl/extensions/arb_vertex_shader.h>
8 #include <msp/gl/extensions/ext_framebuffer_multisample.h>
9 #include <msp/gl/extensions/ext_framebuffer_object.h>
10 #include <msp/gl/extensions/ext_gpu_shader4.h>
11 #include <msp/gl/extensions/ext_texture_array.h>
12 #include <msp/gl/extensions/ext_texture_filter_anisotropic.h>
13 #include <msp/gl/extensions/msp_clipping.h>
14 #include <msp/gl/extensions/nv_fbo_color_attachments.h>
15 #include "deviceinfo.h"
23 glGetIntegerv(GL_MAX_CLIP_PLANES, reinterpret_cast<int *>(&max_clip_planes));
26 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, reinterpret_cast<int *>(&max_vertex_attributes));
27 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, reinterpret_cast<int *>(&max_texture_bindings));
29 if(EXT_framebuffer_object)
30 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, reinterpret_cast<int *>(&max_color_attachments));
31 if(EXT_framebuffer_multisample)
32 glGetIntegerv(GL_MAX_SAMPLES, reinterpret_cast<int *>(&max_samples));
33 if(ARB_uniform_buffer_object)
35 glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, reinterpret_cast<int *>(&max_uniform_bindings));
36 glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, reinterpret_cast<int *>(&uniform_buffer_alignment));
38 if(EXT_texture_filter_anisotropic)
39 glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &max_anisotropy);
43 DeviceInfo::DeviceInfo()
45 glsl_features.target_api = get_backend_api();
46 glsl_features.glsl_version = get_glsl_version();
47 glsl_features.arb_enhanced_layouts = ARB_enhanced_layouts;
48 glsl_features.arb_explicit_attrib_location = ARB_explicit_attrib_location;
49 glsl_features.arb_explicit_uniform_location = ARB_explicit_uniform_location;
50 glsl_features.arb_gpu_shader5 = ARB_gpu_shader5;
51 glsl_features.arb_separate_shader_objects = ARB_separate_shader_objects;
52 glsl_features.arb_uniform_buffer_object = ARB_uniform_buffer_object;
53 glsl_features.ext_gpu_shader4 = EXT_gpu_shader4;
54 glsl_features.ext_texture_array = EXT_texture_array;
55 glsl_features.uniform_binding_range = limits.max_uniform_bindings;
56 glsl_features.texture_binding_range = limits.max_texture_bindings;