godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.43k stars 21.26k forks source link

Massive performance drop when modifying a tile from a disabled tilemap #89774

Open MagmaGuy opened 8 months ago

MagmaGuy commented 8 months ago

Tested versions

Using version 4.2.1 stable mono [b09f793f5]

System information

Windows 11 - Godot v.4.2.1 stable mono

Issue description

If you modify (specifically in my case delete) a tile from a disabled layer in a tilemap, you will see a massive drop in performance due to GPU computing.

I was doing this specifically to hide a layer while in debug mode. I guess I'll try to shift the layer behind other layers for now, but this solution will not work for people who might not be using multiple layers and just wished to make a tilemap temporarily invisible while still needing to modify it.

Steps to reproduce

1) Create a tilemap, fill it with tiles 1000 x 1000 2) Disable the layer 3) Start removing tiles on the layer

In the Minimal Reproduction Project, you don't have to do anything, the code is already set up to automatically create the tilemap and starts a repeating task that deletes a tile every 2 seconds. Just boot the demo and check the profiler.

Minimal reproduction project (MRP)

Godot_MRP.zip

AThousandShips commented 8 months ago

Can you try this in 4.2.2.rc2 or 4.3.dev5?

MagmaGuy commented 8 months ago

Can you try this in 4.2.2.rc2 or 4.3.dev5?

Still there in 4.2.2.rc2 mono

image

MagmaGuy commented 8 months ago

It may be important to note that I specifically was testing this in compatibility mode