libobs/graphics: Support debug markers

Add support for debug markers via D3DPERF API and KHR_debug. This makes
it easier to understand RenderDoc captures.

D3DPERF is preferred to ID3DUserDefinedAnnotation because it supports
colors. d3d9.lib is now linked in to support this.

This feature is disabled by default, and is controlled by
GS_USE_DEBUG_MARKERS.

From: obsproject/obs-studio#1799
This commit is contained in:
James Park
2019-04-02 23:22:19 -07:00
committed by jp9000
parent a3e5344cce
commit 2996a6c06b
8 changed files with 117 additions and 0 deletions

View File

@@ -1341,6 +1341,22 @@ void device_projection_pop(gs_device_t *device)
da_pop_back(device->proj_stack);
}
void device_debug_marker_begin(gs_device_t *device,
const char *markername, const float color[4])
{
UNUSED_PARAMETER(device);
UNUSED_PARAMETER(color);
glPushDebugGroupKHR(GL_DEBUG_SOURCE_APPLICATION, 0, -1, markername);
}
void device_debug_marker_end(gs_device_t *device)
{
UNUSED_PARAMETER(device);
glPopDebugGroupKHR();
}
void gs_swapchain_destroy(gs_swapchain_t *swapchain)
{
if (!swapchain)