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 | #ifndef CONFIG_GLES3_H |
32 | #define CONFIG_GLES3_H |
33 | |
34 | #ifdef GLES3_ENABLED |
35 | |
36 | #include "core/string/ustring.h" |
37 | #include "core/templates/hash_set.h" |
38 | |
39 | // This must come first to avoid windows.h mess |
40 | #include "platform_config.h" |
41 | #ifndef OPENGL_INCLUDE_H |
42 | #include <GLES3/gl3.h> |
43 | #else |
44 | #include OPENGL_INCLUDE_H |
45 | #endif |
46 | |
47 | #ifdef ANDROID_ENABLED |
48 | typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei); |
49 | #endif |
50 | |
51 | namespace GLES3 { |
52 | |
53 | class Config { |
54 | private: |
55 | static Config *singleton; |
56 | |
57 | public: |
58 | bool use_nearest_mip_filter = false; |
59 | bool use_depth_prepass = true; |
60 | |
61 | int64_t max_vertex_texture_image_units = 0; |
62 | int64_t max_texture_image_units = 0; |
63 | int64_t max_texture_size = 0; |
64 | int64_t max_viewport_size[2] = { 0, 0 }; |
65 | int64_t max_uniform_buffer_size = 0; |
66 | int64_t max_renderable_elements = 0; |
67 | int64_t max_renderable_lights = 0; |
68 | int64_t max_lights_per_object = 0; |
69 | |
70 | // TODO implement wireframe in OpenGL |
71 | // bool generate_wireframes; |
72 | |
73 | HashSet<String> extensions; |
74 | |
75 | bool float_texture_supported = false; |
76 | bool s3tc_supported = false; |
77 | bool rgtc_supported = false; |
78 | bool bptc_supported = false; |
79 | bool etc2_supported = false; |
80 | bool astc_supported = false; |
81 | bool astc_hdr_supported = false; |
82 | bool astc_layered_supported = false; |
83 | |
84 | bool force_vertex_shading = false; |
85 | |
86 | bool support_anisotropic_filter = false; |
87 | float anisotropic_level = 0.0f; |
88 | |
89 | bool multiview_supported = false; |
90 | #ifdef ANDROID_ENABLED |
91 | PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr; |
92 | #endif |
93 | |
94 | static Config *get_singleton() { return singleton; }; |
95 | |
96 | Config(); |
97 | ~Config(); |
98 | }; |
99 | |
100 | } // namespace GLES3 |
101 | |
102 | #endif // GLES3_ENABLED |
103 | |
104 | #endif // CONFIG_GLES3_H |
105 | |