Commit 07f4f704 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: QueryInterface corrections.

parent 8414777c
......@@ -68,8 +68,9 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface
|| IsEqualGUID(riid, &IID_IWineD3DBaseTexture)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -58,8 +58,9 @@ HRESULT WINAPI IWineD3DCubeTextureImpl_QueryInterface(IWineD3DCubeTexture *iface
|| IsEqualGUID(riid, &IID_IWineD3DTexture)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -341,9 +341,9 @@ HRESULT WINAPI IWineD3DDeviceImpl_QueryInterface(IWineD3DDevice *iface,REFIID ri
|| IsEqualGUID(riid, &IID_IWineD3DDevice)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -173,9 +173,9 @@ HRESULT WINAPI IWineD3DImpl_QueryInterface(IWineD3D *iface,REFIID riid,LPVOID *p
|| IsEqualGUID(riid, &IID_IWineD3DDevice)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -2110,6 +2110,33 @@ void drawPrimitive(IWineD3DDevice *iface,
}
#endif /* TODO: vertex and pixel shaders */
#if 0 /* TODO: vertex and pixel shaders */
/* If we will be using a pixel, do some initialization for it */
if ((pixel_shader = PIXEL_SHADER(This->stateBlock->PixelShader))) {
TRACE("drawing with pixel shader handle %p\n", pixel_shader);
memset(&pixel_shader->input, 0, sizeof(PSHADERINPUTDATA8));
GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, pixel_shader->prgId));
checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, pixel_shader->prgId);");
glEnable(GL_FRAGMENT_PROGRAM_ARB);
checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB);");
/* init Constants */
if (This->stateBlock->Changed.pixelShaderConstant) {
TRACE_(d3d_shader)("pixel shader initializing constants %p\n",pixel_shader);
IDirect3DPixelShaderImpl_SetConstantF(pixel_shader, 0, (CONST FLOAT*)
&This->stateBlock->pixelShaderConstant[0], 8);
}
/* Update the constants */
for (i = 0; i < D3D8_PSHADER_MAX_CONSTANTS; ++i) {
GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, i,
(GLfloat *)&This->stateBlock->pixelShaderConstant[i]));
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB");
}
}
#endif /* TODO: vertex and pixel shaders */
/* Initialize all values to null */
memset(&dataLocations, 0x00, sizeof(dataLocations));
/* convert the FVF or vertexDeclaration into a strided stream (this should be done when the fvf or declaration is created) */
......@@ -2184,6 +2211,19 @@ void drawPrimitive(IWineD3DDevice *iface,
}
#endif
#if 0 /* TODO: vertex and pixel shaders */
if (pixel_shader)
{
#if 0
GLint errPos;
glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &errPos );
if (errPos != -1)
FIXME("HW PixelShader Error at position: %d\n%s\n", errPos, glGetString( GL_PROGRAM_ERROR_STRING_ARB) );
#endif
glDisable(GL_FRAGMENT_PROGRAM_ARB);
}
#endif
/* Finshed updating the screen, restore lock */
LEAVE_GL();
TRACE("Done all gl drawing\n");
......
......@@ -40,8 +40,9 @@ HRESULT WINAPI IWineD3DIndexBufferImpl_QueryInterface(IWineD3DIndexBuffer *iface
|| IsEqualGUID(riid, &IID_IWineD3DIndexBuffer)){
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -42,6 +42,7 @@ HRESULT WINAPI IWineD3DPaletteImpl_QueryInterface(IWineD3DPalette *iface, REFIID
return S_OK;
}
else {
*obj = NULL;
return E_NOINTERFACE;
}
}
......
......@@ -54,8 +54,9 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_QueryInterface(IWineD3DPixelShader *iface
|| IsEqualGUID(riid, &IID_IWineD3DPixelShader)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -42,8 +42,9 @@ HRESULT WINAPI IWineD3DQueryImpl_QueryInterface(IWineD3DQuery *iface, REFIID rii
|| IsEqualGUID(riid, &IID_IWineD3DQuery)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -37,8 +37,9 @@ HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFI
|| IsEqualGUID(riid, &IID_IWineD3DResource)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -38,8 +38,9 @@ HRESULT WINAPI IWineD3DStateBlockImpl_QueryInterface(IWineD3DStateBlock *iface,R
|| IsEqualGUID(riid, &IID_IWineD3DStateBlock)){
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -45,8 +45,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID
|| IsEqualGUID(riid, &IID_IWineD3DSurface)) {
IUnknown_AddRef((IUnknown*)iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......@@ -218,7 +219,10 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetContainer(IWineD3DSurface* iface, REFIID r
}
TRACE("Relaying to QueryInterface\n");
return IUnknown_QueryInterface(container, riid, ppContainer);
if (IUnknown_QueryInterface(container, riid, ppContainer) != S_OK)
return WINED3DERR_INVALIDCALL;
return WINED3D_OK;
}
HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFACE_DESC *pDesc) {
......
......@@ -77,6 +77,7 @@ HRESULT WINAPI IWineD3DSwapChainImpl_QueryInterface(IWineD3DSwapChain *iface, RE
*ppobj = This;
return WINED3D_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -42,6 +42,7 @@ HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DTexture *iface, REFIID
*ppobj = This;
return WINED3D_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -39,8 +39,9 @@ HRESULT WINAPI IWineD3DVertexBufferImpl_QueryInterface(IWineD3DVertexBuffer *ifa
|| IsEqualGUID(riid, &IID_IWineD3DVertexBuffer)){
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -403,8 +403,9 @@ HRESULT WINAPI IWineD3DVertexDeclarationImpl_QueryInterface(IWineD3DVertexDeclar
|| IsEqualGUID(riid, &IID_IWineD3DVertexDeclaration)){
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -2068,8 +2068,9 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_QueryInterface(IWineD3DVertexShader *ifa
|| IsEqualGUID(riid, &IID_IWineD3DVertexShader)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
......@@ -38,8 +38,9 @@ HRESULT WINAPI IWineD3DVolumeImpl_QueryInterface(IWineD3DVolume *iface, REFIID r
|| IsEqualGUID(riid, &IID_IWineD3DVolume)){
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......@@ -141,7 +142,10 @@ HRESULT WINAPI IWineD3DVolumeImpl_GetContainer(IWineD3DVolume *iface, REFIID rii
}
TRACE("Relaying to QueryInterface\n");
return IUnknown_QueryInterface(This->container, riid, ppContainer);
if (IUnknown_QueryInterface(This->container, riid, ppContainer) != S_OK)
return WINED3DERR_INVALIDCALL;
return WINED3D_OK;
}
HRESULT WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DVOLUME_DESC* pDesc) {
......
......@@ -40,8 +40,9 @@ HRESULT WINAPI IWineD3DVolumeTextureImpl_QueryInterface(IWineD3DVolumeTexture *i
|| IsEqualGUID(riid, &IID_IWineD3DVolumeTexture)) {
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
return S_OK;
}
*ppobj = NULL;
return E_NOINTERFACE;
}
......
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