Debian Codegraph @

drivers/gles3/storage/config.h

raw symbols SCIP
1 /**************************************************************************/
2 /* config.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #ifdef GLES3_ENABLED
34
35 #include "core/config/project_settings.h"
36 #include "core/string/ustring.h"
37 #include "core/templates/hash_set.h"
38
39 #include "platform_gl.h"
40
41 #ifdef ANDROID_ENABLED
42 typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei);
43 typedef void (*PFNGLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean);
44 typedef void (*PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
45 typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLsizei, GLint, GLsizei);
46 typedef void (*PFNEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum, void *);
47 #endif
48
49 namespace GLES3 {
50
51 class Config {
52 private:
53 static Config *singleton;
54
55 public:
56 bool use_nearest_mip_filter = false;
57 bool use_depth_prepass = true;
58
59 GLint max_vertex_texture_image_units = 0;
60 GLint max_texture_image_units = 0;
61 GLint max_texture_size = 0;
62 GLint max_viewport_size[2] = { 0, 0 };
63 GLint max_vertex_attribs = 0;
64 GLint64 max_uniform_buffer_size = 0;
65 uint32_t max_shader_varyings = 0;
66
67 int64_t max_renderable_elements = 0;
68 int64_t max_renderable_lights = 0;
69 int64_t max_lights_per_object = 0;
70
71 bool generate_wireframes = false;
72
73 HashSet<String> extensions;
74
75 bool float_texture_supported = false;
76 bool float_texture_linear_supported = false;
77 bool s3tc_supported = false;
78 bool rgtc_supported = false;
79 bool bptc_supported = false;
80 bool etc2_supported = false;
81 bool astc_supported = false;
82 bool astc_hdr_supported = false;
83 bool astc_layered_supported = false;
84 bool astc_3d_supported = false;
85 bool srgb_framebuffer_supported = false;
86 bool unorm16_texture_supported = false;
87
88 bool force_vertex_shading = false;
89 bool specular_occlusion = false;
90
91 bool support_anisotropic_filter = false;
92 float anisotropic_level = 0.0f;
93
94 GLint msaa_max_samples = 0;
95 bool msaa_supported = false;
96 bool msaa_multiview_supported = false;
97 bool rt_msaa_supported = false;
98 bool rt_msaa_multiview_supported = false;
99 bool multiview_supported = false;
100 bool external_texture_supported = false;
101
102 // Adreno 3XX compatibility.
103 bool disable_particles_workaround = false; // Set to 'true' to disable 'GPUParticles'.
104
105 // PowerVR GE 8320 workaround.
106 bool disable_transform_feedback_shader_cache = false;
107
108 // ANGLE shader workaround.
109 bool polyfill_half2float = true;
110
111 #ifdef ANDROID_ENABLED
112 PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
113 PFNGLTEXSTORAGE3DMULTISAMPLEPROC eglTexStorage3DMultisample = nullptr;
114 PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC eglFramebufferTexture2DMultisampleEXT = nullptr;
115 PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC eglFramebufferTextureMultisampleMultiviewOVR = nullptr;
116 PFNEGLIMAGETARGETTEXTURE2DOESPROC eglEGLImageTargetTexture2DOES = nullptr;
117
118 #define glFramebufferTextureMultiviewOVR GLES3::Config::get_singleton()->eglFramebufferTextureMultiviewOVR
119 #define glTexStorage3DMultisample GLES3::Config::get_singleton()->eglTexStorage3DMultisample
120 #define glFramebufferTexture2DMultisampleEXT GLES3::Config::get_singleton()->eglFramebufferTexture2DMultisampleEXT
121 #define glFramebufferTextureMultisampleMultiviewOVR GLES3::Config::get_singleton()->eglFramebufferTextureMultisampleMultiviewOVR
122 #define glEGLImageTargetTexture2DOES GLES3::Config::get_singleton()->eglEGLImageTargetTexture2DOES
123 #endif // ANDROID_ENABLED
124
125 static Config *get_singleton() { return singleton; }
126
127 Config();
128 ~Config();
129 };
130
131 } // namespace GLES3
132
133 #endif // GLES3_ENABLED