source-mirror: Add debug markers

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-10-16 04:54:40 +02:00
parent 03c2a68846
commit 6db575c9cf
1 changed files with 8 additions and 0 deletions

View File

@ -654,8 +654,12 @@ void source::mirror::mirror_instance::video_render(gs_effect_t* effect)
return; return;
} }
GS_DEBUG_MARKER_BEGIN_FORMAT(GS_DEBUG_COLOR_SOURCE, "Source Mirror: %s", obs_source_get_name(_source->get()));
// Only re-render the scene if there was a video_tick, saves GPU cycles. // Only re-render the scene if there was a video_tick, saves GPU cycles.
if (!_scene_rendered) { if (!_scene_rendered) {
GS_DEBUG_MARKER_BEGIN_FORMAT(GS_DEBUG_COLOR_RENDER_VIDEO, "Cache: %s",
obs_source_get_name(_source->get()));
// Override render size if rescaling is enabled. // Override render size if rescaling is enabled.
uint32_t render_width = this->_source->width(); uint32_t render_width = this->_source->width();
uint32_t render_height = this->_source->height(); uint32_t render_height = this->_source->height();
@ -676,6 +680,7 @@ void source::mirror::mirror_instance::video_render(gs_effect_t* effect)
// If we fail to render the source, just render nothing. // If we fail to render the source, just render nothing.
return; return;
} }
GS_DEBUG_MARKER_END();
} }
if (_scene_texture) { if (_scene_texture) {
@ -690,6 +695,9 @@ void source::mirror::mirror_instance::video_render(gs_effect_t* effect)
gs_draw_sprite(_scene_texture->get_object(), 0, this->get_width(), this->get_height()); gs_draw_sprite(_scene_texture->get_object(), 0, this->get_width(), this->get_height());
} }
} }
GS_DEBUG_MARKER_END();
} }
void source::mirror::mirror_instance::audio_output_cb() noexcept try { void source::mirror::mirror_instance::audio_output_cb() noexcept try {