Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlaceholderCubemapArray.new() causes memory leak with GLES3 #77762

Closed
qarmin opened this issue Jun 2, 2023 · 4 comments · Fixed by #79874
Closed

PlaceholderCubemapArray.new() causes memory leak with GLES3 #77762

qarmin opened this issue Jun 2, 2023 · 4 comments · Fixed by #79874

Comments

@qarmin
Copy link
Contributor

qarmin commented Jun 2, 2023

Godot version

4.0 621d68e

System information

Ubuntu 22.04 CI

Issue description

PlaceholderCubemapArray.new()

leaks memory only in GLES3

ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: texture_2d_layered_initialize (drivers/gles3/storage/texture_storage.cpp:757)
ERROR: Attempting to use an uninitialized RID
   at: get_or_null (./core/templates/rid_owner.h:198)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:700)
WARNING: Could not create texture atlas, status: 0
     at: update_texture_atlas (drivers/gles3/storage/texture_storage.cpp:1581)
ERROR: 1 RID allocations of type 'N5GLES37TextureE' were leaked at exit.

Steps to reproduce

Above

Minimal reproduction project

Above

@AThousandShips
Copy link
Member

AThousandShips commented Jun 2, 2023

It seems that failing to create a resource like texture here locks up the RID, the free method should probably not block freeing the RID as long as the RID is still valid

@xiedengmin
Copy link

i have the same problem!
windows10 godot4.1.beta1

@uguu-org
Copy link

I got the same error message in 4.1.1 with a newly created empty project (attached).

test_77762.zip

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 531.79 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 745

ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: (drivers/gles3/storage/texture_storage.cpp:763)
ERROR: Attempting to use an uninitialized RID
   at: (./core/templates/rid_owner.h:199)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:705)
ERROR: 1 RID allocations of type 'N5GLES37TextureE' were leaked at exit.

The project is created in 4.0.3 because I wanted to see if Godot 4.0.3 had the same error (it was fine). The error messages are observed in console after opening the project in 4.1.1.

I guess some part of the editor might be using Cubemap and is thus broken, but I didn't notice anything.

@clayjohn
Copy link
Member

The texture resource tracking was added in 4.1, so if there is a memory leak, it is present in 4.0.3 as well.

More likely there is no memory leak and the system just isn't properly registering that no memory was allocated when the cubemap array fails to be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants