You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
This commit is contained in:
@@ -332,7 +332,7 @@ class RenderForwardClustered : public RendererSceneRenderRD {
|
||||
uint32_t instance_buffer_size[RENDER_LIST_MAX] = { 0, 0, 0 };
|
||||
LocalVector<InstanceData> instance_data[RENDER_LIST_MAX];
|
||||
|
||||
LightmapCaptureData *lightmap_captures;
|
||||
LightmapCaptureData *lightmap_captures = nullptr;
|
||||
uint32_t max_lightmap_captures;
|
||||
RID lightmap_capture_buffer;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
static SceneShaderForwardClustered *singleton;
|
||||
|
||||
public:
|
||||
RendererStorageRD *storage;
|
||||
RendererStorageRD *storage = nullptr;
|
||||
|
||||
enum ShaderVersion {
|
||||
SHADER_VERSION_DEPTH_PASS,
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
}
|
||||
|
||||
struct MaterialData : public RendererRD::MaterialData {
|
||||
ShaderData *shader_data;
|
||||
ShaderData *shader_data = nullptr;
|
||||
RID uniform_set;
|
||||
uint64_t last_pass = 0;
|
||||
uint32_t index = 0;
|
||||
|
||||
Reference in New Issue
Block a user