Skip to content

Add interactive occlusion + WINDOW_HIDDEN throttle test to TrinityALTest#35

Open
Schogol wants to merge 1 commit into
carbonengine:mainfrom
Schogol:test/occlusion-throttle-probe
Open

Add interactive occlusion + WINDOW_HIDDEN throttle test to TrinityALTest#35
Schogol wants to merge 1 commit into
carbonengine:mainfrom
Schogol:test/occlusion-throttle-probe

Conversation

@Schogol

@Schogol Schogol commented Jul 25, 2026

Copy link
Copy Markdown

SwapChain.OcclusionThrottleProbe presents the primary swapchain to the visible test window in a loop and logs loop-fps vs actual render-fps per window state. It detects occlusion from window geometry (IsWindowOccluded: sample 5 points on the window, skipping see-through overlays like the Alt+Tab switcher; minimized counts as hidden) and, while occluded, emulates the WINDOW_HIDDEN throttle (20ms sleep + render 1-in-50) to show rendering collapse to ~1 fps and recover when visible.

Manual/interactive (needs a real GPU + visible window), run with:
--interactive --gtest_filter=SwapChain.OcclusionThrottleProbe
then cover / minimize / restore the window and read occlusion_throttle_test.log.

Used to establish that DXGI_STATUS_OCCLUDED is unavailable for flip-model swapchains (both Present and Present(0, DXGI_PRESENT_TEST) stay S_OK while covered) and that Win32 window-geometry occlusion is a reliable substitute.

Disclaimer:
Claude helped with creating the test and fix.

SwapChain.OcclusionThrottleProbe presents the primary swapchain to the visible
test window in a loop and logs loop-fps vs actual render-fps per window state. It
detects occlusion from window geometry (IsWindowOccluded: sample 5 points on the
window, skipping see-through overlays like the Alt+Tab switcher; minimized counts
as hidden) and, while occluded, emulates the WINDOW_HIDDEN throttle (20ms sleep +
render 1-in-50) to show rendering collapse to ~1 fps and recover when visible.

Manual/interactive (needs a real GPU + visible window), run with:
  --interactive --gtest_filter=SwapChain.OcclusionThrottleProbe
then cover / minimize / restore the window and read occlusion_throttle_test.log.

Used to establish that DXGI_STATUS_OCCLUDED is unavailable for flip-model
swapchains (both Present and Present(0, DXGI_PRESENT_TEST) stay S_OK while
covered) and that Win32 window-geometry occlusion is a reliable substitute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant