Revert "win-capture: Track gl "swap" invocations to prevent duplicate work"
This reverts commit 4c505e7030
.
Reverting this for the time being due to issues with quakelive. This
will be more thoroughly tested and hopefully added again.
This commit is contained in:
@@ -30,7 +30,6 @@ static struct func_hook wgl_delete_context;
|
||||
static bool darkest_dungeon_fix = false;
|
||||
|
||||
struct gl_data {
|
||||
int swap_recurse;
|
||||
HDC hdc;
|
||||
uint32_t base_cx;
|
||||
uint32_t base_cy;
|
||||
@@ -774,36 +773,20 @@ static void gl_capture(HDC hdc)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void gl_swap_begin(HDC hdc)
|
||||
{
|
||||
if (data.swap_recurse++)
|
||||
return;
|
||||
|
||||
if (!global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
}
|
||||
|
||||
static inline void gl_swap_end(HDC hdc)
|
||||
{
|
||||
if (--data.swap_recurse)
|
||||
return;
|
||||
|
||||
if (global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
}
|
||||
|
||||
static BOOL WINAPI hook_swap_buffers(HDC hdc)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
gl_swap_begin(hdc);
|
||||
if (!global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
unhook(&swap_buffers);
|
||||
BOOL (WINAPI *call)(HDC) = swap_buffers.call_addr;
|
||||
ret = call(hdc);
|
||||
rehook(&swap_buffers);
|
||||
|
||||
gl_swap_end(hdc);
|
||||
if (global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -812,15 +795,16 @@ static BOOL WINAPI hook_wgl_swap_buffers(HDC hdc)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
gl_swap_begin(hdc);
|
||||
if (!global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
unhook(&wgl_swap_buffers);
|
||||
|
||||
BOOL (WINAPI *call)(HDC) = wgl_swap_buffers.call_addr;
|
||||
ret = call(hdc);
|
||||
rehook(&wgl_swap_buffers);
|
||||
|
||||
gl_swap_end(hdc);
|
||||
if (global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -829,15 +813,16 @@ static BOOL WINAPI hook_wgl_swap_layer_buffers(HDC hdc, UINT planes)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
gl_swap_begin(hdc);
|
||||
if (!global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
unhook(&wgl_swap_layer_buffers);
|
||||
|
||||
BOOL (WINAPI *call)(HDC, UINT) = wgl_swap_layer_buffers.call_addr;
|
||||
ret = call(hdc, planes);
|
||||
rehook(&wgl_swap_layer_buffers);
|
||||
|
||||
gl_swap_end(hdc);
|
||||
if (global_hook_info->capture_overlay)
|
||||
gl_capture(hdc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user