config.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. #ifndef CONFIG_GLES3_H
  31. #define CONFIG_GLES3_H
  32. #ifdef GLES3_ENABLED
  33. #include "core/config/project_settings.h"
  34. #include "core/string/ustring.h"
  35. #include "core/templates/hash_set.h"
  36. #include "core/templates/vector.h"
  37. #include "platform_gl.h"
  38. #ifdef ANDROID_ENABLED
  39. typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei);
  40. #endif
  41. namespace GLES3 {
  42. class Config {
  43. private:
  44. static Config *singleton;
  45. public:
  46. bool use_nearest_mip_filter = false;
  47. bool use_depth_prepass = true;
  48. int64_t max_vertex_texture_image_units = 0;
  49. int64_t max_texture_image_units = 0;
  50. int64_t max_texture_size = 0;
  51. int64_t max_viewport_size[2] = { 0, 0 };
  52. int64_t max_uniform_buffer_size = 0;
  53. int64_t max_renderable_elements = 0;
  54. int64_t max_renderable_lights = 0;
  55. int64_t max_lights_per_object = 0;
  56. bool generate_wireframes = false;
  57. HashSet<String> extensions;
  58. bool float_texture_supported = false;
  59. bool s3tc_supported = false;
  60. bool rgtc_supported = false;
  61. bool bptc_supported = false;
  62. bool etc2_supported = false;
  63. bool astc_supported = false;
  64. bool astc_hdr_supported = false;
  65. bool astc_layered_supported = false;
  66. bool force_vertex_shading = false;
  67. bool support_anisotropic_filter = false;
  68. float anisotropic_level = 0.0f;
  69. bool multiview_supported = false;
  70. #ifdef ANDROID_ENABLED
  71. PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
  72. #endif
  73. static Config *get_singleton() { return singleton; };
  74. Config();
  75. ~Config();
  76. };
  77. } // namespace GLES3
  78. #endif // GLES3_ENABLED
  79. #endif // CONFIG_GLES3_H