~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to ext/native/gfx_es2/gpu_features.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
4
 
 
5
#pragma once
 
6
 
 
7
#include "base/NativeApp.h"
 
8
 
 
9
enum {
 
10
        GPU_VENDOR_NVIDIA = 1,
 
11
        GPU_VENDOR_AMD = 2,
 
12
        GPU_VENDOR_INTEL = 3,
 
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,
 
18
};
 
19
 
 
20
enum {
 
21
        BUG_FBO_UNUSABLE = 1,
 
22
        BUG_PVR_SHADER_PRECISION_BAD = 2,
 
23
        BUG_PVR_SHADER_PRECISION_TERRIBLE = 4,
 
24
        BUG_PVR_GENMIPMAP_HEIGHT_GREATER = 8,
 
25
};
 
26
 
 
27
// Extensions to look at using:
 
28
// GL_NV_map_buffer_range (same as GL_ARB_map_buffer_range ?)
 
29
 
 
30
// WARNING: This gets memset-d - so no strings please
 
31
// TODO: Rename this GLFeatures or something.
 
32
struct GLExtensions {
 
33
        int ver[3];
 
34
        int gpuVendor;
 
35
        char model[128];
 
36
 
 
37
        bool IsGLES;
 
38
        bool IsCoreContext;
 
39
        bool GLES3;  // true if the full OpenGL ES 3.0 is supported
 
40
        bool ForceGL2;
 
41
 
 
42
        // OES
 
43
        bool OES_depth24;
 
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.
 
47
        bool OES_mapbuffer;
 
48
        bool OES_vertex_array_object;
 
49
        bool OES_copy_image;
 
50
 
 
51
        // ARB
 
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;
 
58
        bool ARB_copy_image;
 
59
        bool ARB_vertex_array_object;
 
60
 
 
61
        // EXT
 
62
        bool EXT_swap_control_tear;
 
63
        bool EXT_discard_framebuffer;
 
64
        bool EXT_unpack_subimage;  // always supported on desktop and ES3
 
65
        bool EXT_bgra;
 
66
        bool EXT_shader_framebuffer_fetch;
 
67
        bool EXT_gpu_shader4;
 
68
        bool EXT_blend_minmax;
 
69
        bool EXT_framebuffer_object;
 
70
        bool EXT_copy_image;
 
71
        bool PBO_EXT;
 
72
 
 
73
        // NV
 
74
        bool NV_shader_framebuffer_fetch;
 
75
        bool NV_copy_image;
 
76
        bool NV_framebuffer_blit;
 
77
        bool NV_pixel_buffer_object; // GL_NV_pixel_buffer_object
 
78
 
 
79
        // ARM
 
80
        bool ARM_shader_framebuffer_fetch;
 
81
 
 
82
        // EGL
 
83
        bool EGL_NV_system_time;
 
84
        bool EGL_NV_coverage_sample;
 
85
 
 
86
        // Bugs
 
87
        int bugs;
 
88
 
 
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...]
 
92
 
 
93
        // greater-or-equal than
 
94
        bool VersionGEThan(int major, int minor, int sub = 0);
 
95
};
 
96
 
 
97
extern GLExtensions gl_extensions;
 
98
 
 
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();
 
102
 
 
103
extern std::string g_all_gl_extensions;
 
104
extern std::string g_all_egl_extensions;
 
105
 
 
106
void CheckGLExtensions();
 
107
void SetGLCoreContext(bool flag);