Commit graph

23 commits

Author SHA1 Message Date
lawnjelly e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Rémi Verschelde 33b2070d2e Remove obsolete GLES2 backend code
This code currently isn't compiled (and cannot compile).

We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan
(probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite
different so it's not relevant to keep this old Godot 3.2 code.

The `drivers/gles2` code from the `3.2` branch can be used as a reference for
a potential new implementation.
2020-08-13 10:04:53 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 3ebde6fac3 GLES2: Fix comments in previous commit that broke rendering (!)
Do NOT use "[vertex]" in a comment...

Kids, don't try to learn OpenGL on a production branch right before
a stable release.
2019-03-12 00:26:56 +01:00
Rémi Verschelde 74e224f2c7 GLES2: Add comments around EXT_shader_texture_lod check
To avoid reintroducing bugs as I did in #26928 and #26932.

texture2DLodEXT and textureCubeLodEXT are only for the fragment shader with
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shader_texture_lod.txt
In the vertex shader, texture2DLod and textureCubeLod are built-in.
2019-03-11 23:18:21 +01:00
Rémi Verschelde 764671d2d0 Revert "GLES2: Ensure extension checks for texture2DLod"
This reverts commit f5f565e3e4.
2019-03-11 23:12:49 +01:00
Rémi Verschelde f5f565e3e4 GLES2: Ensure extension checks for texture2DLod
In canvas.glsl and scene.glsl, we were using texel2DFetch from stdlib.glsl,
which uses texture2DLod. In both cases, the stdlib.glsl include came before
the define of texture2DLod.

Might fix issues for drivers that don't support GL_EXT_shader_texture_lod.
2019-03-11 19:34:31 +01:00
Rémi Verschelde 0ba75c195e Fix GCC 5 build after #26331 and cleanup style
Also cleanup after 01a3dd3.
2019-02-27 09:01:24 +01:00
Juan Linietsky a32b26dfa2 Several fixes to make GLES2 on HTML5 work much better.
Changed math class error reporting to be a bit less paranoid.
2019-02-25 21:47:29 -03:00
Juan Linietsky b32298a660 Ensure WebGL uses highp by default, and fix some wrong mediump usages. Fixes #22962. 2019-01-24 18:58:42 -03:00
Juan Linietsky 2d57ec2460 Fix problem with texture2Dlod, closes #25263 2019-01-23 17:06:37 -03:00
Juan Linietsky 4f4e46edd5 Implement unpacking for compressed vertex formats on GLES2 when not supported, fixes #22957 2019-01-22 21:57:09 -03:00
santouits 3c1cd2873b WebGL1 some changes
glRenderBufferStorage doesn't accept the _DEPTH_COMPONENT24_OES so I changed it to GL_DEPTH_COMPONENT16
https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/renderbufferStorage
https://www.khronos.org/registry/webgl/extensions/rejected/OES_depth24/

Enabled ext_shader_texture_lod extension. I guess it does the same like the GL_ARB_shader_texture_lod extension, but in WebGL1
https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/

And last WebGL1 doesn't allow indexes not constant, so I changed it into a loop reading this:
https://stackoverflow.com/questions/19529690/index-expression-must-be-constant-webgl-glsl-error
2019-01-22 13:40:28 +02:00
Rémi Verschelde 57416bfbce GLES2: Define 'lowp' for OpenGL 2.1
Precision qualifiers are only used on OpenGL ES 2.0 and 3.0,
and while OpenGL 3.3 defines them for compatibility (but without
practical effect), they're missing from OpenGL 2.1, so we define
them to prevent compilation errors.

Fixes #24521.
2018-12-21 15:14:58 +01:00
Rémi Verschelde d3f01a2281 Style: Run clang-format on recent shader changes 2018-09-30 16:31:46 +02:00
Juan Linietsky ce8294986d Some more GLES2 tuning.. 2018-09-29 23:47:24 -03:00
Juan Linietsky f2ed26d71e Reflection probe support in GLES2 back-end. 2018-09-28 16:42:47 -03:00
Rémi Verschelde 4226d56ca9 Style: Enable clang-format on GLSL shaders
As of clang-format 6.0.1, putting the `/* clang-format off */` hint
around our "invalid" `[vertex]` and `[shader]` statements isn't enough
to prevent a bogus indent of the next comments and first valid statement,
so we need to enclose that first valid statement in the unformatted chunk.
2018-08-27 07:34:14 +02:00
Juan Linietsky 62233423c7 Fix generation of env map, closes #18880 2018-08-24 13:31:31 -03:00
Rémi Verschelde e68b96928b Style: Fix code formatting in GLES2 shaders 2018-08-24 14:50:59 +02:00
Thomas Herzog a7bedaf935 [GLES2] attempt to fix some android problems 2018-08-23 17:08:16 +02:00
karroffel b64171e79c add initial GLES2 3D renderer 2018-07-27 14:15:46 +02:00
karroffel eac4c984df add GLES 2 renderer for 2D
This commit adds a new rendering backend, GLES2, and adds a
project setting to enable it.

Currently this backend can only be used on the X11 platform,
but integrating into other platforms is planned.
2018-03-01 15:12:30 +01:00