diff --git a/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh b/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh index d1e2a44b419..7d46d9d8a77 100644 --- a/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh +++ b/source/blender/draw/engines/eevee/eevee_ambient_occlusion.hh @@ -28,7 +28,7 @@ class AmbientOcclusion { private: class Instance &inst_; - bool render_pass_enabled_; + bool render_pass_enabled_ = false; int ray_count_ = 0; int step_count_ = 0; diff --git a/source/blender/draw/engines/eevee/eevee_camera.hh b/source/blender/draw/engines/eevee/eevee_camera.hh index c38afc8dc9e..9cf768751d9 100644 --- a/source/blender/draw/engines/eevee/eevee_camera.hh +++ b/source/blender/draw/engines/eevee/eevee_camera.hh @@ -105,7 +105,7 @@ class Camera { float radius; } bound_sphere; - float overscan_; + float overscan_ = -1.0f; bool overscan_changed_; /** Whether or not the camera was synced from a camera object. */ bool is_camera_object_ = false; diff --git a/source/blender/draw/engines/eevee/eevee_film.hh b/source/blender/draw/engines/eevee/eevee_film.hh index 3d5eedd5be8..6d5bafc82b0 100644 --- a/source/blender/draw/engines/eevee/eevee_film.hh +++ b/source/blender/draw/engines/eevee/eevee_film.hh @@ -70,7 +70,7 @@ class Film { gpu::Texture *combined_final_tx_ = nullptr; /** Are we using the compute shader/pipeline. */ - bool use_compute_; + bool use_compute_ = false; /** Copy of v3d->shading properties used to detect viewport settings update. */ eViewLayerEEVEEPassType ui_render_pass_ = eViewLayerEEVEEPassType(0); @@ -96,7 +96,7 @@ class Film { PassSimple cryptomatte_post_ps_ = {"Film.Cryptomatte.Post"}; FilmData &data_; - int2 display_extent; + int2 display_extent = int2(-1); eViewLayerEEVEEPassType enabled_passes_ = eViewLayerEEVEEPassType(0); /* Store the pass types needed by the viewport compositor separately, because some passes might diff --git a/source/blender/draw/engines/eevee/eevee_instance.cc b/source/blender/draw/engines/eevee/eevee_instance.cc index 3b7f331a5ba..160f66da086 100644 --- a/source/blender/draw/engines/eevee/eevee_instance.cc +++ b/source/blender/draw/engines/eevee/eevee_instance.cc @@ -272,9 +272,12 @@ void Instance::init_light_bake(Depsgraph *depsgraph, draw::Manager *manager) rcti empty_rect{0, 0, 0, 0}; film.init(int2(1), &empty_rect); render_buffers.init(); + ambient_occlusion.init(); velocity.init(); + raytracing.init(); depth_of_field.init(); shadows.init(); + motion_blur.init(); main_view.init(); light_probes.init(); planar_probes.init(); diff --git a/source/blender/draw/engines/eevee/eevee_instance.hh b/source/blender/draw/engines/eevee/eevee_instance.hh index 54c79b058d1..fdccf696b71 100644 --- a/source/blender/draw/engines/eevee/eevee_instance.hh +++ b/source/blender/draw/engines/eevee/eevee_instance.hh @@ -55,7 +55,7 @@ namespace blender::eevee { /* Combines data from several modules to avoid wasting binding slots. */ struct UniformDataModule { - UniformDataBuf data; + UniformDataBuf data = {"UniformDataBuf"}; void push_update() { diff --git a/source/blender/draw/engines/eevee/eevee_sampling.hh b/source/blender/draw/engines/eevee/eevee_sampling.hh index 3d91ac90624..b3234fb5a28 100644 --- a/source/blender/draw/engines/eevee/eevee_sampling.hh +++ b/source/blender/draw/engines/eevee/eevee_sampling.hh @@ -63,7 +63,7 @@ class Sampling { */ static constexpr int interactive_mode_threshold = 3; - SamplingDataBuf data_; + SamplingDataBuf data_ = {"SamplingDataBuf"}; ClampData &clamp_data_; diff --git a/source/blender/draw/engines/eevee/eevee_shadow.hh b/source/blender/draw/engines/eevee/eevee_shadow.hh index 75c871f9010..5e4460002d1 100644 --- a/source/blender/draw/engines/eevee/eevee_shadow.hh +++ b/source/blender/draw/engines/eevee/eevee_shadow.hh @@ -76,10 +76,10 @@ struct ShadowTileMap : public ShadowTileMapData { /** Cube face index. */ eCubeFace cubeface = Z_NEG; /** Cached, used for detecting updates. */ - float4x4 object_mat; + float4x4 object_mat = float4x4::identity(); public: - ShadowTileMap(int tiles_index_) + ShadowTileMap(int tiles_index_) : ShadowTileMapData{} { tiles_index = tiles_index_; /* For now just the same index. */ diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 18df6e6ec9a..b021876e32b 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -303,7 +303,7 @@ template< /* bool device_only = false */> class UniformBuffer : public T, public detail::UniformCommon { public: - UniformBuffer(const char *name = nullptr) : detail::UniformCommon(name) + UniformBuffer(const char *name = nullptr) : T{}, detail::UniformCommon(name) { /* TODO(@fclem): How could we map this? */ this->data_ = static_cast(this); @@ -496,7 +496,7 @@ template< bool device_only = false> class StorageBuffer : public T, public detail::StorageCommon { public: - StorageBuffer(const char *name = nullptr) : detail::StorageCommon(name) + StorageBuffer(const char *name = nullptr) : T{}, detail::StorageCommon(name) { /* TODO(@fclem): How could we map this? */ this->data_ = static_cast(this); diff --git a/source/blender/gpu/intern/gpu_capabilities.cc b/source/blender/gpu/intern/gpu_capabilities.cc index 0d703ca119e..3f5d79eadb1 100644 --- a/source/blender/gpu/intern/gpu_capabilities.cc +++ b/source/blender/gpu/intern/gpu_capabilities.cc @@ -19,7 +19,7 @@ namespace blender::gpu { -GPUCapabilities GCaps; +GPUCapabilities GCaps = {}; } diff --git a/source/blender/gpu/intern/gpu_storage_buffer_private.hh b/source/blender/gpu/intern/gpu_storage_buffer_private.hh index 2942c74836f..c17eb6c0912 100644 --- a/source/blender/gpu/intern/gpu_storage_buffer_private.hh +++ b/source/blender/gpu/intern/gpu_storage_buffer_private.hh @@ -28,11 +28,11 @@ class VertBuf; class StorageBuf { protected: /** Data size in bytes. Doesn't need to match actual allocation size due to alignment rules. */ - size_t size_in_bytes_; + size_t size_in_bytes_ = -1; /** Continuous memory block to copy to GPU. This data is owned by the StorageBuf. */ void *data_ = nullptr; /** Debugging name */ - char name_[DEBUG_NAME_LEN]; + char name_[DEBUG_NAME_LEN] = {}; public: StorageBuf(size_t size, const char *name); diff --git a/source/blender/gpu/opengl/gl_storage_buffer.hh b/source/blender/gpu/opengl/gl_storage_buffer.hh index aa9afae2bcc..c11a8e4a011 100644 --- a/source/blender/gpu/opengl/gl_storage_buffer.hh +++ b/source/blender/gpu/opengl/gl_storage_buffer.hh @@ -10,6 +10,8 @@ #include "MEM_guardedalloc.h" +#include "GPU_vertex_buffer.hh" + #include "gpu_storage_buffer_private.hh" namespace blender { @@ -25,7 +27,7 @@ class GLStorageBuf : public StorageBuf { /** OpenGL Object handle. */ GLuint ssbo_id_ = 0; /** Usage type. */ - GPUUsageType usage_; + GPUUsageType usage_ = GPUUsageType(-1); /* Read */ GLuint read_ssbo_id_ = 0; GLsync read_fence_ = 0;