Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/drivers/gles3/storage/config.h
10000 views
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
GLint64 max_uniform_buffer_size = 0;
64
uint32_t max_shader_varyings = 0;
65
66
int64_t max_renderable_elements = 0;
67
int64_t max_renderable_lights = 0;
68
int64_t max_lights_per_object = 0;
69
70
bool generate_wireframes = false;
71
72
HashSet<String> extensions;
73
74
bool float_texture_supported = false;
75
bool float_texture_linear_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
bool srgb_framebuffer_supported = false;
84
85
bool force_vertex_shading = false;
86
bool specular_occlusion = false;
87
88
bool support_anisotropic_filter = false;
89
float anisotropic_level = 0.0f;
90
91
GLint msaa_max_samples = 0;
92
bool msaa_supported = false;
93
bool msaa_multiview_supported = false;
94
bool rt_msaa_supported = false;
95
bool rt_msaa_multiview_supported = false;
96
bool multiview_supported = false;
97
bool external_texture_supported = false;
98
99
// Adreno 3XX compatibility.
100
bool disable_particles_workaround = false; // Set to 'true' to disable 'GPUParticles'.
101
102
// PowerVR GE 8320 workaround.
103
bool disable_transform_feedback_shader_cache = false;
104
105
// ANGLE shader workaround.
106
bool polyfill_half2float = true;
107
108
#ifdef ANDROID_ENABLED
109
PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
110
PFNGLTEXSTORAGE3DMULTISAMPLEPROC eglTexStorage3DMultisample = nullptr;
111
PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC eglFramebufferTexture2DMultisampleEXT = nullptr;
112
PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC eglFramebufferTextureMultisampleMultiviewOVR = nullptr;
113
PFNEGLIMAGETARGETTEXTURE2DOESPROC eglEGLImageTargetTexture2DOES = nullptr;
114
#endif
115
116
static Config *get_singleton() { return singleton; }
117
118
Config();
119
~Config();
120
};
121
122
} // namespace GLES3
123
124
#endif // GLES3_ENABLED
125
126