1
// This file will not pull in the OpenGL headers but will still let you
2
// access information about the features of the current GPU, for auto-config
3
// and similar purposes.
7
#include "base/NativeApp.h"
10
GPU_VENDOR_NVIDIA = 1,
13
GPU_VENDOR_ARM = 4, // Mali
14
GPU_VENDOR_POWERVR = 5,
15
GPU_VENDOR_ADRENO = 6,
16
GPU_VENDOR_BROADCOM = 7,
17
GPU_VENDOR_UNKNOWN = 0,
22
BUG_PVR_SHADER_PRECISION_BAD = 2,
23
BUG_PVR_SHADER_PRECISION_TERRIBLE = 4,
24
BUG_PVR_GENMIPMAP_HEIGHT_GREATER = 8,
27
// Extensions to look at using:
28
// GL_NV_map_buffer_range (same as GL_ARB_map_buffer_range ?)
30
// WARNING: This gets memset-d - so no strings please
31
// TODO: Rename this GLFeatures or something.
39
bool GLES3; // true if the full OpenGL ES 3.0 is supported
44
bool OES_packed_depth_stencil;
45
bool OES_depth_texture;
46
bool OES_texture_npot; // If this is set, can wrap non-pow-2 textures. Set on desktop.
48
bool OES_vertex_array_object;
52
bool ARB_framebuffer_object;
53
bool ARB_pixel_buffer_object;
54
bool ARB_blend_func_extended; // dual source blending
55
bool EXT_blend_func_extended; // dual source blending (GLES, new 2015)
56
bool ARB_shader_image_load_store;
57
bool ARB_conservative_depth;
59
bool ARB_vertex_array_object;
62
bool EXT_swap_control_tear;
63
bool EXT_discard_framebuffer;
64
bool EXT_unpack_subimage; // always supported on desktop and ES3
66
bool EXT_shader_framebuffer_fetch;
68
bool EXT_blend_minmax;
69
bool EXT_framebuffer_object;
74
bool NV_shader_framebuffer_fetch;
76
bool NV_framebuffer_blit;
77
bool NV_pixel_buffer_object; // GL_NV_pixel_buffer_object
80
bool ARM_shader_framebuffer_fetch;
83
bool EGL_NV_system_time;
84
bool EGL_NV_coverage_sample;
89
// Shader precision. Only fetched on ES for now.
90
int range[2][6][2]; // [vs,fs][lowf,mediumf,highf,lowi,mediumi,highi][min,max]
91
int precision[2][6]; // [vs,fs][lowf...]
93
// greater-or-equal than
94
bool VersionGEThan(int major, int minor, int sub = 0);
97
extern GLExtensions gl_extensions;
99
// Call this after filling out vendor etc to lookup the bugs etc.
100
// Only needs to be called once. Currently called by CheckGLExtensions().
101
void ProcessGPUFeatures();
103
extern std::string g_all_gl_extensions;
104
extern std::string g_all_egl_extensions;
106
void CheckGLExtensions();
107
void SetGLCoreContext(bool flag);