Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

Should we always render?

Open TomAtkinsonArm opened this issue 3 years ago • 2 comments

#400 has been merged to solve immediate issues with the project

@MattGuerrette suggested the following

Unfortunately this will not solve situations where the application will lose focus explicitly on launch. For example, when running these samples using the Radeon Developer Panel, the samples cannot be captured unless the sample app regains focus as the panel will focus itself to the top level when a client application (Vulkan app or DX12 app) connects, stealing the focus from the samples.

Could there be a build option or runtime option implemented that removes entirely the check for application focus?

This issue will track the development of a runtime option for always rendering or only rendering when in focus.

It may also be easier to remove the focus based rendering if it is deemed useless. After all, samples is not the sort of application you will have running in the background for a prolonged amount of time?

@JoseEmilio-ARM any thoughts on this? If the platform rendered from an event it may be easier to control when rendering should happen. I'm also tempted to stick with a compile time definition.

TomAtkinsonArm avatar Jan 17 '22 18:01 TomAtkinsonArm

I'd suggest limiting the FPS to 10 when the window isn't focused. This way, capture tools can still do their job. This is a standard approach to save power in games.

You may also want to add a label on the unfocused window (or change the window title) to note that performance will be limited while the window is unfocused.

Calinou avatar Mar 05 '22 21:03 Calinou

Rendering should be orchestrated by the Event Bus. This will mean a window can still submit a focus lost event and a sample can decide how to honor it in its own way. Plugins will be registered to the event bus similar to Bevy's plugin system.

TomAtkinsonArm avatar Jul 29 '22 20:07 TomAtkinsonArm