summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAxel Davy <axel.davy@ens.fr>2016-11-18 19:26:54 +0100
committerAxel Davy <axel.davy@ens.fr>2016-12-20 23:44:21 +0100
commit0eef5491d306cdf3094763f7923a59f2d2288a57 (patch)
treef8bd683cdfab076a7d7245204dc55aa5eea6eeac /include
parentb2f17e5f62e43ab6fd07d8752d0fc27f89f8aa37 (diff)
d3dadapter/present: Add new API to ID3DPresent
The API will enable better support for the commonly used DISCARD swapchain parameter. Signed-off-by: Axel Davy <axel.davy@ens.fr>
Diffstat (limited to 'include')
-rw-r--r--include/d3dadapter/present.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/d3dadapter/present.h b/include/d3dadapter/present.h
index 187843f892..29d7a1aa1d 100644
--- a/include/d3dadapter/present.h
+++ b/include/d3dadapter/present.h
@@ -35,6 +35,22 @@ typedef struct ID3DPresentGroup ID3DPresentGroup;
typedef struct ID3DAdapter9 ID3DAdapter9;
typedef struct D3DWindowBuffer D3DWindowBuffer;
+/* Available since version 1.3 */
+typedef struct _D3DPRESENT_PARAMETERS2_ {
+ /* Whether D3DSWAPEFFECT_DISCARD is allowed to release the
+ * D3DWindowBuffers in any order, and eventually with a delay.
+ * FALSE (Default): buffers should be released as soon as possible.
+ * TRUE: it is allowed to release some buffers with a delay, and in
+ * a random order. */
+ BOOL AllowDISCARDDelayedRelease;
+ /* User preference for D3DSWAPEFFECT_DISCARD with D3DPRESENT_INTERVAL_IMMEDIATE.
+ * FALSE (Default): User prefers presentation to occur as soon as possible,
+ * with potential tearings.
+ * TRUE: User prefers presentation to be tear free. Requires
+ * AllowDISCARDDelayedRelease to have any effect. */
+ BOOL TearFreeDISCARD;
+} D3DPRESENT_PARAMETERS2, *PD3DPRESENT_PARAMETERS2, *LPD3DPRESENT_PARAMETERS2;
+
/* Presentation backend for drivers to display their brilliant work */
typedef struct ID3DPresentVtbl
{
@@ -75,6 +91,11 @@ typedef struct ID3DPresentVtbl
BOOL (WINAPI *ResolutionMismatch)(ID3DPresent *This);
HANDLE (WINAPI *CreateThread)(ID3DPresent *This, void *pThreadfunc, void *pParam);
BOOL (WINAPI *WaitForThread)(ID3DPresent *This, HANDLE thread);
+ /* Available since version 1.3 */
+ HRESULT (WINAPI *SetPresentParameters2)(ID3DPresent *This, D3DPRESENT_PARAMETERS2 *pParameters);
+ BOOL (WINAPI *IsBufferReleased)(ID3DPresent *This, D3DWindowBuffer *buffer);
+ /* Wait a buffer gets released. */
+ HRESULT (WINAPI *WaitBufferReleaseEvent)(ID3DPresent *This);
} ID3DPresentVtbl;
struct ID3DPresent
@@ -106,6 +127,9 @@ struct ID3DPresent
#define ID3DPresent_ResolutionMismatch(p) (p)->lpVtbl->ResolutionMismatch(p)
#define ID3DPresent_CreateThread(p,a,b) (p)->lpVtbl->CreateThread(p,a,b)
#define ID3DPresent_WaitForThread(p,a) (p)->lpVtbl->WaitForThread(p,a)
+#define ID3DPresent_SetPresentParameters2(p,a) (p)->lpVtbl->SetPresentParameters2(p,a)
+#define ID3DPresent_IsBufferReleased(p,a) (p)->lpVtbl->IsBufferReleased(p,a)
+#define ID3DPresent_WaitBufferReleaseEvent(p) (p)->lpVtbl->WaitBufferReleaseEvent(p)
typedef struct ID3DPresentGroupVtbl
{