diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-04-10 19:47:51 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-04-10 19:47:51 +0100 |
commit | 9c6d2c8baf85c8a24051befb1b2e05cd360374d2 (patch) | |
tree | 7dc41c1a04fc340d4ee034c0f1960bd98afba07d /helpers | |
parent | 5273254b79c17622d47b4326a729e0052151c57e (diff) |
glstate: Check draw (and read) FBOs are advertised before using.
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/glfeatures.cpp | 22 | ||||
-rw-r--r-- | helpers/glfeatures.hpp | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/helpers/glfeatures.cpp b/helpers/glfeatures.cpp index e862b89e..0f4945dd 100644 --- a/helpers/glfeatures.cpp +++ b/helpers/glfeatures.cpp @@ -348,20 +348,30 @@ Features::load(const Profile & profile, const Extensions & ext) NV_read_depth_stencil = ES && ext.has("GL_NV_read_depth_stencil"); - if (profile.es()) { - pixel_buffer_object = profile.versionGreaterOrEqual(3, 1) || - ext.has("GL_NV_pixel_buffer_object"); - } else { + if (profile.desktop()) { pixel_buffer_object = profile.versionGreaterOrEqual(2, 1) || ext.has("GL_ARB_pixel_buffer_object") || ext.has("GL_EXT_pixel_buffer_object"); - } - if (profile.desktop()) { + framebuffer_object = profile.versionGreaterOrEqual(3, 0) || + ext.has("GL_ARB_framebuffer_object") || + ext.has("GL_EXT_framebuffer_object"); + read_framebuffer_object = framebuffer_object; + query_buffer_object = profile.versionGreaterOrEqual(4, 4) || ext.has("GL_ARB_query_buffer_object") || ext.has("GL_AMD_query_buffer_object"); } else { + pixel_buffer_object = profile.versionGreaterOrEqual(3, 1) || + ext.has("GL_NV_pixel_buffer_object"); + + framebuffer_object = profile.versionGreaterOrEqual(2, 0) || + ext.has("GL_OES_framebuffer_object"); + + read_framebuffer_object = ext.has("GL_ANGLE_framebuffer_blit") || + ext.has("GL_APPLE_framebuffer_multisample") || + ext.has("GL_NV_framebuffer_blit"); + query_buffer_object = 0; } } diff --git a/helpers/glfeatures.hpp b/helpers/glfeatures.hpp index 3ac176d3..e8f9b9c9 100644 --- a/helpers/glfeatures.hpp +++ b/helpers/glfeatures.hpp @@ -156,6 +156,8 @@ struct Features unsigned ARB_program_interface_query:1; unsigned pixel_buffer_object:1; + unsigned framebuffer_object:1; + unsigned read_framebuffer_object:1; unsigned query_buffer_object:1; Features(void); |