| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 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 |
|
| 103 |
bool disable_particles_workaround = false; |
| 104 |
|
| 105 |
|
| 106 |
bool disable_transform_feedback_shader_cache = false; |
| 107 |
|
| 108 |
|
| 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 |
| 124 |
|
| 125 |
static Config *get_singleton() { return singleton; } |
| 126 |
|
| 127 |
Config(); |
| 128 |
~Config(); |
| 129 |
}; |
| 130 |
|
| 131 |
} |
| 132 |
|
| 133 |
#endif |