From c1547d1337096c89c28fb93eaa4f2bb9293ae044 Mon Sep 17 00:00:00 2001 From: Jakub Marcowski <01158831@pw.edu.pl> Date: Tue, 6 Feb 2024 14:37:29 +0100 Subject: [PATCH] Fully initialize all members of structs `IdentifierActions`, `GeneratedCode` and `DefaultIdentifierActions` (cherry picked from commit b38ac30fe09eec4de40ffd19d7c8a64363b6c181) --- servers/rendering/shader_compiler.h | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/servers/rendering/shader_compiler.h b/servers/rendering/shader_compiler.h index 2d58be72616..e0ec42a4d11 100644 --- a/servers/rendering/shader_compiler.h +++ b/servers/rendering/shader_compiler.h @@ -52,38 +52,38 @@ public: HashMap usage_flag_pointers; HashMap write_flag_pointers; - HashMap *uniforms; + HashMap *uniforms = nullptr; }; struct GeneratedCode { Vector defines; struct Texture { StringName name; - ShaderLanguage::DataType type; - ShaderLanguage::ShaderNode::Uniform::Hint hint; + ShaderLanguage::DataType type = ShaderLanguage::DataType::TYPE_VOID; + ShaderLanguage::ShaderNode::Uniform::Hint hint = ShaderLanguage::ShaderNode::Uniform::Hint::HINT_NONE; bool use_color = false; - ShaderLanguage::TextureFilter filter; - ShaderLanguage::TextureRepeat repeat; - bool global; - int array_size; + ShaderLanguage::TextureFilter filter = ShaderLanguage::TextureFilter::FILTER_DEFAULT; + ShaderLanguage::TextureRepeat repeat = ShaderLanguage::TextureRepeat::REPEAT_DEFAULT; + bool global = false; + int array_size = 0; }; Vector texture_uniforms; Vector uniform_offsets; - uint32_t uniform_total_size; + uint32_t uniform_total_size = 0; String uniforms; String stage_globals[STAGE_MAX]; HashMap code; - bool uses_global_textures; - bool uses_fragment_time; - bool uses_vertex_time; - bool uses_screen_texture_mipmaps; - bool uses_screen_texture; - bool uses_depth_texture; - bool uses_normal_roughness_texture; + bool uses_global_textures = false; + bool uses_fragment_time = false; + bool uses_vertex_time = false; + bool uses_screen_texture_mipmaps = false; + bool uses_screen_texture = false; + bool uses_depth_texture = false; + bool uses_normal_roughness_texture = false; }; struct DefaultIdentifierActions { @@ -91,8 +91,8 @@ public: HashMap render_mode_defines; HashMap usage_defines; HashMap custom_samplers; - ShaderLanguage::TextureFilter default_filter; - ShaderLanguage::TextureRepeat default_repeat; + ShaderLanguage::TextureFilter default_filter = ShaderLanguage::TextureFilter::FILTER_DEFAULT; + ShaderLanguage::TextureRepeat default_repeat = ShaderLanguage::TextureRepeat::REPEAT_DEFAULT; int base_texture_binding_index = 0; int texture_layout_set = 0; String base_uniform_string;