Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

reset cached lazy properties on shutdown#334

Open
gkoulin wants to merge 1 commit into
nmwsharp:master from
gkoulin:gk/reset-lazy
Open

reset cached lazy properties on shutdown #334
gkoulin wants to merge 1 commit into
nmwsharp:master from
gkoulin:gk/reset-lazy

Conversation

@gkoulin

@gkoulin gkoulin commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

No description provided.

nmwsharp commented Apr 2, 2025

Copy link
Copy Markdown
Owner

Thanks for submitting this! Can you say briefly what problem this solves (ie what is the current/expected behavior)?

We don't really have a consistent policy about what should happen to options on a shutdown. Should they go back to the defaults, or stay as-is? But I don't think corresponds to either, it's more about not breaking caching?

gkoulin commented Apr 7, 2025
edited
Loading

Copy link
Copy Markdown
Contributor Author

Problem

What currently happens is that variables inside namespace lazy will keep their state after shutdown. This means that next time you initialise, the renderer may not apply some of the options, if they happen to match those cached by lazy variables.

Example

For example, in my case I would create a point cloud with transparency which sets:

options::transparencyMode = TransparencyMode::Pretty;

But the current lazy state (from previous session) is already set to that, therefore the following branch is skipped. Resulting in opaque rendering.

 if (lazy::transparencyMode != options::transparencyMode) {
 lazy::transparencyMode = options::transparencyMode;
 render::engine->setTransparencyMode(options::transparencyMode);
 }

Solution

The submitted change resets lazy variables states, at shutdown, back to the default initialised. This will make sure that in the next session will correctly apply options to the renderer.

Now that I'm thinking about it, it might be better to reset lazy state to match that of default constructed options, since that is what the renderer is initialised with. Otherwise we have two default initialisation states which don't have to match.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /