@@ -93,9 +93,8 @@ CaptureManager::CaptureManager(format::ApiFamilyId api_family) :
9393 page_guard_memory_mode_(kMemoryModeShadowInternal ), trim_enabled_(false ), trim_current_range_(0 ),
9494 current_frame_(kFirstFrame ), capture_mode_(kModeWrite ), previous_hotkey_state_(false ),
9595 previous_runtime_trigger_state_(CaptureSettings::RuntimeTriggerState::kNotUsed ), debug_layer_(false ),
96- debug_device_lost_(false ), screenshot_prefix_(" " ), screenshots_enabled_(false ), global_frame_count_(0 ),
97- disable_dxr_(false ), accel_struct_padding_(0 ), iunknown_wrapping_(false ), force_command_serialization_(false ),
98- queue_zero_only_(false )
96+ debug_device_lost_(false ), screenshot_prefix_(" " ), screenshots_enabled_(false ), disable_dxr_(false ),
97+ accel_struct_padding_(0 ), iunknown_wrapping_(false ), force_command_serialization_(false ), queue_zero_only_(false )
9998{}
10099
101100CaptureManager::~CaptureManager ()
@@ -683,7 +682,7 @@ bool CaptureManager::ShouldTriggerScreenshot()
683682 uint32_t target_frame = screenshot_indices_.back ();
684683
685684 // If this is a frame of interest, take a screenshot
686- if (target_frame == (global_frame_count_ + 1 ) )
685+ if (target_frame == current_frame_ )
687686 {
688687 triger_screenshot = true ;
689688
@@ -701,12 +700,27 @@ bool CaptureManager::ShouldTriggerScreenshot()
701700 return triger_screenshot;
702701}
703702
703+ void CaptureManager::WriteFrameMarker (format::MarkerType marker_type)
704+ {
705+ if ((capture_mode_ & kModeWrite ) == kModeWrite )
706+ {
707+ format::Marker marker_cmd;
708+ uint64_t header_size = sizeof (format::Marker);
709+ marker_cmd.header .type = format::BlockType::kFrameMarkerBlock ;
710+ marker_cmd.header .size = header_size;
711+ marker_cmd.marker_type = marker_type;
712+ marker_cmd.frame_number = current_frame_;
713+ current_frame_;
714+ WriteToFile (&marker_cmd, header_size);
715+ }
716+ }
717+
704718void CaptureManager::EndFrame ()
705719{
720+ ++current_frame_;
721+
706722 if (trim_enabled_)
707723 {
708- ++current_frame_;
709-
710724 if ((capture_mode_ & kModeWrite ) == kModeWrite )
711725 {
712726 // Currently capturing a frame range.
@@ -721,8 +735,6 @@ void CaptureManager::EndFrame()
721735 }
722736 }
723737
724- global_frame_count_++;
725-
726738 // Flush after presents to help avoid capture files with incomplete final blocks.
727739 if (file_stream_.get () != nullptr )
728740 {
0 commit comments