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:
parent
2996a6c06b
commit
21f4dd63d4
7 changed files with 83 additions and 5 deletions
|
|
@ -1360,6 +1360,8 @@ bool OBSBasicPreview::DrawSelectedOverflow(obs_scene_t *scene,
|
|||
if (!visible)
|
||||
return true;
|
||||
|
||||
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_DEFAULT, "DrawSelectedOverflow");
|
||||
|
||||
obs_transform_info info;
|
||||
obs_sceneitem_get_info(item, &info);
|
||||
|
||||
|
|
@ -1385,6 +1387,8 @@ bool OBSBasicPreview::DrawSelectedOverflow(obs_scene_t *scene,
|
|||
|
||||
gs_matrix_pop();
|
||||
|
||||
GS_DEBUG_MARKER_END();
|
||||
|
||||
UNUSED_PARAMETER(scene);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1450,6 +1454,8 @@ bool OBSBasicPreview::DrawSelectedItem(obs_scene_t *scene,
|
|||
if (!visible)
|
||||
return true;
|
||||
|
||||
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_DEFAULT, "DrawSelectedItem");
|
||||
|
||||
obs_transform_info info;
|
||||
obs_sceneitem_get_info(item, &info);
|
||||
|
||||
|
|
@ -1501,6 +1507,8 @@ bool OBSBasicPreview::DrawSelectedItem(obs_scene_t *scene,
|
|||
|
||||
gs_matrix_pop();
|
||||
|
||||
GS_DEBUG_MARKER_END();
|
||||
|
||||
UNUSED_PARAMETER(scene);
|
||||
UNUSED_PARAMETER(param);
|
||||
return true;
|
||||
|
|
@ -1517,6 +1525,8 @@ void OBSBasicPreview::DrawOverflow()
|
|||
if (hidden)
|
||||
return;
|
||||
|
||||
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_DEFAULT, "DrawOverflow");
|
||||
|
||||
if (!overflow) {
|
||||
std::string path;
|
||||
GetDataFilePath("images/overflow.png", path);
|
||||
|
|
@ -1535,6 +1545,8 @@ void OBSBasicPreview::DrawOverflow()
|
|||
}
|
||||
|
||||
gs_load_vertexbuffer(nullptr);
|
||||
|
||||
GS_DEBUG_MARKER_END();
|
||||
}
|
||||
|
||||
void OBSBasicPreview::DrawSceneEditing()
|
||||
|
|
@ -1542,6 +1554,8 @@ void OBSBasicPreview::DrawSceneEditing()
|
|||
if (locked)
|
||||
return;
|
||||
|
||||
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_DEFAULT, "DrawSceneEditing");
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic*>(App()->GetMainWindow());
|
||||
|
||||
gs_effect_t *solid = obs_get_base_effect(OBS_EFFECT_SOLID);
|
||||
|
|
@ -1567,6 +1581,8 @@ void OBSBasicPreview::DrawSceneEditing()
|
|||
|
||||
gs_technique_end_pass(tech);
|
||||
gs_technique_end(tech);
|
||||
|
||||
GS_DEBUG_MARKER_END();
|
||||
}
|
||||
|
||||
void OBSBasicPreview::ResetScrollingOffset()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue