Skip to content

Commit c1b2cfd

Browse files
committed
Merge pull request godotengine#90271 from DarioSamo/pipeline_cache_setting
Add toggle for enabling or disabling RenderingDevice's pipeline cache.
2 parents c10f934 + ecaafa6 commit c1b2cfd

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

core/config/project_settings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ ProjectSettings::ProjectSettings() {
15381538
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/block_size_kb", PROPERTY_HINT_RANGE, "4,2048,1,or_greater"), 256);
15391539
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/max_size_mb", PROPERTY_HINT_RANGE, "1,1024,1,or_greater"), 128);
15401540
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/texture_upload_region_size_px", PROPERTY_HINT_RANGE, "1,256,1,or_greater"), 64);
1541+
GLOBAL_DEF_RST(PropertyInfo(Variant::BOOL, "rendering/rendering_device/pipeline_cache/enable"), true);
15411542
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "rendering/rendering_device/pipeline_cache/save_chunk_size_mb", PROPERTY_HINT_RANGE, "0.000001,64.0,0.001,or_greater"), 3.0);
15421543
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/vulkan/max_descriptors_per_pool", PROPERTY_HINT_RANGE, "1,256,1,or_greater"), 64);
15431544

doc/classes/ProjectSettings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,6 +2727,10 @@
27272727
<member name="rendering/rendering_device/driver.windows" type="String" setter="" getter="">
27282728
Windows override for [member rendering/rendering_device/driver].
27292729
</member>
2730+
<member name="rendering/rendering_device/pipeline_cache/enable" type="bool" setter="" getter="" default="true">
2731+
Enable the pipeline cache that is saved to disk if the graphics API supports it.
2732+
[b]Note:[/b] This property is unable to control the pipeline caching the GPU driver itself does. Only turn this off along with deleting the contents of the driver's cache if you wish to simulate the experience a user will get when starting the game for the first time.
2733+
</member>
27302734
<member name="rendering/rendering_device/pipeline_cache/save_chunk_size_mb" type="float" setter="" getter="" default="3.0">
27312735
Determines at which interval pipeline cache is saved to disk. The lower the value, the more often it is saved.
27322736
</member>

servers/rendering/rendering_device.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,8 @@ Error RenderingDevice::initialize(RenderingContextDriver *p_context, DisplayServ
50895089
draw_list = nullptr;
50905090
compute_list = nullptr;
50915091

5092-
if (main_instance) {
5092+
bool project_pipeline_cache_enable = GLOBAL_GET("rendering/rendering_device/pipeline_cache/enable");
5093+
if (main_instance && project_pipeline_cache_enable) {
50935094
// Only the instance that is not a local device and is also the singleton is allowed to manage a pipeline cache.
50945095
pipeline_cache_file_path = vformat("user://vulkan/pipelines.%s.%s",
50955096
OS::get_singleton()->get_current_rendering_method(),

0 commit comments

Comments
 (0)