device.c revision 3a974120cf0d8d23b2531cd62fe04532e6ac205e
/*
* IDirect3DDevice9 implementation
*
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "d3d9_private.h"
{
/* Don't translate FOURCC formats */
switch(format)
{
case WINED3DFMT_UNKNOWN: return D3DFMT_UNKNOWN;
case WINED3DFMT_B8G8R8_UNORM: return D3DFMT_R8G8B8;
case WINED3DFMT_B8G8R8A8_UNORM: return D3DFMT_A8R8G8B8;
case WINED3DFMT_B8G8R8X8_UNORM: return D3DFMT_X8R8G8B8;
case WINED3DFMT_B5G6R5_UNORM: return D3DFMT_R5G6B5;
case WINED3DFMT_B5G5R5X1_UNORM: return D3DFMT_X1R5G5B5;
case WINED3DFMT_B5G5R5A1_UNORM: return D3DFMT_A1R5G5B5;
case WINED3DFMT_B4G4R4A4_UNORM: return D3DFMT_A4R4G4B4;
case WINED3DFMT_B2G3R3_UNORM: return D3DFMT_R3G3B2;
case WINED3DFMT_A8_UNORM: return D3DFMT_A8;
case WINED3DFMT_B2G3R3A8_UNORM: return D3DFMT_A8R3G3B2;
case WINED3DFMT_B4G4R4X4_UNORM: return D3DFMT_X4R4G4B4;
case WINED3DFMT_R10G10B10A2_UNORM: return D3DFMT_A2B10G10R10;
case WINED3DFMT_R8G8B8A8_UNORM: return D3DFMT_A8B8G8R8;
case WINED3DFMT_R8G8B8X8_UNORM: return D3DFMT_X8B8G8R8;
case WINED3DFMT_R16G16_UNORM: return D3DFMT_G16R16;
case WINED3DFMT_B10G10R10A2_UNORM: return D3DFMT_A2R10G10B10;
case WINED3DFMT_R16G16B16A16_UNORM: return D3DFMT_A16B16G16R16;
case WINED3DFMT_P8_UINT_A8_UNORM: return D3DFMT_A8P8;
case WINED3DFMT_P8_UINT: return D3DFMT_P8;
case WINED3DFMT_L8_UNORM: return D3DFMT_L8;
case WINED3DFMT_L8A8_UNORM: return D3DFMT_A8L8;
case WINED3DFMT_L4A4_UNORM: return D3DFMT_A4L4;
case WINED3DFMT_R8G8_SNORM: return D3DFMT_V8U8;
case WINED3DFMT_R5G5_SNORM_L6_UNORM: return D3DFMT_L6V5U5;
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: return D3DFMT_X8L8V8U8;
case WINED3DFMT_R8G8B8A8_SNORM: return D3DFMT_Q8W8V8U8;
case WINED3DFMT_R16G16_SNORM: return D3DFMT_V16U16;
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: return D3DFMT_A2W10V10U10;
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
case WINED3DFMT_D24_UNORM_S8_UINT: return D3DFMT_D24S8;
case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
case WINED3DFMT_D16_UNORM: return D3DFMT_D16;
case WINED3DFMT_L16_UNORM: return D3DFMT_L16;
case WINED3DFMT_D32_FLOAT: return D3DFMT_D32F_LOCKABLE;
case WINED3DFMT_S8_UINT_D24_FLOAT: return D3DFMT_D24FS8;
case WINED3DFMT_VERTEXDATA: return D3DFMT_VERTEXDATA;
case WINED3DFMT_R16_UINT: return D3DFMT_INDEX16;
case WINED3DFMT_R32_UINT: return D3DFMT_INDEX32;
case WINED3DFMT_R16G16B16A16_SNORM: return D3DFMT_Q16W16V16U16;
case WINED3DFMT_R16_FLOAT: return D3DFMT_R16F;
case WINED3DFMT_R16G16_FLOAT: return D3DFMT_G16R16F;
case WINED3DFMT_R16G16B16A16_FLOAT: return D3DFMT_A16B16G16R16F;
case WINED3DFMT_R32_FLOAT: return D3DFMT_R32F;
case WINED3DFMT_R32G32_FLOAT: return D3DFMT_G32R32F;
case WINED3DFMT_R32G32B32A32_FLOAT: return D3DFMT_A32B32G32R32F;
case WINED3DFMT_R8G8_SNORM_Cx: return D3DFMT_CxV8U8;
default:
return D3DFMT_UNKNOWN;
}
}
{
/* Don't translate FOURCC formats */
switch(format)
{
case D3DFMT_UNKNOWN: return WINED3DFMT_UNKNOWN;
case D3DFMT_R8G8B8: return WINED3DFMT_B8G8R8_UNORM;
case D3DFMT_A8R8G8B8: return WINED3DFMT_B8G8R8A8_UNORM;
case D3DFMT_X8R8G8B8: return WINED3DFMT_B8G8R8X8_UNORM;
case D3DFMT_R5G6B5: return WINED3DFMT_B5G6R5_UNORM;
case D3DFMT_X1R5G5B5: return WINED3DFMT_B5G5R5X1_UNORM;
case D3DFMT_A1R5G5B5: return WINED3DFMT_B5G5R5A1_UNORM;
case D3DFMT_A4R4G4B4: return WINED3DFMT_B4G4R4A4_UNORM;
case D3DFMT_R3G3B2: return WINED3DFMT_B2G3R3_UNORM;
case D3DFMT_A8: return WINED3DFMT_A8_UNORM;
case D3DFMT_A8R3G3B2: return WINED3DFMT_B2G3R3A8_UNORM;
case D3DFMT_X4R4G4B4: return WINED3DFMT_B4G4R4X4_UNORM;
case D3DFMT_A2B10G10R10: return WINED3DFMT_R10G10B10A2_UNORM;
case D3DFMT_A8B8G8R8: return WINED3DFMT_R8G8B8A8_UNORM;
case D3DFMT_X8B8G8R8: return WINED3DFMT_R8G8B8X8_UNORM;
case D3DFMT_G16R16: return WINED3DFMT_R16G16_UNORM;
case D3DFMT_A2R10G10B10: return WINED3DFMT_B10G10R10A2_UNORM;
case D3DFMT_A16B16G16R16: return WINED3DFMT_R16G16B16A16_UNORM;
case D3DFMT_A8P8: return WINED3DFMT_P8_UINT_A8_UNORM;
case D3DFMT_P8: return WINED3DFMT_P8_UINT;
case D3DFMT_L8: return WINED3DFMT_L8_UNORM;
case D3DFMT_A8L8: return WINED3DFMT_L8A8_UNORM;
case D3DFMT_A4L4: return WINED3DFMT_L4A4_UNORM;
case D3DFMT_V8U8: return WINED3DFMT_R8G8_SNORM;
case D3DFMT_L6V5U5: return WINED3DFMT_R5G5_SNORM_L6_UNORM;
case D3DFMT_X8L8V8U8: return WINED3DFMT_R8G8_SNORM_L8X8_UNORM;
case D3DFMT_Q8W8V8U8: return WINED3DFMT_R8G8B8A8_SNORM;
case D3DFMT_V16U16: return WINED3DFMT_R16G16_SNORM;
case D3DFMT_A2W10V10U10: return WINED3DFMT_R10G10B10_SNORM_A2_UNORM;
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_D24_UNORM_S8_UINT;
case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
case D3DFMT_D16: return WINED3DFMT_D16_UNORM;
case D3DFMT_L16: return WINED3DFMT_L16_UNORM;
case D3DFMT_D32F_LOCKABLE: return WINED3DFMT_D32_FLOAT;
case D3DFMT_D24FS8: return WINED3DFMT_S8_UINT_D24_FLOAT;
case D3DFMT_VERTEXDATA: return WINED3DFMT_VERTEXDATA;
case D3DFMT_INDEX16: return WINED3DFMT_R16_UINT;
case D3DFMT_INDEX32: return WINED3DFMT_R32_UINT;
case D3DFMT_Q16W16V16U16: return WINED3DFMT_R16G16B16A16_SNORM;
case D3DFMT_R16F: return WINED3DFMT_R16_FLOAT;
case D3DFMT_G16R16F: return WINED3DFMT_R16G16_FLOAT;
case D3DFMT_A16B16G16R16F: return WINED3DFMT_R16G16B16A16_FLOAT;
case D3DFMT_R32F: return WINED3DFMT_R32_FLOAT;
case D3DFMT_G32R32F: return WINED3DFMT_R32G32_FLOAT;
case D3DFMT_A32B32G32R32F: return WINED3DFMT_R32G32B32A32_FLOAT;
case D3DFMT_CxV8U8: return WINED3DFMT_R8G8_SNORM_Cx;
default:
return WINED3DFMT_UNKNOWN;
}
}
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
{
switch(primitive_type)
{
case D3DPT_POINTLIST:
return primitive_count;
case D3DPT_LINELIST:
return primitive_count * 2;
case D3DPT_LINESTRIP:
return primitive_count + 1;
case D3DPT_TRIANGLELIST:
return primitive_count * 3;
case D3DPT_TRIANGLESTRIP:
case D3DPT_TRIANGLEFAN:
return primitive_count + 2;
default:
return 0;
}
}
{
}
/* IDirect3D IUnknown parts follow: */
static HRESULT WINAPI IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9EX iface, REFIID riid, LPVOID* ppobj) {
return S_OK;
/* Find out if the creating d3d9 interface was created with Direct3DCreate9Ex.
* It doesn't matter with which function the device was created.
*/
return S_OK;
} else {
WARN("IDirect3D9 instance wasn't created with CreateDirect3D9Ex, returning E_NOINTERFACE\n");
return E_NOINTERFACE;
}
}
{
return S_OK;
}
return E_NOINTERFACE;
}
return ref;
}
if (This->inDestruction) return 0;
if (ref == 0) {
unsigned i;
for(i = 0; i < This->numConvertedDecls; i++) {
/* Unless Wine is buggy or the app has a bug the refcount will be 0, because decls hold a reference to the
* device
*/
}
#ifndef VBOX_WITH_WDDM
#endif
}
return ref;
}
/* IDirect3DDevice Interface follow: */
{
{
TRACE("D3D9 device is marked not reset.\n");
return D3DERR_DEVICENOTRESET;
}
return D3D_OK;
}
return hr;
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9EX iface, IDirect3D9** ppD3D9) {
return D3DERR_INVALIDCALL;
}
{
} else {
FIXME("Call to IWineD3DDevice_GetDirect3D failed\n");
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9EX iface, D3DCAPS9* pCaps) {
return D3DERR_INVALIDCALL;
}
return D3DERR_INVALIDCALL; /* well this is what MSDN says to return */
}
/* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps */
return hrc;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9EX iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) {
hr = IWineD3DDevice_GetCreationParameters(This->WineD3DDevice, (WINED3DDEVICE_CREATION_PARAMETERS *) pParameters);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9EX iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
if(!pCursorBitmap) {
WARN("No cursor bitmap, returning WINED3DERR_INVALIDCALL\n");
return WINED3DERR_INVALIDCALL;
}
hr = IWineD3DDevice_SetCursorProperties(This->WineD3DDevice, XHotSpot, YHotSpot, pSurface->wineD3DSurface);
return hr;
}
static void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9EX iface, int XScreenSpace, int YScreenSpace, DWORD Flags) {
}
return ret;
}
#ifdef VBOX_WITH_WDDM
#else
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
#endif
{
TRACE("iface %p, present_parameters %p, swapchain %p.\n",
if (!object)
{
ERR("Failed to allocate swapchain memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
#ifdef VBOX_WITH_WDDM
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
{
HRESULT hr = IDirect3DDevice9Impl_DoCreateAdditionalSwapChain(iface, present_parameters, &newSwapchain);
{
return hr;
}
/* add swapchain to the swapchain list */
{
return hr;
}
return D3D_OK;
}
#endif
switch(type) {
case D3DRTYPE_SURFACE:
break;
case D3DRTYPE_VOLUME:
break;
case D3DRTYPE_INDEXBUFFER:
break;
case D3DRTYPE_VERTEXBUFFER:
break;
/* No need to check for textures. If there is a D3DPOOL_DEFAULT texture, there
* is a D3DPOOL_DEFAULT surface or volume as well
*/
default:
break;
}
if(pool == WINED3DPOOL_DEFAULT) {
if(IUnknown_Release(parent) == 0) {
} else {
WARN("Resource %p(wineD3D %p) with pool D3DPOOL_DEFAULT blocks the Reset call\n", parent, resource);
*resources_ok = FALSE;
}
} else {
}
return ret;
}
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
UINT i;
/* Reset states that hold a COM object. WineD3D holds an internal reference to set objects, because
* such objects can still be used for rendering after their external d3d9 object has been destroyed.
* These objects must not be enumerated. Unsetting them tells WineD3D that the application will not
* make use of the hidden reference and destroys the objects.
*
* Unsetting them is no problem, because the states are supposed to be reset anyway. If the validation
* below fails, the device is considered "lost", and _Reset and _Release are the only allowed calls
*/
for(i = 0; i < 16; i++) {
}
for(i = 0; i < 16; i++) {
}
if(!resources_ok) {
WARN("The application is holding D3DPOOL_DEFAULT resources, rejecting reset\n");
return WINED3DERR_INVALIDCALL;
}
localParameters.BackBufferFormat = wined3dformat_from_d3dformat(pPresentationParameters->BackBufferFormat);
localParameters.AutoDepthStencilFormat = wined3dformat_from_d3dformat(pPresentationParameters->AutoDepthStencilFormat);
pPresentationParameters->BackBufferFormat = d3dformat_from_wined3dformat(localParameters.BackBufferFormat);
pPresentationParameters->AutoDepthStencilFormat = d3dformat_from_wined3dformat(localParameters.AutoDepthStencilFormat);
} else {
}
return hr;
}
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9EX iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA*
pDirtyRegion) {
TRACE("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p.\n",
hr = IWineD3DDevice_Present(This->WineD3DDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 ** ppBackBuffer) {
TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, iSwapChain, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, &retSurface);
}
return rc;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
hr = IWineD3DDevice_GetRasterStatus(This->WineD3DDevice, iSwapChain, (WINED3DRASTER_STATUS *) pRasterStatus);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetDialogBoxMode(LPDIRECT3DDEVICE9EX iface, BOOL bEnableDialogs) {
return hr;
}
{
/* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
IWineD3DDevice_SetGammaRamp(This->WineD3DDevice, iSwapChain, Flags, (CONST WINED3DGAMMARAMP *)pRamp);
}
static void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) {
/* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
}
#ifdef VBOX_WITH_WDDM
//#pragma comment(linker, "/export:VBoxWineExD3DDev9Flush=_VBoxWineExD3DDev9Flush@4")
{
return hr;
}
//#pragma comment(linker, "/export:VBoxWineExD3DDev9CreateTexture=_VBoxWineExD3DDev9CreateTexture@40")
void **pavClientMem) /* <- extension arg to pass in the client memory buffer,
* applicable ONLY for SYSMEM textures */
{
TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
);
{
return hr;
}
return D3D_OK;
}
VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Update(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS * pParams, IDirect3DDevice9Ex **outIface)
{
return D3D_OK;
}
void **pavClientMem) /* <- extension arg to pass in the client memory buffer,
* applicable ONLY for SYSMEM textures */
{
TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate cube texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = cubetexture_init(object, This, edge_length, levels, usage, format, pool, shared_handle, pavClientMem);
{
return hr;
}
return D3D_OK;
}
#endif
{
#ifdef VBOX_WITH_WDDM
#else
TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return D3D_OK;
#endif
}
{
TRACE("iface %p, width %u, height %u, depth %u, levels %u\n",
TRACE("usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate volume texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return D3D_OK;
}
{
#ifdef VBOX_WITH_WDDM
#else
TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate cube texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return D3D_OK;
#endif
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage,
{
TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate buffer memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage,
{
TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p, shared_handle %p.\n",
if (!object)
{
ERR("Failed to allocate buffer memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return D3D_OK;
}
static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
#ifdef VBOX_WITH_WDDM
, void *pvClientMem
#endif
)
{
TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.\n"
"usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
if (!object)
{
FIXME("Failed to allocate surface memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
#ifdef VBOX_WITH_WDDM
#endif
);
{
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(IDirect3DDevice9Ex *iface, UINT Width, UINT Height,
{
TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
"lockable %#x, surface %p, shared_handle %p.\n",
hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
#ifdef VBOX_WITH_WDDM
, NULL
#endif
);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
"discard %#x, surface %p, shared_handle %p.\n",
#ifdef VBOX_WITH_WDDM
, NULL
#endif
);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9EX iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) {
TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.\n",
hr = IWineD3DDevice_UpdateSurface(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestinationSurface)->wineD3DSurface, pDestPoint);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9EX iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice, ((IDirect3DBaseTexture9Impl *)pSourceTexture)->wineD3DBaseTexture, ((IDirect3DBaseTexture9Impl *)pDestinationTexture)->wineD3DBaseTexture);
return hr;
}
{
hr = IWineD3DSurface_BltFast(destSurface->wineD3DSurface, 0, 0, renderTarget->wineD3DSurface, NULL, WINEDDBLTFAST_NOCOLORKEY);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
hr = IWineD3DDevice_GetFrontBufferData(This->WineD3DDevice, iSwapChain, destSurface->wineD3DSurface);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *pSourceSurface,
const RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, const RECT *pDestRect, D3DTEXTUREFILTERTYPE Filter)
{
TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.\n",
hr = IWineD3DSurface_Blt(dst->wineD3DSurface, pDestRect, src->wineD3DSurface, pSourceRect, 0, NULL, Filter);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9EX iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
/* This method is only allowed with surfaces that are render targets, or offscreen plain surfaces
* in D3DPOOL_DEFAULT
*/
if(!(usage & WINED3DUSAGE_RENDERTARGET) && (pool != WINED3DPOOL_DEFAULT || restype != WINED3DRTYPE_SURFACE)) {
WARN("Surface is not a render target, or not a stand-alone D3DPOOL_DEFAULT surface\n");
return D3DERR_INVALIDCALL;
}
/* Colorfill can only be used on rendertarget surfaces, or offscreen plain surfaces in D3DPOOL_DEFAULT */
/* Note: D3DRECT is compatible with WINED3DRECT */
hr = IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, (CONST WINED3DRECT*)pRect, color);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE* pSharedHandle) {
TRACE("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p.\n",
if(Pool == D3DPOOL_MANAGED ){
FIXME("Attempting to create a managed offscreen plain surface\n");
return D3DERR_INVALIDCALL;
}
/*
'Off-screen plain surfaces are always lockable, regardless of their pool types.'
but then...
D3DPOOL_DEFAULT is the appropriate pool for use with the IDirect3DDevice9::StretchRect and IDirect3DDevice9::ColorFill.
Why, their always lockable?
should I change the usage to dynamic?
*/
hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
0 /* MultisampleQuality */
#ifdef VBOX_WITH_WDDM
, NULL
#endif
);
return hr;
}
/* TODO: move to wineD3D */
static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
{
return D3DERR_INVALIDCALL;
}
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL, TRUE);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9 **ppRenderTarget) {
if (ppRenderTarget == NULL) {
return D3DERR_INVALIDCALL;
}
{
return D3DERR_INVALIDCALL;
}
{
}
else if (!pRenderTarget)
{
*ppRenderTarget = NULL;
}
else
{
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetDepthStencilSurface(LPDIRECT3DDEVICE9EX iface, IDirect3DSurface9* pZStencilSurface) {
}
hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, NULL==pSurface ? NULL : pSurface->wineD3DSurface);
if (pZStencilSurface) {
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE9EX iface, IDirect3DSurface9 **ppZStencilSurface) {
if(ppZStencilSurface == NULL){
return D3DERR_INVALIDCALL;
}
if (hr == WINED3D_OK) {
} else {
if (hr != WINED3DERR_NOTFOUND)
}
return hr;
}
return hr;
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9EX iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) {
TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
/* Note: D3DRECT is compatible with WINED3DRECT */
hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9EX iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* lpMatrix) {
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetTransform(LPDIRECT3DDEVICE9EX iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9EX iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9EX iface, CONST D3DVIEWPORT9* pViewport) {
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9EX iface, D3DVIEWPORT9* pViewport) {
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9EX iface, CONST D3DMATERIAL9* pMaterial) {
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9EX iface, D3DMATERIAL9* pMaterial) {
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetLight(LPDIRECT3DDEVICE9EX iface, DWORD Index, CONST D3DLIGHT9* pLight) {
/* Note: D3DLIGHT9 is compatible with WINED3DLIGHT */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetLight(LPDIRECT3DDEVICE9EX iface, DWORD Index, D3DLIGHT9* pLight) {
/* Note: D3DLIGHT9 is compatible with WINED3DLIGHT */
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_LightEnable(LPDIRECT3DDEVICE9EX iface, DWORD Index, BOOL Enable) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetLightEnable(LPDIRECT3DDEVICE9EX iface, DWORD Index, BOOL* pEnable) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetClipPlane(LPDIRECT3DDEVICE9EX iface, DWORD Index, CONST float* pPlane) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetClipPlane(LPDIRECT3DDEVICE9EX iface, DWORD Index, float* pPlane) {
return hr;
}
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_SetRenderState(LPDIRECT3DDEVICE9EX iface, D3DRENDERSTATETYPE State, DWORD Value) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderState(LPDIRECT3DDEVICE9EX iface, D3DRENDERSTATETYPE State, DWORD* pValue) {
return hr;
}
{
{
WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL.\n");
return D3DERR_INVALIDCALL;
}
if (!object)
{
ERR("Failed to allocate stateblock memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
{
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(IDirect3DDevice9Ex *iface, IDirect3DStateBlock9 **stateblock)
{
{
return hr;
}
if (!object)
{
ERR("Failed to allocate stateblock memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetClipStatus(LPDIRECT3DDEVICE9EX iface, CONST D3DCLIPSTATUS9* pClipStatus) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9EX iface, D3DCLIPSTATUS9* pClipStatus) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9EX iface, DWORD Stage, IDirect3DBaseTexture9 **ppTexture) {
return D3DERR_INVALIDCALL;
}
} else {
}
}
return rc;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9EX iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) {
return hr;
}
static const WINED3DTEXTURESTAGESTATETYPE tss_lookup[] =
{
WINED3DTSS_FORCE_DWORD, /* 0, unused */
WINED3DTSS_COLOROP, /* 1, D3DTSS_COLOROP */
WINED3DTSS_COLORARG1, /* 2, D3DTSS_COLORARG1 */
WINED3DTSS_COLORARG2, /* 3, D3DTSS_COLORARG2 */
WINED3DTSS_ALPHAOP, /* 4, D3DTSS_ALPHAOP */
WINED3DTSS_ALPHAARG1, /* 5, D3DTSS_ALPHAARG1 */
WINED3DTSS_ALPHAARG2, /* 6, D3DTSS_ALPHAARG2 */
WINED3DTSS_BUMPENVMAT00, /* 7, D3DTSS_BUMPENVMAT00 */
WINED3DTSS_BUMPENVMAT01, /* 8, D3DTSS_BUMPENVMAT01 */
WINED3DTSS_BUMPENVMAT10, /* 9, D3DTSS_BUMPENVMAT10 */
WINED3DTSS_BUMPENVMAT11, /* 10, D3DTSS_BUMPENVMAT11 */
WINED3DTSS_TEXCOORDINDEX, /* 11, D3DTSS_TEXCOORDINDEX */
WINED3DTSS_FORCE_DWORD, /* 12, unused */
WINED3DTSS_FORCE_DWORD, /* 13, unused */
WINED3DTSS_FORCE_DWORD, /* 14, unused */
WINED3DTSS_FORCE_DWORD, /* 15, unused */
WINED3DTSS_FORCE_DWORD, /* 16, unused */
WINED3DTSS_FORCE_DWORD, /* 17, unused */
WINED3DTSS_FORCE_DWORD, /* 18, unused */
WINED3DTSS_FORCE_DWORD, /* 19, unused */
WINED3DTSS_FORCE_DWORD, /* 20, unused */
WINED3DTSS_FORCE_DWORD, /* 21, unused */
WINED3DTSS_BUMPENVLSCALE, /* 22, D3DTSS_BUMPENVLSCALE */
WINED3DTSS_BUMPENVLOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */
WINED3DTSS_TEXTURETRANSFORMFLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
WINED3DTSS_FORCE_DWORD, /* 25, unused */
WINED3DTSS_COLORARG0, /* 26, D3DTSS_COLORARG0 */
WINED3DTSS_ALPHAARG0, /* 27, D3DTSS_ALPHAARG0 */
WINED3DTSS_RESULTARG, /* 28, D3DTSS_RESULTARG */
WINED3DTSS_FORCE_DWORD, /* 29, unused */
WINED3DTSS_FORCE_DWORD, /* 30, unused */
WINED3DTSS_FORCE_DWORD, /* 31, unused */
WINED3DTSS_CONSTANT, /* 32, D3DTSS_CONSTANT */
};
static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9EX iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVICE9EX iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetSamplerState(IDirect3DDevice9Ex *iface, DWORD Sampler,
{
return hr;
}
static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_SetSamplerState(LPDIRECT3DDEVICE9EX iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_ValidateDevice(LPDIRECT3DDEVICE9EX iface, DWORD* pNumPasses) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetPaletteEntries(IDirect3DDevice9Ex *iface, UINT PaletteNumber,
const PALETTEENTRY *pEntries)
{
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetPaletteEntries(LPDIRECT3DDEVICE9EX iface, UINT PaletteNumber, PALETTEENTRY* pEntries) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE9EX iface, UINT PaletteNumber) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE9EX iface, UINT* PaletteNumber) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetScissorRect(LPDIRECT3DDEVICE9EX iface, CONST RECT* pRect) {
return hr;
}
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9EX iface, BOOL bSoftware) {
return hr;
}
return ret;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetNPatchMode(LPDIRECT3DDEVICE9EX iface, float nSegments) {
return hr;
}
float ret;
return ret;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE PrimitiveType,
{
TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE9EX iface, D3DPRIMITIVETYPE PrimitiveType,
TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u,\n"
"vertex_count %u, start_idx %u, primitive_count %u.\n",
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE PrimitiveType,
{
TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9EX iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex,
TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, index_count %u, primitive_count %u,\n"
"index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9EX iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
TRACE("iface %p, src_start_idx %u, dst_idx %u, vertex_count %u, dst_buffer %p, declaration %p, flags %#x.\n",
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, dest->wineD3DVertexBuffer, Decl ? Decl->wineD3DVertexDeclaration : NULL, Flags, dest->fvf);
return hr;
}
{
if (!declaration)
{
WARN("Caller passed a NULL declaration, returning D3DERR_INVALIDCALL.\n");
return D3DERR_INVALIDCALL;
}
if (!object)
{
ERR("Failed to allocate vertex declaration memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
low = 0;
TRACE("%d ", p);
return convertedDecls[p];
low = p + 1;
} else {
high = p - 1;
}
}
if(!convertedDecls) {
/* This will destroy it */
return NULL;
}
}
memmove(convertedDecls + low + 1, convertedDecls + low, sizeof(IDirect3DVertexDeclaration9Impl *) * (This->numConvertedDecls - low));
/* Will prevent the decl from being destroyed */
return pDecl;
}
if (!FVF)
{
return D3D_OK;
}
if (!decl)
{
/* Any situation when this should happen, except out of memory? */
ERR("Failed to create a converted vertex declaration\n");
return D3DERR_DRIVERINTERNALERROR;
}
return hr;
}
{
{
*pFVF = 0;
return hr;
}
if (decl)
{
}
else
{
*pFVF = 0;
}
return hr;
}
{
if (!object)
{
ERR("Failed to allocate vertex shader memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
TRACE("iface %p, stream_idx %u, buffer %p, offset %u, stride %u.\n",
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9 **pStream, UINT* OffsetInBytes, UINT* pStride) {
TRACE("iface %p, stream_idx %u, buffer %p, offset %p, stride %p.\n",
return D3DERR_INVALIDCALL;
}
rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, &retStream, OffsetInBytes, pStride);
}else{
}
}
return rc;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSourceFreq(IDirect3DDevice9Ex *iface, UINT StreamNumber,
{
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, UINT* Divider) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9EX iface, IDirect3DIndexBuffer9* pIndexData) {
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9EX iface, IDirect3DIndexBuffer9 **ppIndexData) {
if(ppIndexData == NULL){
return D3DERR_INVALIDCALL;
}
} else {
*ppIndexData = NULL;
}
return rc;
}
{
if (!object)
{
FIXME("Failed to allocate pixel shader memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9EX iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
TRACE("iface %p, handle %#x, segment_count %p, patch_info %p.\n",
hr = IWineD3DDevice_DrawRectPatch(This->WineD3DDevice, Handle, pNumSegs, (CONST WINED3DRECTPATCH_INFO *)pRectPatchInfo);
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_DrawTriPatch(LPDIRECT3DDEVICE9EX iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
TRACE("iface %p, handle %#x, segment_count %p, patch_info %p.\n",
hr = IWineD3DDevice_DrawTriPatch(This->WineD3DDevice, Handle, pNumSegs, (CONST WINED3DTRIPATCH_INFO *)pTriPatchInfo);
return hr;
}
return hr;
}
{
if (!object)
{
ERR("Failed to allocate query memory.\n");
return E_OUTOFMEMORY;
}
{
return hr;
}
return D3D_OK;
}
{
FIXME("iface %p, width %u, height %u, rows %p, columns %p stub!\n",
return WINED3DERR_INVALIDCALL;
}
UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y)
{
FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u,\n"
"dst_descs %p, operation %#x, offset_x %u, offset_y %u stub!\n",
return WINED3DERR_INVALIDCALL;
}
{
FIXME("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p, flags %#x stub!\n",
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_GetGPUThreadPriority(IDirect3DDevice9Ex *iface, INT *priority)
{
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_SetGPUThreadPriority(IDirect3DDevice9Ex *iface, INT priority)
{
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_WaitForVBlank(IDirect3DDevice9Ex *iface, UINT swapchain_idx)
{
return WINED3DERR_INVALIDCALL;
}
{
FIXME("iface %p, resources %p, resource_count %u stub!\n",
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_SetMaximumFrameLatency(IDirect3DDevice9Ex *iface, UINT max_latency)
{
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_GetMaximumFrameLatency(IDirect3DDevice9Ex *iface, UINT *max_latency)
{
*max_latency = 2;
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_CheckDeviceState(IDirect3DDevice9Ex *iface, HWND dst_window)
{
return WINED3DERR_INVALIDCALL;
}
UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
{
FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u,\n"
"lockable %#x, surface %p, shared_handle %p, usage %#x stub!\n",
return WINED3DERR_INVALIDCALL;
}
static HRESULT WINAPI IDirect3DDevice9ExImpl_CreateOffscreenPlainSurfaceEx(IDirect3DDevice9Ex *iface,
{
FIXME("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p, usage %#x stub!\n",
return WINED3DERR_INVALIDCALL;
}
UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
{
FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u,\n"
"discard %#x, surface %p, shared_handle %p, usage %#x stub!\n",
return WINED3DERR_INVALIDCALL;
}
{
return WINED3DERR_INVALIDCALL;
}
{
FIXME("iface %p, swapchain_idx %u, mode %p, rotation %p stub!\n", iface, swapchain_idx, mode, rotation);
return WINED3DERR_INVALIDCALL;
}
static const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl =
{
/* IUnknown */
/* IDirect3DDevice9 */
/* IDirect3DDevice9Ex */
};
/* IWineD3DDeviceParent IUnknown methods */
{
return (struct IDirect3DDevice9Impl *)((char*)iface
}
static HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object)
{
}
{
}
{
}
/* IWineD3DDeviceParent methods */
static void STDMETHODCALLTYPE device_parent_WineD3DDeviceCreated(IWineD3DDeviceParent *iface, IWineD3DDevice *device)
{
}
#ifdef VBOX_WITH_WDDM
, void *pvClientMem
#endif
)
{
TRACE("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n"
"\tpool %#x, level %u, face %u, surface %p\n",
#ifdef VBOX_WITH_WDDM
#endif
);
{
return hr;
}
return hr;
}
IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
{
TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, lockable %u, surface %p\n",
{
return hr;
}
/* Implicit surfaces are created with an refcount of 0 */
return hr;
}
static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type,
{
TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, discard %u, surface %p\n",
{
return hr;
}
/* Implicit surfaces are created with an refcount of 0 */
return hr;
}
{
TRACE("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p\n",
/* Allocate the storage for the device */
if (!object)
{
FIXME("Allocation of memory failed\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
{
return hr;
}
return hr;
}
{
/* Copy the presentation parameters */
local_parameters.BackBufferFormat = d3dformat_from_wined3dformat(present_parameters->BackBufferFormat);
local_parameters.AutoDepthStencilFormat = d3dformat_from_wined3dformat(present_parameters->AutoDepthStencilFormat);
#ifdef VBOX_WITH_WDDM
#else
#endif
{
return hr;
}
/* Implicit swap chains are created with an refcount of 0 */
/* Copy back the presentation parameters */
present_parameters->BackBufferFormat = wined3dformat_from_d3dformat(local_parameters.BackBufferFormat);
present_parameters->AutoDepthStencilFormat = wined3dformat_from_d3dformat(local_parameters.AutoDepthStencilFormat);
return hr;
}
static const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl =
{
/* IUnknown methods */
/* IWineD3DDeviceParent methods */
};
HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
{
{
return hr;
}
#ifndef VBOX_WITH_WDDM
if (!parameters->Windowed)
{
{
return hr;
}
}
#endif
{
}
if (!wined3d_parameters)
{
ERR("Failed to allocate wined3d parameters.\n");
return E_OUTOFMEMORY;
}
for (i = 0; i < count; ++i)
{
wined3d_parameters[i].BackBufferFormat = wined3dformat_from_d3dformat(parameters[i].BackBufferFormat);
}
{
#ifndef VBOX_WITH_WDDM
#endif
return hr;
}
for (i = 0; i < count; ++i)
{
parameters[i].BackBufferFormat = d3dformat_from_wined3dformat(wined3d_parameters[i].BackBufferFormat);
}
/* Initialize the converted declaration array. This creates a valid pointer
* and when adding decls HeapReAlloc() can be used without further checking. */
if (!device->convertedDecls)
{
ERR("Failed to allocate FVF vertex declaration map memory.\n");
#ifndef VBOX_WITH_WDDM
#endif
return E_OUTOFMEMORY;
}
return D3D_OK;
}