Skip to content

SDL3: ImGui_ImplSDL3_UpdateMonitors expensive on macOS #8558

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

Closed
TheMode opened this issue Apr 7, 2025 · 3 comments
Closed

SDL3: ImGui_ImplSDL3_UpdateMonitors expensive on macOS #8558

TheMode opened this issue Apr 7, 2025 · 3 comments

Comments

@TheMode
Copy link
Contributor

TheMode commented Apr 7, 2025

Version/Branch of Dear ImGui:

docking/fonts

Back-ends:

SDL3 + SDL_GPU

Compiler, OS:

macOS Clang 16

Full config/build information:

No response

Details:

Monitors are currently being constantly iterated over in ImGui_ImplSDL3_NewFrame.
On macOS, SDL_GetDisplayUsableBounds shows to be about ~90% of the NewFrame cost, around 3% of my entire app.

I may be wrong, but I assume that this could be replaced by SDL's display events e.g. SDL_EVENT_DISPLAY_ADDED/SDL_EVENT_DISPLAY_REMOVED/SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented Apr 9, 2025

This is caused by our fairly recent change: #8415 (comment)

Unfortunately there's no indicator on SDL front that work area may have changed so we started polling for this.
Will move this discussion to SDL3 repo, either the performance issue needs to be addressed either it would be good to have a signal for work area change.

@ocornut
Copy link
Owner

ocornut commented Apr 9, 2025

I have posted a new SDL issue libsdl-org/SDL#12785
And will work on reverting the change to limit the polling to Win32 platform for now.

ocornut added a commit that referenced this issue Apr 9, 2025
…y frame. Workaround for Windows. (#8415, #8558)

Partly revert logic from 1a7b594.
@ocornut
Copy link
Owner

ocornut commented Apr 9, 2025

I have pushed b811c42 which should work-around this.

@ocornut ocornut closed this as completed Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants