st/nine: Complete *Ex stubs

Returning D3D_OK instead of an error when it
makes sense.
Return the value passed previously (or the default)
when it makes sense.
Add (void)variable for unused input variables.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
Axel Davy
2021-03-15 22:22:05 +01:00
committed by Marge Bot
parent 8c72f7506e
commit 4953d19518
3 changed files with 43 additions and 28 deletions
+4
View File
@@ -210,6 +210,10 @@ NineDevice9_ctor( struct NineDevice9 *This,
This->present = pPresentationGroup;
This->minor_version_num = minorVersionNum;
/* Ex */
This->gpu_priority = 0;
This->max_frame_latency = 3;
IDirect3D9_AddRef(This->d3d9);
ID3DPresentGroup_AddRef(This->present);
+4
View File
@@ -165,6 +165,10 @@ struct NineDevice9
boolean pure;
unsigned frame_count; /* It's ok if we overflow */
/* Ex */
int gpu_priority;
unsigned max_frame_latency;
};
static inline struct NineDevice9 *
NineDevice9( void *data )
+35 -28
View File
@@ -65,27 +65,27 @@ NineDevice9Ex_dtor( struct NineDevice9Ex *This )
}
HRESULT NINE_WINAPI
NineDevice9Ex_SetConvolutionMonoKernel( struct NineDevice9Ex *This,
UINT width,
UINT height,
float *rows,
float *columns )
NineDevice9Ex_SetConvolutionMonoKernel( UNUSED struct NineDevice9Ex *This,
UNUSED UINT width,
UNUSED UINT height,
UNUSED float *rows,
UNUSED float *columns )
{
STUB(D3DERR_INVALIDCALL);
STUB(D3D_OK);
}
HRESULT NINE_WINAPI
NineDevice9Ex_ComposeRects( struct NineDevice9Ex *This,
IDirect3DSurface9 *pSrc,
IDirect3DSurface9 *pDst,
IDirect3DVertexBuffer9 *pSrcRectDescs,
UINT NumRects,
IDirect3DVertexBuffer9 *pDstRectDescs,
D3DCOMPOSERECTSOP Operation,
int Xoffset,
int Yoffset )
NineDevice9Ex_ComposeRects( UNUSED struct NineDevice9Ex *This,
UNUSED IDirect3DSurface9 *pSrc,
UNUSED IDirect3DSurface9 *pDst,
UNUSED IDirect3DVertexBuffer9 *pSrcRectDescs,
UNUSED UINT NumRects,
UNUSED IDirect3DVertexBuffer9 *pDstRectDescs,
UNUSED D3DCOMPOSERECTSOP Operation,
UNUSED int Xoffset,
UNUSED int Yoffset )
{
STUB(D3DERR_INVALIDCALL);
STUB(D3D_OK);
}
HRESULT NINE_WINAPI
@@ -117,43 +117,50 @@ HRESULT NINE_WINAPI
NineDevice9Ex_GetGPUThreadPriority( struct NineDevice9Ex *This,
INT *pPriority )
{
STUB(D3DERR_INVALIDCALL);
user_assert(pPriority != NULL, D3DERR_INVALIDCALL);
*pPriority = This->base.gpu_priority;
return D3D_OK;
}
HRESULT NINE_WINAPI
NineDevice9Ex_SetGPUThreadPriority( struct NineDevice9Ex *This,
INT Priority )
{
STUB(D3DERR_INVALIDCALL);
user_assert(Priority >= -7 && Priority <= 7, D3DERR_INVALIDCALL);
This->base.gpu_priority = Priority;
return D3D_OK;
}
HRESULT NINE_WINAPI
NineDevice9Ex_WaitForVBlank( struct NineDevice9Ex *This,
UINT iSwapChain )
NineDevice9Ex_WaitForVBlank( UNUSED struct NineDevice9Ex *This,
UNUSED UINT iSwapChain )
{
STUB(D3DERR_INVALIDCALL);
STUB(D3D_OK);
}
HRESULT NINE_WINAPI
NineDevice9Ex_CheckResourceResidency( struct NineDevice9Ex *This,
IDirect3DResource9 **pResourceArray,
UINT32 NumResources )
NineDevice9Ex_CheckResourceResidency( UNUSED struct NineDevice9Ex *This,
UNUSED IDirect3DResource9 **pResourceArray,
UNUSED UINT32 NumResources )
{
STUB(D3DERR_INVALIDCALL);
STUB(D3D_OK);
}
HRESULT NINE_WINAPI
NineDevice9Ex_SetMaximumFrameLatency( struct NineDevice9Ex *This,
UINT MaxLatency )
{
STUB(D3DERR_INVALIDCALL);
This->base.max_frame_latency = MaxLatency;
return D3D_OK;
}
HRESULT NINE_WINAPI
NineDevice9Ex_GetMaximumFrameLatency( struct NineDevice9Ex *This,
UINT *pMaxLatency )
{
STUB(D3DERR_INVALIDCALL);
user_assert(pMaxLatency != NULL, D3DERR_INVALIDCALL);
*pMaxLatency = This->base.max_frame_latency;
return D3D_OK;
}
HRESULT NINE_WINAPI
@@ -343,7 +350,7 @@ NineDevice9Ex_GetDisplayModeEx( struct NineDevice9Ex *This,
}
HRESULT NINE_WINAPI
NineDevice9Ex_TestCooperativeLevel( struct NineDevice9Ex *This )
NineDevice9Ex_TestCooperativeLevel( UNUSED struct NineDevice9Ex *This )
{
return D3D_OK;
}