Commit 1e1a708e authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Create an IWineD3DBaseShader class.

parent d4132cf7
...@@ -52,6 +52,7 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_QueryInterface(IWineD3DPixelShader *iface ...@@ -52,6 +52,7 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_QueryInterface(IWineD3DPixelShader *iface
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
if (IsEqualGUID(riid, &IID_IUnknown) if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IWineD3DBase) || IsEqualGUID(riid, &IID_IWineD3DBase)
|| IsEqualGUID(riid, &IID_IWineD3DBaseShader)
|| IsEqualGUID(riid, &IID_IWineD3DPixelShader)) { || IsEqualGUID(riid, &IID_IWineD3DPixelShader)) {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*ppobj = This; *ppobj = This;
...@@ -1825,10 +1826,11 @@ const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl = ...@@ -1825,10 +1826,11 @@ const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =
IWineD3DPixelShaderImpl_QueryInterface, IWineD3DPixelShaderImpl_QueryInterface,
IWineD3DPixelShaderImpl_AddRef, IWineD3DPixelShaderImpl_AddRef,
IWineD3DPixelShaderImpl_Release, IWineD3DPixelShaderImpl_Release,
/*** IWineD3DPixelShader methods ***/ /*** IWineD3DBase methods ***/
IWineD3DPixelShaderImpl_GetParent, IWineD3DPixelShaderImpl_GetParent,
/*** IWineD3DBaseShader methods ***/
IWineD3DPixelShaderImpl_SetFunction,
/*** IWineD3DPixelShader methods ***/
IWineD3DPixelShaderImpl_GetDevice, IWineD3DPixelShaderImpl_GetDevice,
IWineD3DPixelShaderImpl_GetFunction, IWineD3DPixelShaderImpl_GetFunction
/* not part of d3d */
IWineD3DPixelShaderImpl_SetFunction
}; };
...@@ -2035,6 +2035,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_QueryInterface(IWineD3DVertexShader *ifa ...@@ -2035,6 +2035,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_QueryInterface(IWineD3DVertexShader *ifa
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
if (IsEqualGUID(riid, &IID_IUnknown) if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IWineD3DBase) || IsEqualGUID(riid, &IID_IWineD3DBase)
|| IsEqualGUID(riid, &IID_IWineD3DBaseShader)
|| IsEqualGUID(riid, &IID_IWineD3DVertexShader)) { || IsEqualGUID(riid, &IID_IWineD3DVertexShader)) {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*ppobj = This; *ppobj = This;
...@@ -2214,9 +2215,11 @@ const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl = ...@@ -2214,9 +2215,11 @@ const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =
IWineD3DVertexShaderImpl_QueryInterface, IWineD3DVertexShaderImpl_QueryInterface,
IWineD3DVertexShaderImpl_AddRef, IWineD3DVertexShaderImpl_AddRef,
IWineD3DVertexShaderImpl_Release, IWineD3DVertexShaderImpl_Release,
/*** IWineD3DVertexShader methods ***/ /*** IWineD3DBase methods ***/
IWineD3DVertexShaderImpl_GetParent, IWineD3DVertexShaderImpl_GetParent,
/*** IWineD3DBaseShader methods ***/
IWineD3DVertexShaderImpl_SetFunction,
/*** IWineD3DVertexShader methods ***/
IWineD3DVertexShaderImpl_GetDevice, IWineD3DVertexShaderImpl_GetDevice,
IWineD3DVertexShaderImpl_GetFunction, IWineD3DVertexShaderImpl_GetFunction
IWineD3DVertexShaderImpl_SetFunction
}; };
...@@ -56,6 +56,7 @@ struct IWineD3DStateBlock; ...@@ -56,6 +56,7 @@ struct IWineD3DStateBlock;
struct IWineD3DSurface; struct IWineD3DSurface;
struct IWineD3DVolume; struct IWineD3DVolume;
struct IWineD3DVertexDeclaration; struct IWineD3DVertexDeclaration;
struct IWineD3DBaseShader;
struct IWineD3DVertexShader; struct IWineD3DVertexShader;
struct IWineD3DPixelShader; struct IWineD3DPixelShader;
struct IWineD3DQuery; struct IWineD3DQuery;
...@@ -120,6 +121,10 @@ DEFINE_GUID(IID_IWineD3DVolumeTexture, ...@@ -120,6 +121,10 @@ DEFINE_GUID(IID_IWineD3DVolumeTexture,
DEFINE_GUID(IID_IWineD3DVertexDeclaration, DEFINE_GUID(IID_IWineD3DVertexDeclaration,
0x7cd55be6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); 0x7cd55be6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
/* {EAC93065-A4DF-446F-86A1-9EF2BCA40A3C} */
DEFINE_GUID(IID_IWineD3DBaseShader,
0xeac93065, 0xa4df, 0x446f, 0x86, 0xa1, 0x9e, 0xf2, 0xbc, 0xa4, 0x0a, 0x3c);
/* {7F7A2B60-6F30-11d9-C687-00046142C14F} */ /* {7F7A2B60-6F30-11d9-C687-00046142C14F} */
DEFINE_GUID(IID_IWineD3DVertexShader, DEFINE_GUID(IID_IWineD3DVertexShader,
0x7f7a2b60, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); 0x7f7a2b60, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
...@@ -1317,10 +1322,38 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase) ...@@ -1317,10 +1322,38 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
#endif #endif
/***************************************************************************** /*****************************************************************************
* IWineD3DBaseShader interface
*/
#define INTERFACE IWineD3DBaseShader
DECLARE_INTERFACE_(IWineD3DBaseShader,IWineD3DBase)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IWineD3DBase methods ***/
STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
/*** IWineD3DBaseShader methods ***/
STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IWineD3DBaseShader_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IWineD3DBaseShader_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IWineD3DBaseShader_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DBase methods ***/
#define IWineD3DBaseShader_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
/*** IWineD3DBaseShader methods ***/
#define IWineD3DBaseShader_SetFunction(p,a) (p)->lpVtbl->SetFunction(p,a)
#endif
/*****************************************************************************
* IWineD3DVertexShader interface * IWineD3DVertexShader interface
*/ */
#define INTERFACE IWineD3DVertexShader #define INTERFACE IWineD3DVertexShader
DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase) DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBaseShader)
{ {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
...@@ -1328,10 +1361,11 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase) ...@@ -1328,10 +1361,11 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase)
STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IWineD3DBase methods ***/ /*** IWineD3DBase methods ***/
STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE; STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
/*** IWineD3DBaseShader methods ***/
STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
/*** IWineD3DVertexShader methods ***/ /*** IWineD3DVertexShader methods ***/
STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE; STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE;
STDMETHOD(GetFunction)(THIS_ VOID *pData, UINT *pSizeOfData) PURE; STDMETHOD(GetFunction)(THIS_ VOID *pData, UINT *pSizeOfData) PURE;
STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
STDMETHOD(SetConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE; STDMETHOD(SetConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE;
STDMETHOD(SetConstantI)(THIS_ UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount) PURE; STDMETHOD(SetConstantI)(THIS_ UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount) PURE;
STDMETHOD(SetConstantF)(THIS_ UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount) PURE; STDMETHOD(SetConstantF)(THIS_ UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount) PURE;
...@@ -1350,10 +1384,11 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase) ...@@ -1350,10 +1384,11 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase)
#define IWineD3DVertexShader_Release(p) (p)->lpVtbl->Release(p) #define IWineD3DVertexShader_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DBase methods ***/ /*** IWineD3DBase methods ***/
#define IWineD3DVertexShader_GetParent(p,a) (p)->lpVtbl->GetParent(p,a) #define IWineD3DVertexShader_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
/*** IWineD3DBaseShader methods ***/
#define IWineD3DVertexShader_SetFunction(p,a) (p)->lpVtbl->SetFunction(p,a)
/*** IWineD3DVertexShader methods ***/ /*** IWineD3DVertexShader methods ***/
#define IWineD3DVertexShader_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) #define IWineD3DVertexShader_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DVertexShader_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) #define IWineD3DVertexShader_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b)
#define IWineD3DVertexShader_SetFunction(p,a) (p)->lpVtbl->SetFunction(p,a)
#define IWineD3DVertexShader_SetConstantB(p,a,b,c) (p)->lpVtbl->SetConstantB(p,a,b,c) #define IWineD3DVertexShader_SetConstantB(p,a,b,c) (p)->lpVtbl->SetConstantB(p,a,b,c)
#define IWineD3DVertexShader_SetConstantI(p,a,b,c) (p)->lpVtbl->SetConstantI(p,a,b,c) #define IWineD3DVertexShader_SetConstantI(p,a,b,c) (p)->lpVtbl->SetConstantI(p,a,b,c)
#define IWineD3DVertexShader_SetConstantF(p,a,b,c) (p)->lpVtbl->SetConstantF(p,a,b,c) #define IWineD3DVertexShader_SetConstantF(p,a,b,c) (p)->lpVtbl->SetConstantF(p,a,b,c)
...@@ -1367,7 +1402,7 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase) ...@@ -1367,7 +1402,7 @@ DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBase)
* IWineD3DPixelShader interface * IWineD3DPixelShader interface
*/ */
#define INTERFACE IWineD3DPixelShader #define INTERFACE IWineD3DPixelShader
DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBase) DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBaseShader)
{ {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
...@@ -1375,11 +1410,11 @@ DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBase) ...@@ -1375,11 +1410,11 @@ DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBase)
STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IWineD3DBase methods ***/ /*** IWineD3DBase methods ***/
STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE; STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
/*** IWineD3DBaseShader methods ***/
STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
/*** IWineD3DPixelShader methods ***/ /*** IWineD3DPixelShader methods ***/
STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE; STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE;
STDMETHOD(GetFunction)(THIS_ VOID* pData, UINT* pSizeOfData) PURE; STDMETHOD(GetFunction)(THIS_ VOID* pData, UINT* pSizeOfData) PURE;
/* Internal Interfaces */
STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
}; };
#undef INTERFACE #undef INTERFACE
...@@ -1390,10 +1425,11 @@ DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBase) ...@@ -1390,10 +1425,11 @@ DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBase)
#define IWineD3DPixelShader_Release(p) (p)->lpVtbl->Release(p) #define IWineD3DPixelShader_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DBase methods ***/ /*** IWineD3DBase methods ***/
#define IWineD3DPixelShader_GetParent(p,a) (p)->lpVtbl->GetParent(p,a) #define IWineD3DPixelShader_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
/*** IWineD3DBaseShader methods ***/
#define IWineD3DPixelShader_SetFunction(p,a) (p)->lpVtbl->SetFunction(p,a)
/*** IWineD3DPixelShader methods ***/ /*** IWineD3DPixelShader methods ***/
#define IWineD3DPixelShader_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) #define IWineD3DPixelShader_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DPixelShader_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) #define IWineD3DPixelShader_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b)
#define IWineD3DPixelShader_SetFunction(p,a) (p)->lpVtbl->SetFunction(p,a)
#endif #endif
#if 0 /* FIXME: During porting in from d3d8 - the following will be used */ #if 0 /* FIXME: During porting in from d3d8 - the following will be used */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment