1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00
DDrawCompat/DDrawCompat/D3dDdi/AdapterFuncs.h
narzoul d898961a7e Restore legacy double/triple buffered v-sync behavior
On recent drivers, double buffered DirectDraw flips no longer wait for the
vertical sync before returning and instead just insert the flip into the
flip queue for later execution. This effectively results in triple buffered
behavior (in the render-ahead sense) and causes up to an extra frame of
latency even if the flip queue size is set to 1.

To restore the legacy double buffered behavior, each flip waits for the
presented frame to leave the flip queue before returning.

To restore the legacy triple buffered behavior, the flip queue size is
forced to 1. This causes the flip to wait if the previous flip is still
pending.
2016-12-04 15:43:05 +01:00

22 lines
420 B
C++

#pragma once
#define CINTERFACE
#include <d3d.h>
#include <d3dumddi.h>
#include "Common/CompatVtable.h"
#include "D3dDdi/Log/AdapterFuncsLog.h"
#include "D3dDdi/Visitors/AdapterFuncsVisitor.h"
namespace D3dDdi
{
class AdapterFuncs : public CompatVtable<D3DDDI_ADAPTERFUNCS>
{
public:
static void setCompatVtable(D3DDDI_ADAPTERFUNCS& vtable);
};
}
SET_COMPAT_VTABLE(D3DDDI_ADAPTERFUNCS, D3dDdi::AdapterFuncs);