Commit Graph

1796 Commits

Author SHA1 Message Date
Jairo f18a8d3ffc Optional Unix Socket disable for devices that do not support it
(cherry picked from commit fe068b61ad)
2020-06-15 10:55:28 +02:00
Rémi Verschelde 513bfe496c SCons: Add 'split_libmodules' option to workaround linker issue
The new 'split_libmodules=yes' option is useful to work around linker
command line size limitations when linking a huge number of objects.
We're currently over 64k chars when linking libmodules.a on Windows
with MinGW, which triggers issues as seen in #30892.

Even on Linux, we can also reach linker command line size limitations
by adding more custom modules.

We force this option to True for MinGW on Windows, which fixes #30892.

Additional changes to lib splitting:

- Fix linking of the split module libs with interdependent symbols,
  hacking our way into LINKCOM and SHLINKCOM to set the `--start-group`
  and `--end-group` flags.
- Fix Python 3 compatibility in `methods.split_lib()`.
- Drop seemingly obsolete condition for 'msys' on 'posix'.
- Drop the unnecessary 'split_drivers' as the drivers lib is no longer
  too big since we moved all thirdparty builds to modules.

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
(cherry picked from commit c320a82213)
2020-01-06 12:52:07 +01:00
clayjohn 0e76f2cc95 fix contact shadows appearing when shading casting is off
(cherry picked from commit b1839e5e85)
2019-11-12 13:09:35 +01:00
SonerSound 20822ee87d Fix inconsistent lighting in GLES2
Issue was possibily being caused by duplicating a light even when that
light was not in the render_light_instances array.

(cherry picked from commit 545bf86d39)
2019-11-12 13:09:35 +01:00
zwostein 0f0016bb75 Explicitly set a channel map when initialising the Pulseaudio stream.
(cherry picked from commit 9fa2e07588)
2019-11-12 13:09:35 +01:00
clayjohn cf9560fdab add project setting for max lights and reflections in gles3
(cherry picked from commit 1a981ef268)
2019-11-08 15:48:37 +01:00
clayjohn 4492f6d193 properly pass SCREEN_PIEXEL_SIZE to canvas light shader
(cherry picked from commit 518f0fb190)
2019-11-08 15:48:19 +01:00
clayjohn bd9cff1b20 allow omnilights and spotlights to use negative in GLES2
(cherry picked from commit 96c3004855)
2019-11-08 15:48:19 +01:00
PouleyKetchoupp e83754b6ed Fixed vertex color initialization with default value in gles3
Fixes #30275, #31250

(cherry picked from commit e852b3a271)
2019-11-08 15:48:19 +01:00
RaphaelHunter 22c31016c8 fix gles2 canvas shader uniform error,close #31201
(cherry picked from commit 48f28c68bc)
2019-11-08 15:48:19 +01:00
RaphaelHunter 5e8edf9c5d fix gles3 shader uniform vec3 error, close #30930
(cherry picked from commit b8bb5e90ea)
2019-11-08 15:48:19 +01:00
Yuri Roubinski e224c72dd8 Fix hint range step for integer in shaders
(cherry picked from commit 982becfa39)
2019-11-08 15:48:18 +01:00
clayjohn e821477102 throw error when user tries to use Canvas background without sample buffer
(cherry picked from commit e65d2184b9)
2019-11-08 15:48:18 +01:00
clayjohn 99adaef47c Fix skip_vertex_transform bug in GLES2 CPUParticles
(cherry picked from commit 97f66900bb)
2019-11-08 15:48:18 +01:00
clayjohn b7c3fd0711 Fix shadow mapping with RGBA textures on html
(cherry picked from commit 6ec7686a0c)
2019-11-08 15:48:18 +01:00
Kanabenki 7ef78e87c1 Fix casting to uint64_t when returning unix system time
(cherry picked from commit add91724e6)
2019-11-08 13:06:53 +01:00
clayjohn 5acb21dd7b check if skeleton texture is already allocated before reallocating
(cherry picked from commit 99de3906ba)
2019-09-27 12:54:54 +02:00
qarmin 3b703d6707 Small fixes, mostly dupicated code
(cherry picked from commit 856a8226a5)
2019-09-24 09:00:45 +02:00
qarmin e766b16e95 Fix invalid crash in mesh_add_surface
(cherry picked from commit 99ba021404)
2019-07-17 09:51:28 +02:00
clayjohn 480d87e7c8 do not compute fog when using unshaded in GLES2
(cherry picked from commit 3365595254)
2019-07-17 09:50:54 +02:00
clayjohn 39f3a575d6 fix no depth test and render_priority sorting
(cherry picked from commit 2abe7deae8)
2019-07-17 09:50:37 +02:00
Marcus Brummer 055004c589 Prevent GLES2 bool uniforms from having a precision type set.
When setting the default precision type for uniforms (before compiling
the shader) prevent boolean uniforms from having one set. Booleans can't
have a precision type and on some Android devices this caused a
compilation failure.

Fixes #30317

(cherry picked from commit 10f1e0f63a)
2019-07-17 09:50:16 +02:00
Marcus Brummer c441a2921d Use highp precision for gles2 shader uniforms if not explicitly set.
The use of different default precision values (highp in vertex; mediump
in fragment) for uniform variables caused the shader program to not link properly on some android
devices/emulators.

(cherry picked from commit 502dbc7c4a)
2019-07-17 09:50:00 +02:00
Daniel Rakos a670c66457 Fix texture resource reload bug
If a non-imported texture resource file (e.g. DDS) gets updated the editor
doesn't reload it. The cause of the problem is two-fold:

First, the code of ImageTexture assumes that textures are always imported
from an image, but that's not the case for e.g. DDS. This change thus adds
code to issue a resource reload in case an image reload is not possible
(which is the case for non-imported texture resources).

Second, the code is filled with bogus calls to Image::get_image_data_size()
to determine the mipmap offset when that should be done using
Image::get_image_mipmap_offset(). Previous code literally passed the integer
mip level value to Image::get_image_data_size() where that actually expects
a boolean. Thus this part of the change might actually solve some other
issues as well.

To be pedantic, the texture_get_data() funciton of the rasterizer drivers is
still quite a mess, as it only ever returns the whole mipchain when
GLES_OVER_GL is set (practically only on desktop builds) but this change does
not attempt to resolve that.

(cherry picked from commit e34eb5c26c)
2019-07-17 09:49:34 +02:00
clayjohn c3fd38027e Fixed GLES2 transparency order
(cherry picked from commit 7ae3809f4b)
2019-07-17 09:49:12 +02:00
Guilherme Souza f8f66e5b7a Adds flag AMBIENT_LIGHT_DISABLED to GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
(cherry picked from commit 61a844aa61)
2019-07-17 09:48:53 +02:00
clayjohn ebaa06b2be fixes bug when setting projection matrix
(cherry picked from commit e37d723695)
2019-07-17 09:47:32 +02:00
Daniel Rakos 618290ba46 Mute errors on surface->index_array_len == 0 in the GLES3 renderer
This error is generated whenever rendering collision debug meshes.
There's no reason why this should be treated as an error as index-less
meshes are supported and used across the engine.

(cherry picked from commit 1dd98baaa6)
2019-07-17 09:47:15 +02:00
lawnjelly 3433017354 Fixes crash with rigged meshes on some OpenGLES2 devices
Non-tools OpenGLES2 devices that use the USE_SKELETON_SOFTWARE path (i.e. do not support float texture) depend on surface->data being set containing the bone IDs and weights (rasterizer_scene_gles2.cpp, line 1456, RasterizerSceneGLES2::_setup_geometry). However currently if TOOLS_ENABLED is not defined, surface->data is not stored in main memory in rasterizer_storage_gles2.cpp. This causes a crash in rasterizer_scene_gles2.cpp when a rigged object comes into view.

This fix addresses the specific case of skinned objects when USE_SKELETON_SOFTWARE is active, and stores a copy of the bone data, as is done when TOOLS_ENABLED is defined. This fixes the crash by allowing the same mechanism as on desktop, without adding the memory overhead of storing all vertex data where not required.

Fixes #28298

(cherry picked from commit e36e9fdb1c)
2019-07-17 09:43:16 +02:00
Guilherme Souza bb9a8a8132 Fix SHADOWS_DISABLED flag in GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
(cherry picked from commit b363125568)
2019-07-11 11:25:31 +02:00
Chaosus d0bebee560 Fix File opened with READ_WRITE on Windows
To allows use read and write anytime and in any order

(cherry picked from commit 8d12dfa24d)
2019-04-20 22:25:02 +02:00
clayjohn 965b13d62a fixed bug in mip map sigma
(cherry picked from commit 670c1b10b2)
2019-04-20 20:24:44 +02:00
Fabio Alessandrelli 7434760380 Fix jump over uninitialized value in OS Unix/X11
(cherry picked from commit 0bcf0314f7)
2019-04-20 20:18:01 +02:00
JFonS 792beb4b83 Fix hint_range for GLES2 shader uniforms
(cherry picked from commit 059078f075)
2019-04-20 20:17:13 +02:00
Anish Bhobe 16097dd174 Added GLES2 RenderStorage Info calculations.
Proper counting code has been added to update info struct.

Extra: Added the render_info_capture calculations.
Fixes: #27273
(cherry picked from commit 4839b17f93)
2019-04-20 20:08:54 +02:00
toasteater 511fb03e20 Respect keep_3d_linear when transparent_bg is on.
When transparent_bg is on, or the render target is too small,
Godot would skip postprocessing and disregard keep_3d_linear.

This fixes #26817.

(cherry picked from commit 7cbfce7a8c)
2019-04-20 20:03:16 +02:00
Rémi Verschelde 40ec89d24d GLES3: Fix regression in particles buffer initialization
Bug introduced in #26343 where `(float *)` was mistakenly converted
to `(uint8_t *)`, so we were getting `2` instead of `8`.

Fixes #27705.

(cherry picked from commit b182e038e7)
2019-04-06 21:13:07 +02:00
marxin 4889c65922 Fix -Wnon-virtual-dtor warnings.
Example of the warning:
./core/script_language.h:198:7: warning: 'class ScriptCodeCompletionCache' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]

(cherry picked from commit f9f2413e69)
2019-04-03 17:01:04 +02:00
clayjohn 2b3f2ee372 keep DEPTH from causing compile error in GLES2
(cherry picked from commit 5056b4a02c)
2019-04-03 17:00:21 +02:00
Daniel Rakos dc928e6174 Fixed handling of depth texture so it's resolved and bound when needed
- Cleaned up and improved the code determining when we need to use a depth
  prepass (previously it wasn't executed in certain cases even if it was
  needed)
- Added code to prepare and bind the depth texture even when no depth prepass
  or MRTs (more precisely effect buffers) are used

Fixes #25870, #25535, and #25387.

(cherry picked from commit 849596c40c)
2019-04-03 16:56:11 +02:00
marxin e3ae29e666 Enable warnings=extra on clang and GCC testers.
And remove 2 warnings from warnings=extra.

(cherry picked from commit e7f22ebdcd)
2019-04-03 16:52:01 +02:00
Rémi Verschelde ac483345c4 GLES2: Convert unsupported float texture types to 8-bit types 2019-03-12 12:14:37 +01: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 4cdb2d0502 Revert "GLES2: Fix regression on texture2DLod extension checks"
This reverts commit 8c2d38152f.
2019-03-11 23:12:39 +01:00
Rémi Verschelde 8c2d38152f GLES2: Fix regression on texture2DLod extension checks
These can't be done after any non-preprocessor token.
2019-03-11 21:59:20 +01:00
Rémi Verschelde bc3c6338cf
Merge pull request #26928 from akien-mga/gles2-texture2DLod-ext-check
GLES2: Ensure extension checks for texture2DLod
2019-03-11 20:51:36 +01:00
Juan Linietsky d9235be54b Enable seamless cubemap only if extension is present. 2019-03-11 16:49:04 -03: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