From: Axel Davy Date: Fri, 18 Nov 2016 18:26:54 +0000 (+0100) Subject: d3dadapter/present: Add new API to ID3DPresent X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0eef5491d306cdf3094763f7923a59f2d2288a57;p=mesa.git 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 --- diff --git a/include/d3dadapter/present.h b/include/d3dadapter/present.h index 187843f892a..29d7a1aa1da 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 {