Skip to content

[Fix] Re-render all shadows when the device context is restored#7757

Merged
mvaligursky merged 1 commit intomainfrom
mv-light-device-lost-shadow
Jun 12, 2025
Merged

[Fix] Re-render all shadows when the device context is restored#7757
mvaligursky merged 1 commit intomainfrom
mv-light-device-lost-shadow

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 12, 2025

When the device is restored, shadow maps that are of type SHADOWUPDATE_THISFRAME typically have shadow already rendered in the past, and are now set to SHADOWUPDATE_NONE. We now set them to SHADOWUPDATE_THISFRAME making the shadows to re-render.

@mvaligursky mvaligursky merged commit 8883952 into main Jun 12, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-light-device-lost-shadow branch June 12, 2025 11:32
Comment on lines +124 to +128

// don't stringify EventHandle to JSON by JSON.stringify
toJSON(key) {
return undefined;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this causing a problem? Does this really belong in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. As part of the shader options file, we serialize light properties .. and light now has the new event handler I added, and this excludes it from being serialized there, otherwise serialize was failing due to some circular reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this to GraphicsDevice back then for the same reason - lots of device properties were serialized with the light.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants