Fixed uninitialized memory bug in voxelizer

This commit is contained in:
Juan Linietsky 2019-10-26 07:23:16 -03:00
parent 2af701fa03
commit f4948721e4
3 changed files with 1 additions and 7 deletions

View file

@ -969,7 +969,7 @@ PoolVector<int> Voxelizer::get_giprobe_level_cell_count() const {
level_count.resize(cell_subdiv + 1); //remember, always x+1 levels for x subdivisions
{
PoolVector<int>::Write w = level_count.write();
for (int i = 0; i < cell_subdiv; i++) {
for (int i = 0; i < cell_subdiv + 1; i++) {
w[i] = 0;
}

View file

@ -2260,14 +2260,10 @@ void RasterizerSceneForwardRD::_update_render_base_uniform_set() {
u.ids.resize(slot_count);
}
print_line("updating slots, probe count: " + itos(slot_count));
for (int i = 0; i < slot_count; i++) {
RID probe = gi_probe_get_slots()[i];
if (probe.is_valid()) {
print_line("probe valid: " + itos(i));
}
if (gi_probe_is_anisotropic()) {
if (probe.is_null()) {
RID empty_tex = storage->texture_rd_get_default(RasterizerStorageRD::DEFAULT_RD_TEXTURE_3D_WHITE);

View file

@ -3556,8 +3556,6 @@ void RasterizerStorageRD::gi_probe_allocate(RID p_gi_probe, const Transform &p_t
GIProbe *gi_probe = gi_probe_owner.getornull(p_gi_probe);
ERR_FAIL_COND(!gi_probe);
bool data_version_changed = false;
if (gi_probe->octree_buffer.is_valid()) {
RD::get_singleton()->free(gi_probe->octree_buffer);
RD::get_singleton()->free(gi_probe->data_buffer);