Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix allocating wrong shadows size #87520

Closed

Conversation

Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Jan 24, 2024

Fix partially #87499.

@Rindbee Rindbee requested a review from a team as a code owner January 24, 2024 00:44
@@ -2003,7 +2003,7 @@ void LightStorage::shadow_atlas_set_size(RID p_atlas, int p_size, bool p_16_bits
for (int i = 0; i < 4; i++) {
//clear subdivisions
shadow_atlas->quadrants[i].shadows.clear();
shadow_atlas->quadrants[i].shadows.resize(int64_t(1) << int64_t(shadow_atlas->quadrants[i].subdivision));
shadow_atlas->quadrants[i].shadows.resize(shadow_atlas->quadrants[i].subdivision * shadow_atlas->quadrants[i].subdivision);
Copy link
Contributor

@jsjtxietian jsjtxietian Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like gles3's shadow_atlas_set_size do the same thing here: shadow_atlas->quadrants[i].shadows.resize(shadow_atlas->quadrants[i].subdivision * shadow_atlas->quadrants[i].subdivision);
And I can confirm it won't crash in compability renderer. cc @BastiaanOlij

@clayjohn
Copy link
Member

clayjohn commented May 4, 2024

Superseded by #91545

@clayjohn clayjohn closed this May 4, 2024
@clayjohn clayjohn removed this from the 4.3 milestone May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants