From 192ec963ae029b9b036191d7baf218b55d94dca7 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 16 Aug 2021 10:21:54 +0100 Subject: [PATCH] Create 'rendering/misc' project settings section To prevent the project settings `rendering` section getting out of hand, this PR moves some of the smaller new settings into a `misc` category. --- doc/classes/ProjectSettings.xml | 6 +++--- drivers/gles2/rasterizer_storage_gles2.cpp | 2 +- drivers/gles3/rasterizer_storage_gles3.cpp | 2 +- editor/import/resource_importer_texture.cpp | 2 +- modules/webp/image_loader_webp.cpp | 2 +- servers/visual_server.cpp | 14 +++++++------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ff0f8782ef5..33e8c6d78f6 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1240,13 +1240,13 @@ Shaders have a time variable that constantly increases. At some point, it needs to be rolled back to zero to avoid precision errors on shader animations. This setting specifies when (in seconds). - + If [code]true[/code], the texture importer will import lossless textures using the PNG format. Otherwise, it will default to using WebP. - + The default compression level for lossless WebP. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. Supported values are 0 to 9. Note that compression levels above 6 are very slow and offer very little savings. - + On import, mesh vertex data will be split into two streams within a single vertex buffer, one for position data and the other for interleaved attributes data. Recommended to be enabled if targeting mobile devices. Requires manual reimport of meshes after toggling. diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 4d2d8cf2b03..a3ac7fc129b 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -2254,7 +2254,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: } //bool has_morph = p_blend_shapes.size(); - bool use_split_stream = GLOBAL_GET("rendering/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + bool use_split_stream = GLOBAL_GET("rendering/misc/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); Surface::Attrib attribs[VS::ARRAY_MAX]; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index efe372cc0e8..b22708eb105 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -3350,7 +3350,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: } //bool has_morph = p_blend_shapes.size(); - bool use_split_stream = GLOBAL_GET("rendering/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + bool use_split_stream = GLOBAL_GET("rendering/misc/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); Surface::Attrib attribs[VS::ARRAY_MAX]; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index d4cc1682b0e..77e552188de 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -256,7 +256,7 @@ void ResourceImporterTexture::_save_stex(const Ref &p_image, const String switch (p_compress_mode) { case COMPRESS_LOSSLESS: { - bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/lossless_compression/force_png"); + bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/misc/lossless_compression/force_png"); bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit Ref image = p_image->duplicate(); if (p_mipmaps) { diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 2c3a10b8d06..924385d72e4 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -78,7 +78,7 @@ static PoolVector _webp_lossy_pack(const Ref &p_image, float p_q static PoolVector _webp_lossless_pack(const Ref &p_image) { ERR_FAIL_COND_V(p_image.is_null() || p_image->empty(), PoolVector()); - int compression_level = ProjectSettings::get_singleton()->get("rendering/lossless_compression/webp_compression_level"); + int compression_level = ProjectSettings::get_singleton()->get("rendering/misc/lossless_compression/webp_compression_level"); compression_level = CLAMP(compression_level, 0, 9); Ref img = p_image->duplicate(); diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 7f6aaff334e..21d5a0a4d6c 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -857,7 +857,7 @@ uint32_t VisualServer::mesh_surface_get_format_stride(uint32_t p_format, int p_v } void VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets, uint32_t *r_strides) const { - bool use_split_stream = GLOBAL_GET("rendering/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + bool use_split_stream = GLOBAL_GET("rendering/misc/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); int attributes_base_offset = 0; int attributes_stride = 0; @@ -1027,7 +1027,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim ERR_FAIL_INDEX(p_primitive, VS::PRIMITIVE_MAX); ERR_FAIL_COND(p_arrays.size() != VS::ARRAY_MAX); - bool use_split_stream = GLOBAL_GET("rendering/mesh_storage/split_stream") && !(p_compress_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + bool use_split_stream = GLOBAL_GET("rendering/misc/mesh_storage/split_stream") && !(p_compress_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); uint32_t format = 0; @@ -1303,7 +1303,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim } Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector p_vertex_data, int p_vertex_len, PoolVector p_index_data, int p_index_len) const { - bool use_split_stream = GLOBAL_GET("rendering/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); + bool use_split_stream = GLOBAL_GET("rendering/misc/mesh_storage/split_stream") && !(p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE); uint32_t offsets[ARRAY_MAX]; uint32_t strides[VS::ARRAY_MAX]; @@ -2592,9 +2592,9 @@ VisualServer::VisualServer() { GLOBAL_DEF_RST("rendering/vram_compression/import_etc2", true); GLOBAL_DEF_RST("rendering/vram_compression/import_pvrtc", false); - GLOBAL_DEF("rendering/lossless_compression/force_png", false); - GLOBAL_DEF("rendering/lossless_compression/webp_compression_level", 2); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/lossless_compression/webp_compression_level", PropertyInfo(Variant::INT, "rendering/lossless_compression/webp_compression_level", PROPERTY_HINT_RANGE, "0,9,1")); + GLOBAL_DEF("rendering/misc/lossless_compression/force_png", false); + GLOBAL_DEF("rendering/misc/lossless_compression/webp_compression_level", 2); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/misc/lossless_compression/webp_compression_level", PropertyInfo(Variant::INT, "rendering/misc/lossless_compression/webp_compression_level", PROPERTY_HINT_RANGE, "0,9,1")); GLOBAL_DEF("rendering/limits/time/time_rollover_secs", 3600); ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/time/time_rollover_secs", PropertyInfo(Variant::REAL, "rendering/limits/time/time_rollover_secs", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); @@ -2634,7 +2634,7 @@ VisualServer::VisualServer() { GLOBAL_DEF("rendering/quality/shading/force_blinn_over_ggx", false); GLOBAL_DEF("rendering/quality/shading/force_blinn_over_ggx.mobile", true); - GLOBAL_DEF_RST("rendering/mesh_storage/split_stream", false); + GLOBAL_DEF_RST("rendering/misc/mesh_storage/split_stream", false); GLOBAL_DEF("rendering/quality/depth_prepass/enable", true); GLOBAL_DEF("rendering/quality/depth_prepass/disable_for_vendors", "PowerVR,Mali,Adreno,Apple");