libobs: UI: Use graphics debug markers
Add D3D/GL debug markers to make RenderDoc captures easier to tranverse. Also add obs_source_get_name_no_null() to avoid boilerplate for safe string formatting. Closes obsproject/obs-studio#1799
This commit is contained in:
@@ -462,6 +462,8 @@ static inline bool item_texture_enabled(const struct obs_scene_item *item)
|
||||
|
||||
static void render_item_texture(struct obs_scene_item *item)
|
||||
{
|
||||
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_ITEM_TEXTURE, "render_item_texture");
|
||||
|
||||
gs_texture_t *tex = gs_texrender_get_texture(item->item_render);
|
||||
gs_effect_t *effect = obs->video.default_effect;
|
||||
enum obs_scale_type type = item->scale_filter;
|
||||
@@ -505,16 +507,22 @@ static void render_item_texture(struct obs_scene_item *item)
|
||||
|
||||
while (gs_effect_loop(effect, "Draw"))
|
||||
obs_source_draw(tex, 0, 0, 0, 0, 0);
|
||||
|
||||
GS_DEBUG_MARKER_END();
|
||||
}
|
||||
|
||||
static inline void render_item(struct obs_scene_item *item)
|
||||
{
|
||||
GS_DEBUG_MARKER_BEGIN_FORMAT(GS_DEBUG_COLOR_ITEM, "Item: %s",
|
||||
obs_source_get_name(item->source));
|
||||
|
||||
if (item->item_render) {
|
||||
uint32_t width = obs_source_get_width(item->source);
|
||||
uint32_t height = obs_source_get_height(item->source);
|
||||
|
||||
if (!width || !height)
|
||||
return;
|
||||
if (!width || !height) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
uint32_t cx = calc_cx(item, width);
|
||||
uint32_t cy = calc_cy(item, height);
|
||||
@@ -551,6 +559,9 @@ static inline void render_item(struct obs_scene_item *item)
|
||||
obs_source_video_render(item->source);
|
||||
}
|
||||
gs_matrix_pop();
|
||||
|
||||
cleanup:
|
||||
GS_DEBUG_MARKER_END();
|
||||
}
|
||||
|
||||
static void scene_video_tick(void *data, float seconds)
|
||||
|
Reference in New Issue
Block a user