Skip to content

Commit

Permalink
Increase the size of the uniform set cache to 4096 to avoid cache thr…
Browse files Browse the repository at this point in the history
…ashing from projects with high numbers of unique textures.
  • Loading branch information
clayjohn committed Dec 5, 2024
1 parent 1f47e4c commit 2535423
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@
<member name="rendering/2d/batching/item_buffer_size" type="int" setter="" getter="" default="16384">
Maximum number of canvas item commands that can be batched into a single draw call.
</member>
<member name="rendering/2d/batching/uniform_set_cache_size" type="int" setter="" getter="" default="256">
<member name="rendering/2d/batching/uniform_set_cache_size" type="int" setter="" getter="" default="4096">
Maximum number of uniform sets that will be cached by the 2D renderer when batching draw calls.
[b]Note:[/b] A project that uses a large number of unique sprite textures per frame may benefit from increasing this value.
</member>
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,7 @@ void RenderingServer::init() {

GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/2d/shadow_atlas/size", PROPERTY_HINT_RANGE, "128,16384"), 2048);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/2d/batching/item_buffer_size", PROPERTY_HINT_RANGE, "128,1048576,1"), 16384);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/2d/batching/uniform_set_cache_size", PROPERTY_HINT_RANGE, "256,1048576,1"), 256);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/2d/batching/uniform_set_cache_size", PROPERTY_HINT_RANGE, "256,1048576,1"), 4096);

// Number of commands that can be drawn per frame.
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/gl_compatibility/item_buffer_size", PROPERTY_HINT_RANGE, "128,1048576,1"), 16384);
Expand Down

0 comments on commit 2535423

Please sign in to comment.