Skip to content

Conversation

@solidpixel
Copy link
Contributor

@solidpixel solidpixel commented Dec 19, 2025

This PR adds per-frame performance measurements to layer_gpu_profile, including support for VK_EXT_frame_boundary demarcating frame boundaries.

TODO list:

  • Support VK_EXT_frame_boundary.
  • Support per-frame sampling mode.
  • Make frame serialization optional in per-frame sampling mode.

Fixes #156

@solidpixel solidpixel marked this pull request as draft December 19, 2025 11:51
@solidpixel solidpixel force-pushed the perf_per_frame branch 3 times, most recently from ff351e6 to a2909a7 Compare December 19, 2025 15:26
@solidpixel solidpixel requested a review from Copilot December 19, 2025 15:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds per-frame performance measurement capabilities to layer_gpu_profile, including support for VK_EXT_frame_boundary to mark frame boundaries. The implementation adds a new "frame" sampling mode that complements the existing "workload" mode, allowing users to choose between detailed per-workload profiling or simpler per-frame metrics.

  • Adds new configuration options to differentiate frame selection (frame_mode) from counter sampling granularity (sample_mode)
  • Implements VK_EXT_frame_boundary extension support for manual frame boundary marking
  • Refactors the Python service to handle both per-workload and per-frame sample messages

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lglpy/comms/service_gpu_profile.py Adds support for per-frame sample messages and refactors variable naming for clarity
layer_gpu_timeline/source/layer_instance_functions.hpp Removes unused vkCreateDevice function declaration
layer_gpu_timeline/source/layer_instance_functions.cpp Removes frame boundary emulation code that tracked extension support
layer_gpu_timeline/source/layer_device_functions_queue.cpp Updates function signature to use reference instead of pointer and removes emulation-specific code
layer_gpu_timeline/source/device.hpp Removes flag tracking frame boundary emulation state
layer_gpu_profile/source/layer_instance_functions.hpp Adds new file with physical device feature query functions
layer_gpu_profile/source/layer_instance_functions.cpp Implements feature queries to enable VK_EXT_frame_boundary support
layer_gpu_profile/source/layer_device_functions_queue.cpp Adds per-frame sampling logic and manual frame boundary handling
layer_gpu_profile/source/layer_device_functions.hpp Adds vkQueueBindSparse function declaration
layer_gpu_profile/source/layer_config.hpp Splits configuration into frame selection and counter sampling modes
layer_gpu_profile/source/layer_config.cpp Updates configuration parsing for new two-mode system
layer_gpu_profile/source/instance.cpp Adds VK_EXT_frame_boundary to injected device extensions
layer_gpu_profile/source/device_utils.hpp Adds workload sampling check to instrumentation guard
layer_gpu_profile/source/CMakeLists.txt Adds new instance functions source file to build
layer_gpu_profile/layer_config.json Updates default config to use new frame sampling mode
layer_gpu_profile/README_LAYER.md Documents new configuration options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@solidpixel solidpixel force-pushed the perf_per_frame branch 2 times, most recently from 96cba77 to d79d895 Compare December 19, 2025 15:46
@solidpixel solidpixel requested a review from Copilot December 19, 2025 15:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@solidpixel solidpixel changed the title Profile layer Add per-frame performance Profile layer Add per-frame performance counter samples Dec 19, 2025
@solidpixel solidpixel changed the title Profile layer Add per-frame performance counter samples Profile layer: Add per-frame counter sampling Dec 19, 2025
@solidpixel solidpixel force-pushed the perf_per_frame branch 2 times, most recently from e95b9e6 to 4846843 Compare December 19, 2025 16:34
@solidpixel solidpixel marked this pull request as ready for review December 19, 2025 16:35
@solidpixel solidpixel requested a review from Copilot December 19, 2025 16:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


columns: list[str] = []

columns.append(f'{self.frame_id}')
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Using self.frame_id directly could result in 'None' being formatted into the string if frame_id hasn't been set. While frame_id is set on line 243 before this method is called, the assertion on line 224 only checks table_header. Add an assertion for self.frame_id to ensure it's not None before use.

Copilot uses AI. Check for mistakes.
@solidpixel solidpixel merged commit 45cdc31 into main Dec 19, 2025
6 checks passed
@solidpixel solidpixel deleted the perf_per_frame branch December 19, 2025 16:57
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.

Profile layer: Support per frame measurements

2 participants