mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 17:40:58 +00:00
- sync d3d8, d3d9, ddraw, wined3d with Wine 1.1.30
svn path=/trunk/; revision=43166
This commit is contained in:
parent
0e0e175f8d
commit
53240a7115
|
@ -46,6 +46,14 @@ static ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IUnknown_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_AddRef(This->wineD3DCubeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -58,12 +66,10 @@ static ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 ifa
|
|||
if (ref == 0) {
|
||||
TRACE("Releasing child %p\n", This->wineD3DCubeTexture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture, D3D8CB_DestroySurface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IUnknown_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_Release(This->wineD3DCubeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -286,8 +292,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTU
|
|||
return hr;
|
||||
}
|
||||
|
||||
|
||||
const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
|
||||
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DCubeTexture8Impl_QueryInterface,
|
||||
|
@ -313,3 +318,38 @@ const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
|
|||
IDirect3DCubeTexture8Impl_UnlockRect,
|
||||
IDirect3DCubeTexture8Impl_AddDirtyRect
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_cubetexture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_cubetexture_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_cubetexture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
texture->lpVtbl = &Direct3DCubeTexture8_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage & WINED3DUSAGE_MASK,
|
||||
wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
|
||||
(IUnknown *)texture, &d3d8_cubetexture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d cube texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
texture->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IDirect3DDevice8_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
_pD3D8Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
|
||||
_pD3D8Caps->MaxPixelShaderValue = _pWineCaps->PixelShader1xMaxValue;
|
||||
|
||||
void fixup_caps(WINED3DCAPS *pWineCaps);
|
||||
void fixup_caps(WINED3DCAPS *pWineCaps) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Direct3D8 Interfaces: */
|
||||
typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
|
||||
|
@ -133,7 +133,7 @@ typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3D8Vtbl Direct3D8_Vtbl;
|
||||
extern const IDirect3D8Vtbl Direct3D8_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3D implementation structure
|
||||
|
@ -155,8 +155,8 @@ struct IDirect3D8Impl
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
|
||||
extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl;
|
||||
extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DDevice8 implementation structure
|
||||
|
@ -218,7 +218,6 @@ struct IDirect3DDevice8Impl
|
|||
/*****************************************************************************
|
||||
* IDirect3DVolume8 implementation structure
|
||||
*/
|
||||
extern const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl;
|
||||
struct IDirect3DVolume8Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
|
@ -235,6 +234,9 @@ struct IDirect3DVolume8Impl
|
|||
IUnknown *forwardReference;
|
||||
};
|
||||
|
||||
HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height,
|
||||
UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ------------------- */
|
||||
/* IDirect3DSwapChain8 */
|
||||
/* ------------------- */
|
||||
|
@ -242,7 +244,7 @@ struct IDirect3DVolume8Impl
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
|
||||
extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DSwapChain8 implementation structure
|
||||
|
@ -264,11 +266,6 @@ struct IDirect3DSwapChain8Impl
|
|||
/* IDirect3DSurface8 */
|
||||
/* ----------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DSurface8 implementation structure
|
||||
*/
|
||||
|
@ -289,11 +286,12 @@ struct IDirect3DSurface8Impl
|
|||
|
||||
/* If set forward refcounting to this object */
|
||||
IUnknown *forwardReference;
|
||||
|
||||
/* Flags an implicit surface */
|
||||
BOOL isImplicit;
|
||||
};
|
||||
|
||||
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
||||
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ------------------ */
|
||||
/* IDirect3DResource8 */
|
||||
/* ------------------ */
|
||||
|
@ -301,7 +299,7 @@ struct IDirect3DSurface8Impl
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
|
||||
extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DResource8 implementation structure
|
||||
|
@ -320,11 +318,6 @@ struct IDirect3DResource8Impl
|
|||
/* IDirect3DVertexBuffer8 */
|
||||
/* ---------------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexBuffer8 implementation structure
|
||||
*/
|
||||
|
@ -343,15 +336,13 @@ struct IDirect3DVertexBuffer8Impl
|
|||
DWORD fvf;
|
||||
};
|
||||
|
||||
HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
||||
UINT size, DWORD usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* --------------------- */
|
||||
/* IDirect3DIndexBuffer8 */
|
||||
/* --------------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DIndexBuffer8 implementation structure
|
||||
*/
|
||||
|
@ -370,6 +361,9 @@ struct IDirect3DIndexBuffer8Impl
|
|||
WINED3DFORMAT format;
|
||||
};
|
||||
|
||||
HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
||||
UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* --------------------- */
|
||||
/* IDirect3DBaseTexture8 */
|
||||
/* --------------------- */
|
||||
|
@ -391,11 +385,6 @@ struct IDirect3DBaseTexture8Impl
|
|||
/* IDirect3DCubeTexture8 */
|
||||
/* --------------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DCubeTexture8 implementation structure
|
||||
*/
|
||||
|
@ -412,15 +401,13 @@ struct IDirect3DCubeTexture8Impl
|
|||
LPDIRECT3DDEVICE8 parentDevice;
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------- */
|
||||
/* IDirect3DTexture8 */
|
||||
/* ----------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DTexture8 implementation structure
|
||||
*/
|
||||
|
@ -437,15 +424,13 @@ struct IDirect3DTexture8Impl
|
|||
LPDIRECT3DDEVICE8 parentDevice;
|
||||
};
|
||||
|
||||
HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------------- */
|
||||
/* IDirect3DVolumeTexture8 */
|
||||
/* ----------------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVolumeTexture8 implementation structure
|
||||
*/
|
||||
|
@ -462,6 +447,9 @@ struct IDirect3DVolumeTexture8Impl
|
|||
LPDIRECT3DDEVICE8 parentDevice;
|
||||
};
|
||||
|
||||
HRESULT volumetexture_init(IDirect3DVolumeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------------- */
|
||||
/* IDirect3DStateBlockImpl */
|
||||
/* ----------------------- */
|
||||
|
@ -510,7 +498,7 @@ DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
|
||||
extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DStateBlock implementation structure
|
||||
|
@ -542,9 +530,6 @@ DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
|
|||
#define IDirect3DVertexDeclaration8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DVertexDeclaration8_Release(p) (p)->lpVtbl->Release(p)
|
||||
|
||||
/*** Implementation ***/
|
||||
extern const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl;
|
||||
|
||||
typedef struct {
|
||||
const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
|
||||
LONG ref_count;
|
||||
|
@ -556,6 +541,10 @@ typedef struct {
|
|||
DWORD shader_handle;
|
||||
} IDirect3DVertexDeclaration8Impl;
|
||||
|
||||
HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration8Impl *declaration,
|
||||
IDirect3DDevice8Impl *device, const DWORD *elements, DWORD shader_handle) DECLSPEC_HIDDEN;
|
||||
HRESULT vertexdeclaration_init_fvf(IDirect3DVertexDeclaration8Impl *declaration,
|
||||
IDirect3DDevice8Impl *device, DWORD fvf) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexShader8 interface
|
||||
|
@ -597,11 +586,6 @@ DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
|
|||
#define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p)
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexShader implementation structure
|
||||
*/
|
||||
|
@ -614,19 +598,11 @@ struct IDirect3DVertexShader8Impl {
|
|||
IWineD3DVertexShader *wineD3DVertexShader;
|
||||
};
|
||||
|
||||
HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Impl *device,
|
||||
const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN;
|
||||
|
||||
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
|
||||
|
||||
|
||||
/* ------------------------ */
|
||||
/* IDirect3DPixelShaderImpl */
|
||||
/* ------------------------ */
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DPixelShader implementation structure
|
||||
*/
|
||||
|
@ -638,22 +614,22 @@ typedef struct IDirect3DPixelShader8Impl {
|
|||
IWineD3DPixelShader *wineD3DPixelShader;
|
||||
} IDirect3DPixelShader8Impl;
|
||||
|
||||
HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device,
|
||||
const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN;
|
||||
|
||||
/**
|
||||
* Internals functions
|
||||
*
|
||||
* to see how not defined it here
|
||||
*/
|
||||
D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format);
|
||||
WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format);
|
||||
void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader);
|
||||
UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, WINED3DVERTEXELEMENT **wined3d_elements);
|
||||
size_t parse_token(const DWORD* pToken);
|
||||
D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format) DECLSPEC_HIDDEN;
|
||||
WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
|
||||
void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader) DECLSPEC_HIDDEN;
|
||||
UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size,
|
||||
WINED3DVERTEXELEMENT **wined3d_elements) DECLSPEC_HIDDEN;
|
||||
size_t parse_token(const DWORD *pToken) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Callbacks */
|
||||
extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
|
||||
extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
|
||||
extern ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif /* __WINE_D3DX8_PRIVATE_H */
|
||||
|
|
|
@ -46,37 +46,37 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
|
|||
switch(format)
|
||||
{
|
||||
case WINED3DFMT_UNKNOWN: return D3DFMT_UNKNOWN;
|
||||
case WINED3DFMT_R8G8B8: return D3DFMT_R8G8B8;
|
||||
case WINED3DFMT_A8R8G8B8: return D3DFMT_A8R8G8B8;
|
||||
case WINED3DFMT_X8R8G8B8: return D3DFMT_X8R8G8B8;
|
||||
case WINED3DFMT_R5G6B5: return D3DFMT_R5G6B5;
|
||||
case WINED3DFMT_X1R5G5B5: return D3DFMT_X1R5G5B5;
|
||||
case WINED3DFMT_A1R5G5B5: return D3DFMT_A1R5G5B5;
|
||||
case WINED3DFMT_A4R4G4B4: return D3DFMT_A4R4G4B4;
|
||||
case WINED3DFMT_R3G3B2: return D3DFMT_R3G3B2;
|
||||
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_A8R3G3B2: return D3DFMT_A8R3G3B2;
|
||||
case WINED3DFMT_X4R4G4B4: return D3DFMT_X4R4G4B4;
|
||||
case WINED3DFMT_B2G3R3A8_UNORM: return D3DFMT_A8R3G3B2;
|
||||
case WINED3DFMT_B4G4R4X4_UNORM: return D3DFMT_X4R4G4B4;
|
||||
case WINED3DFMT_R10G10B10A2_UNORM: return D3DFMT_A2B10G10R10;
|
||||
case WINED3DFMT_R16G16_UNORM: return D3DFMT_G16R16;
|
||||
case WINED3DFMT_A8P8: return D3DFMT_A8P8;
|
||||
case WINED3DFMT_P8: return D3DFMT_P8;
|
||||
case WINED3DFMT_L8: return D3DFMT_L8;
|
||||
case WINED3DFMT_A8L8: return D3DFMT_A8L8;
|
||||
case WINED3DFMT_A4L4: return D3DFMT_A4L4;
|
||||
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_L6V5U5: return D3DFMT_L6V5U5;
|
||||
case WINED3DFMT_X8L8V8U8: return D3DFMT_X8L8V8U8;
|
||||
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_W11V11U10: return D3DFMT_W11V11U10;
|
||||
case WINED3DFMT_A2W10V10U10: return D3DFMT_A2W10V10U10;
|
||||
case WINED3DFMT_R10G11B11_SNORM: return D3DFMT_W11V11U10;
|
||||
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: return D3DFMT_A2W10V10U10;
|
||||
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
|
||||
case WINED3DFMT_D32: return D3DFMT_D32;
|
||||
case WINED3DFMT_D15S1: return D3DFMT_D15S1;
|
||||
case WINED3DFMT_D24S8: return D3DFMT_D24S8;
|
||||
case WINED3DFMT_D24X8: return D3DFMT_D24X8;
|
||||
case WINED3DFMT_D24X4S4: return D3DFMT_D24X4S4;
|
||||
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM: 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_VERTEXDATA: return D3DFMT_VERTEXDATA;
|
||||
case WINED3DFMT_R16_UINT: return D3DFMT_INDEX16;
|
||||
|
@ -97,37 +97,37 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
|
|||
switch(format)
|
||||
{
|
||||
case D3DFMT_UNKNOWN: return WINED3DFMT_UNKNOWN;
|
||||
case D3DFMT_R8G8B8: return WINED3DFMT_R8G8B8;
|
||||
case D3DFMT_A8R8G8B8: return WINED3DFMT_A8R8G8B8;
|
||||
case D3DFMT_X8R8G8B8: return WINED3DFMT_X8R8G8B8;
|
||||
case D3DFMT_R5G6B5: return WINED3DFMT_R5G6B5;
|
||||
case D3DFMT_X1R5G5B5: return WINED3DFMT_X1R5G5B5;
|
||||
case D3DFMT_A1R5G5B5: return WINED3DFMT_A1R5G5B5;
|
||||
case D3DFMT_A4R4G4B4: return WINED3DFMT_A4R4G4B4;
|
||||
case D3DFMT_R3G3B2: return WINED3DFMT_R3G3B2;
|
||||
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_A8R3G3B2;
|
||||
case D3DFMT_X4R4G4B4: return WINED3DFMT_X4R4G4B4;
|
||||
case D3DFMT_A8R3G3B2: return WINED3DFMT_B2G3R3A8_UNORM;
|
||||
case D3DFMT_X4R4G4B4: return WINED3DFMT_B4G4R4X4_UNORM;
|
||||
case D3DFMT_A2B10G10R10: return WINED3DFMT_R10G10B10A2_UNORM;
|
||||
case D3DFMT_G16R16: return WINED3DFMT_R16G16_UNORM;
|
||||
case D3DFMT_A8P8: return WINED3DFMT_A8P8;
|
||||
case D3DFMT_P8: return WINED3DFMT_P8;
|
||||
case D3DFMT_L8: return WINED3DFMT_L8;
|
||||
case D3DFMT_A8L8: return WINED3DFMT_A8L8;
|
||||
case D3DFMT_A4L4: return WINED3DFMT_A4L4;
|
||||
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_L6V5U5;
|
||||
case D3DFMT_X8L8V8U8: return WINED3DFMT_X8L8V8U8;
|
||||
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_W11V11U10: return WINED3DFMT_W11V11U10;
|
||||
case D3DFMT_A2W10V10U10: return WINED3DFMT_A2W10V10U10;
|
||||
case D3DFMT_W11V11U10: return WINED3DFMT_R10G11B11_SNORM;
|
||||
case D3DFMT_A2W10V10U10: return WINED3DFMT_R10G10B10_SNORM_A2_UNORM;
|
||||
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
|
||||
case D3DFMT_D32: return WINED3DFMT_D32;
|
||||
case D3DFMT_D15S1: return WINED3DFMT_D15S1;
|
||||
case D3DFMT_D24S8: return WINED3DFMT_D24S8;
|
||||
case D3DFMT_D24X8: return WINED3DFMT_D24X8;
|
||||
case D3DFMT_D24X4S4: return WINED3DFMT_D24X4S4;
|
||||
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
|
||||
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
|
||||
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
|
||||
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_VERTEXDATA: return WINED3DFMT_VERTEXDATA;
|
||||
case D3DFMT_INDEX16: return WINED3DFMT_R16_UINT;
|
||||
|
@ -309,7 +309,7 @@ static ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface) {
|
|||
}
|
||||
HeapFree(GetProcessHeap(), 0, This->decls);
|
||||
|
||||
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D8CB_DestroyDepthStencilSurface, D3D8CB_DestroySwapChain);
|
||||
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D8CB_DestroySwapChain);
|
||||
IWineD3DDevice_Release(This->WineD3DDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This->handle_table.entries);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
@ -654,255 +654,193 @@ static void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3
|
|||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage,
|
||||
D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8 **ppTexture) {
|
||||
IDirect3DTexture8Impl *object;
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(IDirect3DDevice8 *iface,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format,
|
||||
D3DPOOL pool, IDirect3DTexture8 **texture)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DTexture8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : W(%d) H(%d), Lvl(%d) d(%d), Fmt(%u), Pool(%d)\n", This, Width, Height, Levels, Usage, Format, Pool);
|
||||
TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
|
||||
iface, width, height, levels, usage, format, pool, texture);
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture8Impl));
|
||||
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
/* *ppTexture = NULL; */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DTexture8_Vtbl;
|
||||
object->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK,
|
||||
wined3dformat_from_d3dformat(Format), Pool, &object->wineD3DTexture, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (FAILED(hrc)) {
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
|
||||
hr = texture_init(object, This, width, height, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
/* *ppTexture = NULL; */
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppTexture = (LPDIRECT3DTEXTURE8) object;
|
||||
TRACE("(%p) Created Texture %p, %p\n",This,object,object->wineD3DTexture);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
return hrc;
|
||||
TRACE("Created texture %p.\n", object);
|
||||
*texture = (IDirect3DTexture8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(IDirect3DDevice8 *iface,
|
||||
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format,
|
||||
D3DPOOL Pool, IDirect3DVolumeTexture8 **ppVolumeTexture)
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format,
|
||||
D3DPOOL pool, IDirect3DVolumeTexture8 **texture)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *object;
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DVolumeTexture8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
TRACE("iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
|
||||
iface, width, height, depth, levels, usage, format, pool, texture);
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolumeTexture8Impl));
|
||||
if (NULL == object) {
|
||||
FIXME("(%p) allocation of memory failed\n", This);
|
||||
*ppVolumeTexture = NULL;
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate volume texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DVolumeTexture8_Vtbl;
|
||||
object->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels,
|
||||
Usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(Format),
|
||||
Pool, &object->wineD3DVolumeTexture, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n", This);
|
||||
hr = volumetexture_init(object, This, width, height, depth, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volume texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppVolumeTexture = NULL;
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppVolumeTexture = (LPDIRECT3DVOLUMETEXTURE8) object;
|
||||
return hr;
|
||||
}
|
||||
TRACE("(%p) returning %p\n", This , *ppVolumeTexture);
|
||||
return hrc;
|
||||
|
||||
TRACE("Created volume texture %p.\n", object);
|
||||
*texture = (IDirect3DVolumeTexture8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(IDirect3DDevice8 *iface, UINT EdgeLength,
|
||||
UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8 **ppCubeTexture)
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(IDirect3DDevice8 *iface, UINT edge_length,
|
||||
UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture8 **texture)
|
||||
{
|
||||
IDirect3DCubeTexture8Impl *object;
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hr = D3D_OK;
|
||||
IDirect3DCubeTexture8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : ELen(%d) Lvl(%d) Usage(%d) fmt(%u), Pool(%d)\n" , This, EdgeLength, Levels, Usage, Format, Pool);
|
||||
TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
|
||||
iface, edge_length, levels, usage, format, pool, texture);
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
|
||||
if (NULL == object) {
|
||||
FIXME("(%p) allocation of CubeTexture failed\n", This);
|
||||
*ppCubeTexture = NULL;
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate cube texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DCubeTexture8_Vtbl;
|
||||
object->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage & WINED3DUSAGE_MASK,
|
||||
wined3dformat_from_d3dformat(Format), Pool, &object->wineD3DCubeTexture, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hr != D3D_OK){
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This);
|
||||
hr = cubetexture_init(object, This, edge_length, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize cube texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppCubeTexture = NULL;
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppCubeTexture = (LPDIRECT3DCUBETEXTURE8) object;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) returning %p\n",This, *ppCubeTexture);
|
||||
TRACE("Created cube texture %p.\n", object);
|
||||
*texture = (IDirect3DCubeTexture8 *)object;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Size, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer) {
|
||||
IDirect3DVertexBuffer8Impl *object;
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(IDirect3DDevice8 *iface, UINT size, DWORD usage,
|
||||
DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer8 **buffer)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DVertexBuffer8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVertexBuffer8Impl));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
*ppVertexBuffer = NULL;
|
||||
TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p.\n",
|
||||
iface, size, usage, fvf, pool, buffer);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate buffer memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DVertexBuffer8_Vtbl;
|
||||
object->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK,
|
||||
0 /* fvf for ddraw only */, (WINED3DPOOL)Pool, &object->wineD3DVertexBuffer, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
object->fvf = FVF;
|
||||
|
||||
if (D3D_OK != hrc) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateVertexBuffer failed\n", This);
|
||||
hr = vertexbuffer_init(object, This, size, usage, fvf, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppVertexBuffer = NULL;
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppVertexBuffer = (LPDIRECT3DVERTEXBUFFER8) object;
|
||||
return hr;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
TRACE("Created vertex buffer %p.\n", object);
|
||||
*buffer = (IDirect3DVertexBuffer8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer) {
|
||||
IDirect3DIndexBuffer8Impl *object;
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(IDirect3DDevice8 *iface, UINT size, DWORD usage,
|
||||
D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer8 **buffer)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DIndexBuffer8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p.\n",
|
||||
iface, size, usage, format, pool, buffer);
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
*ppIndexBuffer = NULL;
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate buffer memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DIndexBuffer8_Vtbl;
|
||||
object->ref = 1;
|
||||
object->format = wined3dformat_from_d3dformat(Format);
|
||||
TRACE("Calling wined3d create index buffer\n");
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)Pool, &object->wineD3DIndexBuffer, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (D3D_OK != hrc) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateIndexBuffer failed\n", This);
|
||||
hr = indexbuffer_init(object, This, size, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize index buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppIndexBuffer = NULL;
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppIndexBuffer = (LPDIRECT3DINDEXBUFFER8)object;
|
||||
return hr;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
TRACE("Created index buffer %p.\n", object);
|
||||
*buffer = (IDirect3DIndexBuffer8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height,
|
||||
D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface8 **ppSurface,
|
||||
UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
|
||||
{
|
||||
HRESULT hrc;
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
IDirect3DSurface8Impl *object;
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
if(MultisampleQuality > 0){
|
||||
FIXME("MultisampleQuality set to %d, substituting 0\n" , MultisampleQuality);
|
||||
/*
|
||||
MultisampleQuality
|
||||
[in] Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by IDirect3D8::CheckDeviceMultiSampleType. Passing a larger value returns the error D3DERR_INVALIDCALL. The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.
|
||||
*/
|
||||
MultisampleQuality=0;
|
||||
}
|
||||
/*FIXME: Check MAX bounds of MultisampleQuality*/
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface8Impl));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
*ppSurface = NULL;
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DSurface8_Vtbl;
|
||||
object->ref = 1;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format),
|
||||
Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool,
|
||||
MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateSurface failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppSurface = NULL;
|
||||
} else {
|
||||
IUnknown_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppSurface = (LPDIRECT3DSURFACE8) object;
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface8Impl));
|
||||
if (!object)
|
||||
{
|
||||
FIXME("Failed to allocate surface memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
hr = surface_init(object, This, Width, Height, Format, Lockable, Discard,
|
||||
Level, Usage, Pool, MultiSample, MultisampleQuality);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created surface %p.\n", object);
|
||||
*ppSurface = (IDirect3DSurface8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface) {
|
||||
|
@ -1533,8 +1471,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface
|
|||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage,IDirect3DBaseTexture8** ppTexture) {
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
IWineD3DBaseTexture *retTexture = NULL;
|
||||
HRESULT rc = D3D_OK;
|
||||
IWineD3DBaseTexture *retTexture;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n" , This);
|
||||
|
||||
|
@ -1543,17 +1481,27 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, D
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
rc = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
||||
if (rc == D3D_OK && NULL != retTexture) {
|
||||
hr = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to get texture for stage %u, hr %#x.\n", Stage, hr);
|
||||
wined3d_mutex_unlock();
|
||||
*ppTexture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (retTexture)
|
||||
{
|
||||
IWineD3DBaseTexture_GetParent(retTexture, (IUnknown **)ppTexture);
|
||||
IWineD3DBaseTexture_Release(retTexture);
|
||||
} else {
|
||||
FIXME("Call to get texture (%d) failed (%p)\n", Stage, retTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ppTexture = NULL;
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return rc;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture) {
|
||||
|
@ -1725,8 +1673,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE
|
|||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, MinVertexIndex, NumVertices,
|
||||
startIndex, vertex_count_from_primitive_count(PrimitiveType, primCount));
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, startIndex,
|
||||
vertex_count_from_primitive_count(PrimitiveType, primCount));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -1757,7 +1705,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVI
|
|||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice, MinVertexIndex, NumVertexIndices,
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice,
|
||||
vertex_count_from_primitive_count(PrimitiveType, PrimitiveCount), pIndexData,
|
||||
wined3dformat_from_d3dformat(IndexDataFormat), pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -1778,141 +1726,55 @@ static HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 ifa
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT IDirect3DDevice8Impl_CreateVertexDeclaration(IDirect3DDevice8 *iface, CONST DWORD *declaration, IDirect3DVertexDeclaration8 **decl_ptr) {
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(IDirect3DDevice8 *iface,
|
||||
const DWORD *declaration, const DWORD *byte_code, DWORD *shader, DWORD usage)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
IDirect3DVertexDeclaration8Impl *object;
|
||||
WINED3DVERTEXELEMENT *wined3d_elements;
|
||||
UINT wined3d_element_count;
|
||||
HRESULT hr = D3D_OK;
|
||||
|
||||
TRACE("(%p) : declaration %p\n", This, declaration);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object) {
|
||||
ERR("Memory allocation failed\n");
|
||||
*decl_ptr = NULL;
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->ref_count = 1;
|
||||
object->lpVtbl = &Direct3DVertexDeclaration8_Vtbl;
|
||||
|
||||
wined3d_element_count = convert_to_wined3d_declaration(declaration, &object->elements_size, &wined3d_elements);
|
||||
object->elements = HeapAlloc(GetProcessHeap(), 0, object->elements_size);
|
||||
if (!object->elements) {
|
||||
ERR("Memory allocation failed\n");
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*decl_ptr = NULL;
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
CopyMemory(object->elements, declaration, object->elements_size);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(This->WineD3DDevice, &object->wined3d_vertex_declaration,
|
||||
(IUnknown *)object, wined3d_elements, wined3d_element_count);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
ERR("(%p) : IWineD3DDevice_CreateVertexDeclaration call failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object->elements);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
*decl_ptr = (IDirect3DVertexDeclaration8 *)object;
|
||||
TRACE("(%p) : Created vertex declaration %p\n", This, object);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration, CONST DWORD* pFunction, DWORD* ppShader, DWORD Usage) {
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DVertexShader8Impl *object;
|
||||
const DWORD *token = pDeclaration;
|
||||
DWORD shader_handle;
|
||||
DWORD handle;
|
||||
HRESULT hr;
|
||||
|
||||
/* Test if the vertex declaration is valid */
|
||||
while (D3DVSD_END() != *token) {
|
||||
D3DVSD_TOKENTYPE token_type = ((*token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT);
|
||||
TRACE("iface %p, declaration %p, byte_code %p, shader %p, usage %#x.\n",
|
||||
iface, declaration, byte_code, shader, usage);
|
||||
|
||||
if (token_type == D3DVSD_TOKEN_STREAMDATA && !(token_type & 0x10000000)) {
|
||||
DWORD type = ((*token & D3DVSD_DATATYPEMASK) >> D3DVSD_DATATYPESHIFT);
|
||||
DWORD reg = ((*token & D3DVSD_VERTEXREGMASK) >> D3DVSD_VERTEXREGSHIFT);
|
||||
|
||||
if(reg == D3DVSDE_NORMAL && type != D3DVSDT_FLOAT3 && !pFunction) {
|
||||
WARN("Attempt to use a non-FLOAT3 normal with the fixed function function\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
token += parse_token(token);
|
||||
}
|
||||
|
||||
/* Setup a stub object for now */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
TRACE("(%p) : pFunction(%p), ppShader(%p)\n", This, pFunction, ppShader);
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
*ppShader = 0;
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->ref = 1;
|
||||
object->lpVtbl = &Direct3DVertexShader8_Vtbl;
|
||||
|
||||
hrc = IDirect3DDevice8Impl_CreateVertexDeclaration(iface, pDeclaration, &object->vertex_declaration);
|
||||
if (FAILED(hrc)) {
|
||||
ERR("(%p) : IDirect3DDeviceImpl_CreateVertexDeclaration call failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppShader = 0;
|
||||
return D3DERR_INVALIDCALL;
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex shader memory.\n");
|
||||
*shader = 0;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
handle = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_VS);
|
||||
wined3d_mutex_unlock();
|
||||
if (handle == D3D8_INVALID_HANDLE)
|
||||
{
|
||||
ERR("Failed to allocate shader handle\n");
|
||||
wined3d_mutex_unlock();
|
||||
IDirect3DVertexDeclaration8_Release(object->vertex_declaration);
|
||||
ERR("Failed to allocate vertex shader handle.\n");
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppShader = 0;
|
||||
*shader = 0;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
else
|
||||
|
||||
shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
|
||||
|
||||
hr = vertexshader_init(object, This, declaration, byte_code, shader_handle, usage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DWORD shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
|
||||
*ppShader = ((IDirect3DVertexDeclaration8Impl *)object->vertex_declaration)->shader_handle = shader_handle;
|
||||
WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
|
||||
wined3d_mutex_lock();
|
||||
d3d8_free_handle(&This->handle_table, handle, D3D8_HANDLE_VS);
|
||||
wined3d_mutex_unlock();
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*shader = 0;
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (pFunction)
|
||||
{
|
||||
/* Usage is missing ... Use SetRenderState to set the sw vp render state in SetVertexShader */
|
||||
hrc = IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, pFunction,
|
||||
NULL /* output signature */, &object->wineD3DVertexShader, (IUnknown *)object);
|
||||
TRACE("Created vertex shader %p (handle %#x).\n", object, shader_handle);
|
||||
*shader = shader_handle;
|
||||
|
||||
if (FAILED(hrc))
|
||||
{
|
||||
/* free up object */
|
||||
FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n");
|
||||
d3d8_free_handle(&This->handle_table, handle, D3D8_HANDLE_VS);
|
||||
IDirect3DVertexDeclaration8_Release(object->vertex_declaration);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppShader = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
load_local_constants(pDeclaration, object->wineD3DVertexShader);
|
||||
TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader);
|
||||
}
|
||||
}
|
||||
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hrc;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static IDirect3DVertexDeclaration8Impl *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8Impl *This, DWORD fvf)
|
||||
|
@ -1947,17 +1809,10 @@ static IDirect3DVertexDeclaration8Impl *IDirect3DDevice8Impl_FindDecl(IDirect3DD
|
|||
return NULL;
|
||||
}
|
||||
|
||||
d3d8_declaration->ref_count = 1;
|
||||
d3d8_declaration->lpVtbl = &Direct3DVertexDeclaration8_Vtbl;
|
||||
d3d8_declaration->elements = NULL;
|
||||
d3d8_declaration->elements_size = 0;
|
||||
d3d8_declaration->shader_handle = fvf;
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->WineD3DDevice,
|
||||
&d3d8_declaration->wined3d_vertex_declaration, (IUnknown *)d3d8_declaration, fvf);
|
||||
hr = vertexdeclaration_init_fvf(d3d8_declaration, This, fvf);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to create wined3d vertex declaration.\n");
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, d3d8_declaration);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2215,7 +2070,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, I
|
|||
*/
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, baseVertexIndex);
|
||||
hr = IWineD3DDevice_SetIndices(This->WineD3DDevice,
|
||||
hr = IWineD3DDevice_SetIndexBuffer(This->WineD3DDevice,
|
||||
ib ? ib->wineD3DIndexBuffer : NULL,
|
||||
ib ? ib->format : WINED3DFMT_UNKNOWN);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -2237,7 +2092,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I
|
|||
/* The case from UINT to INT is safe because d3d8 will never set negative values */
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, (INT *) pBaseVertexIndex);
|
||||
rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData);
|
||||
rc = IWineD3DDevice_GetIndexBuffer(This->WineD3DDevice, &retIndexData);
|
||||
if (SUCCEEDED(rc) && retIndexData) {
|
||||
IWineD3DBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
|
||||
IWineD3DBuffer_Release(retIndexData);
|
||||
|
@ -2249,15 +2104,20 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I
|
|||
|
||||
return rc;
|
||||
}
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction, DWORD* ppShader) {
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *iface,
|
||||
const DWORD *byte_code, DWORD *shader)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
|
||||
IDirect3DPixelShader8Impl *object;
|
||||
DWORD shader_handle;
|
||||
DWORD handle;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : pFunction(%p), ppShader(%p)\n", This, pFunction, ppShader);
|
||||
TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
|
||||
|
||||
if (NULL == ppShader) {
|
||||
if (!shader)
|
||||
{
|
||||
TRACE("(%p) Invalid call\n", This);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
@ -2265,39 +2125,38 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i
|
|||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate memmory.\n");
|
||||
ERR("Failed to allocate pixel shader memmory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->ref = 1;
|
||||
object->lpVtbl = &Direct3DPixelShader8_Vtbl;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreatePixelShader(This->WineD3DDevice, pFunction,
|
||||
NULL, &object->wineD3DPixelShader, (IUnknown *)object);
|
||||
handle = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_PS);
|
||||
wined3d_mutex_unlock();
|
||||
if (handle == D3D8_INVALID_HANDLE)
|
||||
{
|
||||
ERR("Failed to allocate pixel shader handle.\n");
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
|
||||
|
||||
hr = pixelshader_init(object, This, byte_code, shader_handle);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
|
||||
wined3d_mutex_lock();
|
||||
d3d8_free_handle(&This->handle_table, handle, D3D8_HANDLE_PS);
|
||||
wined3d_mutex_unlock();
|
||||
FIXME("(%p) call to IWineD3DDevice_CreatePixelShader failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0 , object);
|
||||
*ppShader = 0;
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*shader = 0;
|
||||
return hr;
|
||||
}
|
||||
|
||||
handle = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_PS);
|
||||
wined3d_mutex_unlock();
|
||||
TRACE("Created pixel shader %p (handle %#x).\n", object, shader_handle);
|
||||
*shader = shader_handle;
|
||||
|
||||
if (handle == D3D8_INVALID_HANDLE)
|
||||
{
|
||||
ERR("Failed to allocate shader handle\n");
|
||||
IDirect3DVertexShader8_Release((IUnknown *)object);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
*ppShader = object->handle = handle + VS_HIGHESTFIXEDFXF + 1;
|
||||
TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader);
|
||||
|
||||
return hr;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD pShader) {
|
||||
|
@ -2621,17 +2480,6 @@ const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl =
|
|||
IDirect3DDevice8Impl_DeletePatch
|
||||
};
|
||||
|
||||
ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface8Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
/* GetParent's AddRef was forwarded to an object in destruction.
|
||||
* Releasing it here again would cause an endless recursion. */
|
||||
surfaceParent->forwardReference = NULL;
|
||||
return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
|
||||
}
|
||||
|
||||
/* IWineD3DDeviceParent IUnknown methods */
|
||||
|
||||
static inline struct IDirect3DDevice8Impl *device_from_device_parent(IWineD3DDeviceParent *iface)
|
||||
|
@ -2691,9 +2539,13 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
d3d_surface->container = superior;
|
||||
IUnknown_Release(d3d_surface->parentDevice);
|
||||
d3d_surface->parentDevice = NULL;
|
||||
|
||||
IDirect3DSurface8_Release((IDirect3DSurface8 *)d3d_surface);
|
||||
d3d_surface->forwardReference = superior;
|
||||
|
||||
return hr;
|
||||
|
@ -2720,8 +2572,9 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
d3d_surface->container = (IUnknown *)This;
|
||||
d3d_surface->isImplicit = TRUE;
|
||||
/* Implicit surfaces are created with an refcount of 0 */
|
||||
IUnknown_Release((IUnknown *)d3d_surface);
|
||||
|
||||
|
@ -2749,8 +2602,9 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
d3d_surface->container = (IUnknown *)This;
|
||||
d3d_surface->isImplicit = TRUE;
|
||||
/* Implicit surfaces are created with an refcount of 0 */
|
||||
IUnknown_Release((IUnknown *)d3d_surface);
|
||||
|
||||
|
@ -2777,23 +2631,22 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
|
|||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DVolume8_Vtbl;
|
||||
object->ref = 1;
|
||||
hr = IWineD3DDevice_CreateVolume(This->WineD3DDevice, width, height, depth, usage,
|
||||
format, pool, &object->wineD3DVolume, (IUnknown *)object);
|
||||
hr = volume_init(object, This, width, height, depth, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("(%p) CreateVolume failed, returning %#x\n", iface, hr);
|
||||
WARN("Failed to initialize volume, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*volume = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
*volume = object->wineD3DVolume;
|
||||
IWineD3DVolume_AddRef(*volume);
|
||||
IDirect3DVolume8_Release((IDirect3DVolume8 *)object);
|
||||
|
||||
object->container = superior;
|
||||
object->forwardReference = superior;
|
||||
|
||||
TRACE("(%p) Created volume %p\n", iface, *volume);
|
||||
TRACE("(%p) Created volume %p\n", iface, object);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -312,16 +312,6 @@ static HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT
|
|||
return ret;
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D8CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface8Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
surfaceParent->isImplicit = FALSE;
|
||||
/* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
|
||||
return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
|
||||
IUnknown* swapChainParent;
|
||||
TRACE("(%p) call back\n", pSwapChain);
|
||||
|
@ -331,16 +321,6 @@ ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
|
|||
return IUnknown_Release(swapChainParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D8CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface8Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
surfaceParent->isImplicit = FALSE;
|
||||
/* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
|
||||
return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
|
||||
DWORD BehaviourFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
|
||||
IDirect3DDevice8** ppReturnedDeviceInterface) {
|
||||
|
|
|
@ -46,6 +46,14 @@ static ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_AddRef(This->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -56,12 +64,10 @@ static ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 ifa
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice8_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_Release(This->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IUnknown_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -207,8 +213,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 i
|
|||
return hr;
|
||||
}
|
||||
|
||||
|
||||
const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl =
|
||||
static const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DIndexBuffer8Impl_QueryInterface,
|
||||
|
@ -228,3 +233,39 @@ const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl =
|
|||
IDirect3DIndexBuffer8Impl_Unlock,
|
||||
IDirect3DIndexBuffer8Impl_GetDesc
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_indexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_indexbuffer_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_indexbuffer_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
||||
UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
buffer->lpVtbl = &Direct3DIndexBuffer8_Vtbl;
|
||||
buffer->ref = 1;
|
||||
buffer->format = wined3dformat_from_d3dformat(format);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size,
|
||||
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DIndexBuffer,
|
||||
(IUnknown *)buffer, &d3d8_indexbuffer_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
buffer->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IUnknown_AddRef(buffer->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,13 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_AddRef(IDirect3DPixelShader8 *ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DPixelShader_AddRef(This->wineD3DPixelShader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -59,16 +66,47 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_Release(IDirect3DPixelShader8 * if
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DPixelShader_Release(This->wineD3DPixelShader);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl =
|
||||
static const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DPixelShader8Impl_QueryInterface,
|
||||
IDirect3DPixelShader8Impl_AddRef,
|
||||
IDirect3DPixelShader8Impl_Release,
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_pixelshader_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_pixelshader_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_pixelshader_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device,
|
||||
const DWORD *byte_code, DWORD shader_handle)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
shader->ref = 1;
|
||||
shader->lpVtbl = &Direct3DPixelShader8_Vtbl;
|
||||
shader->handle = shader_handle;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code,
|
||||
NULL, &shader->wineD3DPixelShader, (IUnknown *)shader,
|
||||
&d3d8_pixelshader_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d pixel shader, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,13 @@ static ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface) {
|
|||
} else {
|
||||
/* No container, handle our own refcounting */
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
if(ref == 1 && This->parentDevice) IUnknown_AddRef(This->parentDevice);
|
||||
if (ref == 1)
|
||||
{
|
||||
if (This->parentDevice) IUnknown_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IUnknown_AddRef(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
return ref;
|
||||
}
|
||||
|
@ -75,13 +81,9 @@ static ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface) {
|
|||
if (ref == 0) {
|
||||
if (This->parentDevice) IUnknown_Release(This->parentDevice);
|
||||
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
|
||||
if (!This->isImplicit) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSurface_Release(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSurface_Release(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -229,7 +231,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface)
|
|||
}
|
||||
}
|
||||
|
||||
const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl =
|
||||
static const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DSurface8Impl_QueryInterface,
|
||||
|
@ -246,3 +248,47 @@ const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl =
|
|||
IDirect3DSurface8Impl_LockRect,
|
||||
IDirect3DSurface8Impl_UnlockRect
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
|
||||
{
|
||||
surface_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
||||
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
surface->lpVtbl = &Direct3DSurface8_Vtbl;
|
||||
surface->ref = 1;
|
||||
|
||||
/* FIXME: Check MAX bounds of MultisampleQuality. */
|
||||
if (multisample_quality > 0)
|
||||
{
|
||||
FIXME("Multisample quality set to %u, substituting 0.\n", multisample_quality);
|
||||
multisample_quality = 0;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
|
||||
multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
|
||||
&d3d8_surface_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d surface, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
surface->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IUnknown_AddRef(surface->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ static ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface)
|
|||
|
||||
if (ref == 0) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSwapChain_Destroy(This->wineD3DSwapChain, D3D8CB_DestroyRenderTarget);
|
||||
IWineD3DSwapChain_Destroy(This->wineD3DSwapChain);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (This->parentDevice) IUnknown_Release(This->parentDevice);
|
||||
|
|
|
@ -47,6 +47,14 @@ static ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface) {
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DTexture_AddRef(This->wineD3DTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -57,12 +65,10 @@ static ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface) {
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice8_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DTexture_Destroy(This->wineD3DTexture, D3D8CB_DestroySurface);
|
||||
IWineD3DTexture_Release(This->wineD3DTexture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IUnknown_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -285,7 +291,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 ifac
|
|||
return hr;
|
||||
}
|
||||
|
||||
const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl =
|
||||
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DTexture8Impl_QueryInterface,
|
||||
|
@ -311,3 +317,38 @@ const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl =
|
|||
IDirect3DTexture8Impl_UnlockRect,
|
||||
IDirect3DTexture8Impl_AddDirtyRect
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_texture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
texture->lpVtbl = &Direct3DTexture8_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
&texture->wineD3DTexture, (IUnknown *)texture, &d3d8_texture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
texture->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IDirect3DDevice8_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,14 @@ static ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 if
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_AddRef(This->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -57,12 +65,10 @@ static ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 i
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice8_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_Release(This->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IUnknown_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -210,7 +216,7 @@ static HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8
|
|||
return hr;
|
||||
}
|
||||
|
||||
const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
|
||||
static const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DVertexBuffer8Impl_QueryInterface,
|
||||
|
@ -230,3 +236,39 @@ const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
|
|||
IDirect3DVertexBuffer8Impl_Unlock,
|
||||
IDirect3DVertexBuffer8Impl_GetDesc
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_vertexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_vertexbuffer_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_vertexbuffer_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
||||
UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
buffer->lpVtbl = &Direct3DVertexBuffer8_Vtbl;
|
||||
buffer->ref = 1;
|
||||
buffer->fvf = fvf;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
|
||||
usage & WINED3DUSAGE_MASK, 0, (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
|
||||
(IUnknown *)buffer, &d3d8_vertexbuffer_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
buffer->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IUnknown_AddRef(buffer->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,13 @@ static ULONG WINAPI IDirect3DVertexDeclaration8Impl_AddRef(IDirect3DVertexDeclar
|
|||
ULONG ref_count = InterlockedIncrement(&This->ref_count);
|
||||
TRACE("(%p) : AddRef increasing to %d\n", This, ref_count);
|
||||
|
||||
if (ref_count == 1)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexDeclaration_AddRef(This->wined3d_vertex_declaration);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
|
@ -64,9 +71,6 @@ static ULONG WINAPI IDirect3DVertexDeclaration8Impl_Release(IDirect3DVertexDecla
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DVertexDeclaration_Release(This->wined3d_vertex_declaration);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->elements);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return ref_count;
|
||||
|
@ -256,7 +260,7 @@ static const WINED3DFORMAT wined3d_format_lookup[] =
|
|||
/*WINED3DDECLTYPE_FLOAT2*/ WINED3DFMT_R32G32_FLOAT,
|
||||
/*WINED3DDECLTYPE_FLOAT3*/ WINED3DFMT_R32G32B32_FLOAT,
|
||||
/*WINED3DDECLTYPE_FLOAT4*/ WINED3DFMT_R32G32B32A32_FLOAT,
|
||||
/*WINED3DDECLTYPE_D3DCOLOR*/ WINED3DFMT_A8R8G8B8,
|
||||
/*WINED3DDECLTYPE_D3DCOLOR*/ WINED3DFMT_B8G8R8A8_UNORM,
|
||||
/*WINED3DDECLTYPE_UBYTE4*/ WINED3DFMT_R8G8B8A8_UINT,
|
||||
/*WINED3DDECLTYPE_SHORT2*/ WINED3DFMT_R16G16_SINT,
|
||||
/*WINED3DDECLTYPE_SHORT4*/ WINED3DFMT_R16G16B16A16_SINT,
|
||||
|
@ -352,9 +356,82 @@ UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elem
|
|||
return element_count;
|
||||
}
|
||||
|
||||
const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl =
|
||||
static const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl =
|
||||
{
|
||||
IDirect3DVertexDeclaration8Impl_QueryInterface,
|
||||
IDirect3DVertexDeclaration8Impl_AddRef,
|
||||
IDirect3DVertexDeclaration8Impl_Release
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_vertexdeclaration_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DVertexDeclaration8Impl *declaration = parent;
|
||||
HeapFree(GetProcessHeap(), 0, declaration->elements);
|
||||
HeapFree(GetProcessHeap(), 0, declaration);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_vertexdeclaration_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_vertexdeclaration_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration8Impl *declaration,
|
||||
IDirect3DDevice8Impl *device, const DWORD *elements, DWORD shader_handle)
|
||||
{
|
||||
WINED3DVERTEXELEMENT *wined3d_elements;
|
||||
UINT wined3d_element_count;
|
||||
HRESULT hr;
|
||||
|
||||
declaration->lpVtbl = &Direct3DVertexDeclaration8_Vtbl;
|
||||
declaration->ref_count = 1;
|
||||
declaration->shader_handle = shader_handle;
|
||||
|
||||
wined3d_element_count = convert_to_wined3d_declaration(elements, &declaration->elements_size, &wined3d_elements);
|
||||
declaration->elements = HeapAlloc(GetProcessHeap(), 0, declaration->elements_size);
|
||||
if (!declaration->elements)
|
||||
{
|
||||
ERR("Failed to allocate vertex declaration elements memory.\n");
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
memcpy(declaration->elements, elements, declaration->elements_size);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, &declaration->wined3d_vertex_declaration,
|
||||
(IUnknown *)declaration, &d3d8_vertexdeclaration_wined3d_parent_ops,
|
||||
wined3d_elements, wined3d_element_count);
|
||||
wined3d_mutex_unlock();
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, declaration->elements);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT vertexdeclaration_init_fvf(IDirect3DVertexDeclaration8Impl *declaration,
|
||||
IDirect3DDevice8Impl *device, DWORD fvf)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
declaration->ref_count = 1;
|
||||
declaration->lpVtbl = &Direct3DVertexDeclaration8_Vtbl;
|
||||
declaration->elements = NULL;
|
||||
declaration->elements_size = 0;
|
||||
declaration->shader_handle = fvf;
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(device->WineD3DDevice,
|
||||
&declaration->wined3d_vertex_declaration, (IUnknown *)declaration,
|
||||
&d3d8_vertexdeclaration_wined3d_parent_ops, fvf);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -46,9 +46,23 @@ static ULONG WINAPI IDirect3DVertexShader8Impl_AddRef(IDirect3DVertexShader8 *if
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1 && This->wineD3DVertexShader)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexShader_AddRef(This->wineD3DVertexShader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d8_vertexshader_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DVertexShader8Impl *shader = parent;
|
||||
IDirect3DVertexDeclaration8_Release(shader->vertex_declaration);
|
||||
HeapFree(GetProcessHeap(), 0, shader);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirect3DVertexShader8Impl_Release(IDirect3DVertexShader8 *iface) {
|
||||
IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
@ -56,22 +70,116 @@ static ULONG WINAPI IDirect3DVertexShader8Impl_Release(IDirect3DVertexShader8 *i
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DVertexDeclaration8_Release(This->vertex_declaration);
|
||||
if (This->wineD3DVertexShader)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexShader_Release(This->wineD3DVertexShader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
else
|
||||
{
|
||||
d3d8_vertexshader_wined3d_object_destroyed(This);
|
||||
}
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl =
|
||||
static const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DVertexShader8Impl_QueryInterface,
|
||||
IDirect3DVertexShader8Impl_AddRef,
|
||||
IDirect3DVertexShader8Impl_Release,
|
||||
};
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_vertexshader_wined3d_parent_ops =
|
||||
{
|
||||
d3d8_vertexshader_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
static HRESULT vertexshader_create_vertexdeclaration(IDirect3DDevice8Impl *device,
|
||||
const DWORD *declaration, DWORD shader_handle, IDirect3DVertexDeclaration8 **decl_ptr)
|
||||
{
|
||||
IDirect3DVertexDeclaration8Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, declaration %p, shader_handle %#x, decl_ptr %p.\n",
|
||||
device, declaration, shader_handle, decl_ptr);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object) {
|
||||
ERR("Memory allocation failed\n");
|
||||
*decl_ptr = NULL;
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexdeclaration_init(object, device, declaration, shader_handle);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex declaration %p.\n", object);
|
||||
*decl_ptr = (IDirect3DVertexDeclaration8 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Impl *device,
|
||||
const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage)
|
||||
{
|
||||
const DWORD *token = declaration;
|
||||
HRESULT hr;
|
||||
|
||||
/* Test if the vertex declaration is valid */
|
||||
while (D3DVSD_END() != *token)
|
||||
{
|
||||
D3DVSD_TOKENTYPE token_type = ((*token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT);
|
||||
|
||||
if (token_type == D3DVSD_TOKEN_STREAMDATA && !(token_type & 0x10000000))
|
||||
{
|
||||
DWORD type = ((*token & D3DVSD_DATATYPEMASK) >> D3DVSD_DATATYPESHIFT);
|
||||
DWORD reg = ((*token & D3DVSD_VERTEXREGMASK) >> D3DVSD_VERTEXREGSHIFT);
|
||||
|
||||
if (reg == D3DVSDE_NORMAL && type != D3DVSDT_FLOAT3 && !byte_code)
|
||||
{
|
||||
WARN("Attempt to use a non-FLOAT3 normal with the fixed function function\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
token += parse_token(token);
|
||||
}
|
||||
|
||||
shader->ref = 1;
|
||||
shader->lpVtbl = &Direct3DVertexShader8_Vtbl;
|
||||
|
||||
hr = vertexshader_create_vertexdeclaration(device, declaration, shader_handle, &shader->vertex_declaration);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create vertex declaration, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (byte_code)
|
||||
{
|
||||
if (usage) FIXME("Usage %#x not implemented.\n", usage);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code,
|
||||
NULL /* output signature */, &shader->wineD3DVertexShader,
|
||||
(IUnknown *)shader, &d3d8_vertexshader_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d vertex shader, hr %#x.\n", hr);
|
||||
IDirect3DVertexDeclaration8_Release(shader->vertex_declaration);
|
||||
return hr;
|
||||
}
|
||||
|
||||
load_local_constants(declaration, shader->wineD3DVertexShader);
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -52,6 +52,14 @@ static ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface) {
|
|||
/* No container, handle our own refcounting */
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolume_AddRef(This->wineD3DVolume);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +83,6 @@ static ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface) {
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DVolume_Release(This->wineD3DVolume);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -202,7 +208,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) {
|
|||
return hr;
|
||||
}
|
||||
|
||||
const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl =
|
||||
static const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DVolume8Impl_QueryInterface,
|
||||
|
@ -219,12 +225,31 @@ const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl =
|
|||
IDirect3DVolume8Impl_UnlockBox
|
||||
};
|
||||
|
||||
ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume) {
|
||||
IDirect3DVolume8Impl* volumeParent;
|
||||
|
||||
IWineD3DVolume_GetParent(pVolume, (IUnknown **) &volumeParent);
|
||||
/* GetParent's AddRef was forwarded to an object in destruction.
|
||||
* Releasing it here again would cause an endless recursion. */
|
||||
volumeParent->forwardReference = NULL;
|
||||
return IDirect3DVolume8_Release((IDirect3DVolume8*) volumeParent);
|
||||
static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops =
|
||||
{
|
||||
volume_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height,
|
||||
UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
volume->lpVtbl = &Direct3DVolume8_Vtbl;
|
||||
volume->ref = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage,
|
||||
format, pool, &volume->wineD3DVolume, (IUnknown *)volume, &d3d8_volume_wined3d_parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d volume, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,14 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_AddRef(This->wineD3DVolumeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -57,12 +65,10 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_Destroy(This->wineD3DVolumeTexture, D3D8CB_DestroyVolume);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IUnknown_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_Release(This->wineD3DVolumeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -285,8 +291,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETE
|
|||
return hr;
|
||||
}
|
||||
|
||||
|
||||
const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
|
||||
static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DVolumeTexture8Impl_QueryInterface,
|
||||
|
@ -312,3 +317,38 @@ const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
|
|||
IDirect3DVolumeTexture8Impl_UnlockBox,
|
||||
IDirect3DVolumeTexture8Impl_AddDirtyBox
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE volumetexture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d8_volumetexture_wined3d_parent_ops =
|
||||
{
|
||||
volumetexture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT volumetexture_init(IDirect3DVolumeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
texture->lpVtbl = &Direct3DVolumeTexture8_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
&texture->wineD3DVolumeTexture, (IUnknown *)texture, &d3d8_volumetexture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d volume texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
texture->parentDevice = (IDirect3DDevice8 *)device;
|
||||
IDirect3DDevice8_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -49,6 +49,14 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_AddRef(LPDIRECT3DCUBETEXTURE9 ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_AddRef(This->wineD3DCubeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -61,12 +69,10 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 ifa
|
|||
if (ref == 0) {
|
||||
TRACE("Releasing child %p\n", This->wineD3DCubeTexture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture, D3D9CB_DestroySurface);
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DCubeTexture_Release(This->wineD3DCubeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -352,48 +358,37 @@ static const IDirect3DCubeTexture9Vtbl Direct3DCubeTexture9_Vtbl =
|
|||
IDirect3DCubeTexture9Impl_AddDirtyRect
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE cubetexture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d9_cubetexture_wined3d_parent_ops =
|
||||
{
|
||||
cubetexture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DCubeTexture9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9EX iface,
|
||||
UINT EdgeLength, UINT Levels, DWORD Usage,
|
||||
D3DFORMAT Format, D3DPOOL Pool,
|
||||
IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) {
|
||||
|
||||
IDirect3DCubeTexture9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hr = D3D_OK;
|
||||
|
||||
TRACE("(%p) : ELen(%d) Lvl(%d) Usage(%d) fmt(%u), Pool(%d) Shared(%p)\n", This, EdgeLength, Levels, Usage, Format, Pool, pSharedHandle);
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
|
||||
if (NULL == object) {
|
||||
ERR("(%p) allocation of CubeTexture failed\n", This);
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
object->lpVtbl = &Direct3DCubeTexture9_Vtbl;
|
||||
object->ref = 1;
|
||||
texture->lpVtbl = &Direct3DCubeTexture9_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage,
|
||||
wined3dformat_from_d3dformat(Format), Pool, &object->wineD3DCubeTexture, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage,
|
||||
wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
|
||||
(IUnknown *)texture, &d3d9_cubetexture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hr != D3D_OK){
|
||||
|
||||
/* free up object */
|
||||
WARN("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppCubeTexture = (LPDIRECT3DCUBETEXTURE9) object;
|
||||
TRACE("(%p) : Created cube texture %p\n", This, object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d cube texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) returning %p\n",This, *ppCubeTexture);
|
||||
return hr;
|
||||
texture->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -41,11 +41,9 @@
|
|||
/* ===========================================================================
|
||||
Internal use
|
||||
=========================================================================== */
|
||||
extern HRESULT vdecl_convert_fvf(
|
||||
DWORD FVF,
|
||||
D3DVERTEXELEMENT9** ppVertexElements);
|
||||
D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format);
|
||||
WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format);
|
||||
extern HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements) DECLSPEC_HIDDEN;
|
||||
D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format) DECLSPEC_HIDDEN;
|
||||
WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ===========================================================================
|
||||
Macros
|
||||
|
@ -140,7 +138,7 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format);
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3D9ExVtbl Direct3D9_Vtbl;
|
||||
extern const IDirect3D9ExVtbl Direct3D9_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3D implementation structure
|
||||
|
@ -158,7 +156,7 @@ typedef struct IDirect3D9Impl
|
|||
BOOL extended;
|
||||
} IDirect3D9Impl;
|
||||
|
||||
void filter_caps(D3DCAPS9* pCaps);
|
||||
void filter_caps(D3DCAPS9* pCaps) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ---------------- */
|
||||
/* IDirect3DDevice9 */
|
||||
|
@ -167,8 +165,8 @@ void filter_caps(D3DCAPS9* pCaps);
|
|||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl;
|
||||
extern const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl;
|
||||
extern const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DDevice9 implementation structure
|
||||
|
@ -194,39 +192,54 @@ typedef struct IDirect3DDevice9Impl
|
|||
|
||||
|
||||
/* IDirect3DDevice9: */
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9EX iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
|
||||
extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9EX iface);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9EX iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9EX iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9EX iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateStateBlock(LPDIRECT3DDEVICE9EX iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_BeginStateBlock(LPDIRECT3DDEVICE9EX iface);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(LPDIRECT3DDEVICE9EX iface, IDirect3DStateBlock9** ppSB);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9EX iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9* pDecl);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9** ppDecl);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9* pShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9** ppShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9* pShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9** ppShader);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantI(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantI(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9EX iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface,
|
||||
D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **pSwapChain) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(IDirect3DDevice9Ex *iface,
|
||||
UINT iSwapChain, IDirect3DSwapChain9 **pSwapChain) DECLSPEC_HIDDEN;
|
||||
extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(IDirect3DDevice9Ex *iface) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateStateBlock(IDirect3DDevice9Ex *iface,
|
||||
D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9 **ppSB) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_BeginStateBlock(IDirect3DDevice9Ex *iface) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DStateBlock9 **ppSB) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DVertexDeclaration9 *pDecl) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DVertexDeclaration9 **ppDecl) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DVertexShader9 *pShader) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DVertexShader9 **ppShader) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantF(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DPixelShader9 *pShader) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DPixelShader9 **ppShader) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantF(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantF(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantI(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantI(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, const BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantB(IDirect3DDevice9Ex *iface,
|
||||
UINT StartRegister, BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(IDirect3DDevice9Ex *iface,
|
||||
D3DQUERYTYPE Type, IDirect3DQuery9 **ppQuery) DECLSPEC_HIDDEN;
|
||||
|
||||
|
||||
/* ---------------- */
|
||||
|
@ -236,7 +249,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9EX ifa
|
|||
/*****************************************************************************
|
||||
* IDirect3DVolume9 implementation structure
|
||||
*/
|
||||
extern const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl;
|
||||
typedef struct IDirect3DVolume9Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
|
@ -253,6 +265,9 @@ typedef struct IDirect3DVolume9Impl
|
|||
IUnknown *forwardReference;
|
||||
} IDirect3DVolume9Impl;
|
||||
|
||||
HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, UINT width, UINT height,
|
||||
UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ------------------- */
|
||||
/* IDirect3DSwapChain9 */
|
||||
/* ------------------- */
|
||||
|
@ -280,11 +295,6 @@ typedef struct IDirect3DSwapChain9Impl
|
|||
/* IDirect3DSurface9 */
|
||||
/* ----------------- */
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
extern const IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DSurface9 implementation structure
|
||||
*/
|
||||
|
@ -306,10 +316,13 @@ typedef struct IDirect3DSurface9Impl
|
|||
/* If set forward refcounting to this object */
|
||||
IUnknown *forwardReference;
|
||||
|
||||
/* Flags an implicit surface */
|
||||
BOOL isImplicit;
|
||||
BOOL getdc_supported;
|
||||
} IDirect3DSurface9Impl;
|
||||
|
||||
HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
||||
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ---------------------- */
|
||||
/* IDirect3DVertexBuffer9 */
|
||||
/* ---------------------- */
|
||||
|
@ -332,6 +345,9 @@ typedef struct IDirect3DVertexBuffer9Impl
|
|||
DWORD fvf;
|
||||
} IDirect3DVertexBuffer9Impl;
|
||||
|
||||
HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
||||
UINT size, UINT usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* --------------------- */
|
||||
/* IDirect3DIndexBuffer9 */
|
||||
/* --------------------- */
|
||||
|
@ -353,6 +369,9 @@ typedef struct IDirect3DIndexBuffer9Impl
|
|||
WINED3DFORMAT format;
|
||||
} IDirect3DIndexBuffer9Impl;
|
||||
|
||||
HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
||||
UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* --------------------- */
|
||||
/* IDirect3DBaseTexture9 */
|
||||
/* --------------------- */
|
||||
|
@ -390,6 +409,8 @@ typedef struct IDirect3DCubeTexture9Impl
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DCubeTexture9Impl;
|
||||
|
||||
HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------- */
|
||||
/* IDirect3DTexture9 */
|
||||
|
@ -411,6 +432,9 @@ typedef struct IDirect3DTexture9Impl
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DTexture9Impl;
|
||||
|
||||
HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------------- */
|
||||
/* IDirect3DVolumeTexture9 */
|
||||
/* ----------------------- */
|
||||
|
@ -431,6 +455,9 @@ typedef struct IDirect3DVolumeTexture9Impl
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DVolumeTexture9Impl;
|
||||
|
||||
HRESULT volumetexture_init(IDirect3DVolumeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ----------------------- */
|
||||
/* IDirect3DStateBlock9 */
|
||||
/* ----------------------- */
|
||||
|
@ -474,7 +501,9 @@ typedef struct IDirect3DVertexDeclaration9Impl {
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DVertexDeclaration9Impl;
|
||||
|
||||
void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface);
|
||||
void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface) DECLSPEC_HIDDEN;
|
||||
HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
|
||||
IDirect3DDevice9Impl *device, const D3DVERTEXELEMENT9 *elements) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ---------------------- */
|
||||
/* IDirect3DVertexShader9 */
|
||||
|
@ -495,7 +524,11 @@ typedef struct IDirect3DVertexShader9Impl {
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DVertexShader9Impl;
|
||||
|
||||
HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader,
|
||||
IDirect3DDevice9Impl *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
|
||||
|
||||
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
|
||||
#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
|
||||
|
||||
/* --------------------- */
|
||||
/* IDirect3DPixelShader9 */
|
||||
|
@ -516,6 +549,9 @@ typedef struct IDirect3DPixelShader9Impl {
|
|||
LPDIRECT3DDEVICE9EX parentDevice;
|
||||
} IDirect3DPixelShader9Impl;
|
||||
|
||||
HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader,
|
||||
IDirect3DDevice9Impl *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
|
||||
|
||||
/* --------------- */
|
||||
/* IDirect3DQuery9 */
|
||||
/* --------------- */
|
||||
|
@ -537,10 +573,6 @@ typedef struct IDirect3DQuery9Impl {
|
|||
|
||||
|
||||
/* Callbacks */
|
||||
extern ULONG WINAPI D3D9CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
|
||||
extern ULONG WINAPI D3D9CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D9CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume);
|
||||
extern ULONG WINAPI D3D9CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif /* __WINE_D3D9_PRIVATE_H */
|
||||
|
|
|
@ -35,44 +35,44 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
|
|||
switch(format)
|
||||
{
|
||||
case WINED3DFMT_UNKNOWN: return D3DFMT_UNKNOWN;
|
||||
case WINED3DFMT_R8G8B8: return D3DFMT_R8G8B8;
|
||||
case WINED3DFMT_A8R8G8B8: return D3DFMT_A8R8G8B8;
|
||||
case WINED3DFMT_X8R8G8B8: return D3DFMT_X8R8G8B8;
|
||||
case WINED3DFMT_R5G6B5: return D3DFMT_R5G6B5;
|
||||
case WINED3DFMT_X1R5G5B5: return D3DFMT_X1R5G5B5;
|
||||
case WINED3DFMT_A1R5G5B5: return D3DFMT_A1R5G5B5;
|
||||
case WINED3DFMT_A4R4G4B4: return D3DFMT_A4R4G4B4;
|
||||
case WINED3DFMT_R3G3B2: return D3DFMT_R3G3B2;
|
||||
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_A8R3G3B2: return D3DFMT_A8R3G3B2;
|
||||
case WINED3DFMT_X4R4G4B4: return D3DFMT_X4R4G4B4;
|
||||
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_X8B8G8R8: return D3DFMT_X8B8G8R8;
|
||||
case WINED3DFMT_R8G8B8X8_UNORM: return D3DFMT_X8B8G8R8;
|
||||
case WINED3DFMT_R16G16_UNORM: return D3DFMT_G16R16;
|
||||
case WINED3DFMT_A2R10G10B10: return D3DFMT_A2R10G10B10;
|
||||
case WINED3DFMT_B10G10R10A2_UNORM: return D3DFMT_A2R10G10B10;
|
||||
case WINED3DFMT_R16G16B16A16_UNORM: return D3DFMT_A16B16G16R16;
|
||||
case WINED3DFMT_A8P8: return D3DFMT_A8P8;
|
||||
case WINED3DFMT_P8: return D3DFMT_P8;
|
||||
case WINED3DFMT_L8: return D3DFMT_L8;
|
||||
case WINED3DFMT_A8L8: return D3DFMT_A8L8;
|
||||
case WINED3DFMT_A4L4: return D3DFMT_A4L4;
|
||||
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_L6V5U5: return D3DFMT_L6V5U5;
|
||||
case WINED3DFMT_X8L8V8U8: return D3DFMT_X8L8V8U8;
|
||||
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_A2W10V10U10: return D3DFMT_A2W10V10U10;
|
||||
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: return D3DFMT_A2W10V10U10;
|
||||
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
|
||||
case WINED3DFMT_D32: return D3DFMT_D32;
|
||||
case WINED3DFMT_D15S1: return D3DFMT_D15S1;
|
||||
case WINED3DFMT_D24S8: return D3DFMT_D24S8;
|
||||
case WINED3DFMT_D24X8: return D3DFMT_D24X8;
|
||||
case WINED3DFMT_D24X4S4: return D3DFMT_D24X4S4;
|
||||
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM: 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: return D3DFMT_L16;
|
||||
case WINED3DFMT_D32F_LOCKABLE: return D3DFMT_D32F_LOCKABLE;
|
||||
case WINED3DFMT_D24FS8: return D3DFMT_D24FS8;
|
||||
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;
|
||||
|
@ -83,7 +83,7 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
|
|||
case WINED3DFMT_R32_FLOAT: return D3DFMT_R32F;
|
||||
case WINED3DFMT_R32G32_FLOAT: return D3DFMT_G32R32F;
|
||||
case WINED3DFMT_R32G32B32A32_FLOAT: return D3DFMT_A32B32G32R32F;
|
||||
case WINED3DFMT_CxV8U8: return D3DFMT_CxV8U8;
|
||||
case WINED3DFMT_R8G8_SNORM_Cx: return D3DFMT_CxV8U8;
|
||||
default:
|
||||
FIXME("Unhandled WINED3DFORMAT %#x\n", format);
|
||||
return D3DFMT_UNKNOWN;
|
||||
|
@ -100,44 +100,44 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
|
|||
switch(format)
|
||||
{
|
||||
case D3DFMT_UNKNOWN: return WINED3DFMT_UNKNOWN;
|
||||
case D3DFMT_R8G8B8: return WINED3DFMT_R8G8B8;
|
||||
case D3DFMT_A8R8G8B8: return WINED3DFMT_A8R8G8B8;
|
||||
case D3DFMT_X8R8G8B8: return WINED3DFMT_X8R8G8B8;
|
||||
case D3DFMT_R5G6B5: return WINED3DFMT_R5G6B5;
|
||||
case D3DFMT_X1R5G5B5: return WINED3DFMT_X1R5G5B5;
|
||||
case D3DFMT_A1R5G5B5: return WINED3DFMT_A1R5G5B5;
|
||||
case D3DFMT_A4R4G4B4: return WINED3DFMT_A4R4G4B4;
|
||||
case D3DFMT_R3G3B2: return WINED3DFMT_R3G3B2;
|
||||
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_A8R3G3B2;
|
||||
case D3DFMT_X4R4G4B4: return WINED3DFMT_X4R4G4B4;
|
||||
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_X8B8G8R8;
|
||||
case D3DFMT_X8B8G8R8: return WINED3DFMT_R8G8B8X8_UNORM;
|
||||
case D3DFMT_G16R16: return WINED3DFMT_R16G16_UNORM;
|
||||
case D3DFMT_A2R10G10B10: return WINED3DFMT_A2R10G10B10;
|
||||
case D3DFMT_A2R10G10B10: return WINED3DFMT_B10G10R10A2_UNORM;
|
||||
case D3DFMT_A16B16G16R16: return WINED3DFMT_R16G16B16A16_UNORM;
|
||||
case D3DFMT_A8P8: return WINED3DFMT_A8P8;
|
||||
case D3DFMT_P8: return WINED3DFMT_P8;
|
||||
case D3DFMT_L8: return WINED3DFMT_L8;
|
||||
case D3DFMT_A8L8: return WINED3DFMT_A8L8;
|
||||
case D3DFMT_A4L4: return WINED3DFMT_A4L4;
|
||||
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_L6V5U5;
|
||||
case D3DFMT_X8L8V8U8: return WINED3DFMT_X8L8V8U8;
|
||||
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_A2W10V10U10;
|
||||
case D3DFMT_A2W10V10U10: return WINED3DFMT_R10G10B10_SNORM_A2_UNORM;
|
||||
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
|
||||
case D3DFMT_D32: return WINED3DFMT_D32;
|
||||
case D3DFMT_D15S1: return WINED3DFMT_D15S1;
|
||||
case D3DFMT_D24S8: return WINED3DFMT_D24S8;
|
||||
case D3DFMT_D24X8: return WINED3DFMT_D24X8;
|
||||
case D3DFMT_D24X4S4: return WINED3DFMT_D24X4S4;
|
||||
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
|
||||
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
|
||||
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
|
||||
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;
|
||||
case D3DFMT_D32F_LOCKABLE: return WINED3DFMT_D32F_LOCKABLE;
|
||||
case D3DFMT_D24FS8: return WINED3DFMT_D24FS8;
|
||||
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;
|
||||
|
@ -148,7 +148,7 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
|
|||
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_CxV8U8;
|
||||
case D3DFMT_CxV8U8: return WINED3DFMT_R8G8_SNORM_Cx;
|
||||
default:
|
||||
FIXME("Unhandled D3DFORMAT %#x\n", format);
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
|
@ -257,7 +257,7 @@ static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9EX iface) {
|
|||
}
|
||||
HeapFree(GetProcessHeap(), 0, This->convertedDecls);
|
||||
|
||||
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroyDepthStencilSurface, D3D9CB_DestroySwapChain);
|
||||
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroySwapChain);
|
||||
IWineD3DDevice_Release(This->WineD3DDevice);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
@ -508,7 +508,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3
|
|||
* below fails, the device is considered "lost", and _Reset and _Release are the only allowed calls
|
||||
*/
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetIndices(This->WineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
IWineD3DDevice_SetIndexBuffer(This->WineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
for(i = 0; i < 16; i++) {
|
||||
IWineD3DDevice_SetStreamSource(This->WineD3DDevice, i, NULL, 0, 0);
|
||||
}
|
||||
|
@ -644,53 +644,196 @@ static void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9EX iface,
|
|||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(IDirect3DDevice9Ex *iface,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format,
|
||||
D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DTexture9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
|
||||
iface, width, height, levels, usage, format, pool, texture, shared_handle);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = texture_init(object, This, width, height, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created texture %p.\n", object);
|
||||
*texture = (IDirect3DTexture9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(IDirect3DDevice9Ex *iface,
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format,
|
||||
D3DPOOL pool, IDirect3DVolumeTexture9 **texture, HANDLE *shared_handle)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DVolumeTexture9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, width %u, height %u, depth %u, levels %u\n",
|
||||
iface, width, height, depth, levels);
|
||||
TRACE("usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
|
||||
usage, format, pool, texture, shared_handle);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate volume texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = volumetexture_init(object, This, width, height, depth, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volume texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created volume texture %p.\n", object);
|
||||
*texture = (IDirect3DVolumeTexture9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(IDirect3DDevice9Ex *iface,
|
||||
UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool,
|
||||
IDirect3DCubeTexture9 **texture, HANDLE *shared_handle)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DCubeTexture9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
|
||||
iface, edge_length, levels, usage, format, pool, texture, shared_handle);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate cube texture memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = cubetexture_init(object, This, edge_length, levels, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize cube texture, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created cube texture %p.\n", object);
|
||||
*texture = (IDirect3DCubeTexture9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage,
|
||||
DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer9 **buffer, HANDLE *shared_handle)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DVertexBuffer9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p, shared_handle %p.\n",
|
||||
iface, size, usage, fvf, pool, buffer, shared_handle);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate buffer memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexbuffer_init(object, This, size, usage, fvf, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex buffer %p.\n", object);
|
||||
*buffer = (IDirect3DVertexBuffer9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage,
|
||||
D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **buffer, HANDLE *shared_handle)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DIndexBuffer9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p, shared_handle %p.\n",
|
||||
iface, size, usage, format, pool, buffer, shared_handle);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate buffer memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = indexbuffer_init(object, This, size, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize index buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created index buffer %p.\n", object);
|
||||
*buffer = (IDirect3DIndexBuffer9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
|
||||
D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,
|
||||
UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
|
||||
{
|
||||
HRESULT hrc;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DSurface9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
if (MultisampleQuality > 0)
|
||||
{
|
||||
FIXME("MultisampleQuality set to %d, bstituting 0\n", MultisampleQuality);
|
||||
MultisampleQuality = 0;
|
||||
}
|
||||
/*FIXME: Check MAX bounds of MultisampleQuality*/
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DSurface9_Vtbl;
|
||||
object->ref = 1;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format),
|
||||
Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool,
|
||||
MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateSurface failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
TRACE("(%p) : Created surface %p\n", This, object);
|
||||
*ppSurface = (LPDIRECT3DSURFACE9) object;
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));
|
||||
if (!object)
|
||||
{
|
||||
FIXME("Failed to allocate surface memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
hr = surface_init(object, This, Width, Height, Format, Lockable, Discard,
|
||||
Level, Usage, Pool, MultiSample, MultisampleQuality);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created surface %p.\n", object);
|
||||
*ppSurface = (IDirect3DSurface9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(IDirect3DDevice9Ex *iface, UINT Width, UINT Height,
|
||||
|
@ -849,6 +992,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX
|
|||
HRESULT hr;
|
||||
TRACE("(%p) Relay\n" , This);
|
||||
|
||||
if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS)
|
||||
{
|
||||
WARN("Invalid index %u specified.\n", RenderTargetIndex);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -867,6 +1016,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX
|
|||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS)
|
||||
{
|
||||
WARN("Invalid index %u specified.\n", RenderTargetIndex);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
|
||||
|
@ -1468,8 +1623,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVI
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, BaseVertexIndex);
|
||||
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, MinVertexIndex, NumVertices,
|
||||
startIndex, vertex_count_from_primitive_count(PrimitiveType, primCount));
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, startIndex,
|
||||
vertex_count_from_primitive_count(PrimitiveType, primCount));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -1501,7 +1656,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDE
|
|||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice, MinVertexIndex, NumVertexIndices,
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice,
|
||||
vertex_count_from_primitive_count(PrimitiveType, PrimitiveCount), pIndexData,
|
||||
wined3dformat_from_d3dformat(IndexDataFormat), pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -1523,6 +1678,42 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9EX
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(IDirect3DDevice9Ex *iface,
|
||||
const D3DVERTEXELEMENT9 *elements, IDirect3DVertexDeclaration9 **declaration)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DVertexDeclaration9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, elements %p, declaration %p.\n", iface, elements, declaration);
|
||||
|
||||
if (!declaration)
|
||||
{
|
||||
WARN("Caller passed a NULL declaration, returning D3DERR_INVALIDCALL.\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex declaration memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexdeclaration_init(object, This, elements);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex declaration %p.\n", object);
|
||||
*declaration = (IDirect3DVertexDeclaration9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static IDirect3DVertexDeclaration9 *getConvertedDecl(IDirect3DDevice9Impl *This, DWORD fvf) {
|
||||
HRESULT hr;
|
||||
D3DVERTEXELEMENT9* elements = NULL;
|
||||
|
@ -1639,6 +1830,36 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWO
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(IDirect3DDevice9Ex *iface,
|
||||
const DWORD *byte_code, IDirect3DVertexShader9 **shader)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DVertexShader9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexshader_init(object, This, byte_code);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex shader %p.\n", object);
|
||||
*shader = (IDirect3DVertexShader9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hr;
|
||||
|
@ -1713,7 +1934,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9EX ifac
|
|||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_SetIndices(This->WineD3DDevice,
|
||||
hr = IWineD3DDevice_SetIndexBuffer(This->WineD3DDevice,
|
||||
ib ? ib->wineD3DIndexBuffer : NULL,
|
||||
ib ? ib->format : WINED3DFMT_UNKNOWN);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -1733,7 +1954,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9EX ifac
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData);
|
||||
rc = IWineD3DDevice_GetIndexBuffer(This->WineD3DDevice, &retIndexData);
|
||||
if (SUCCEEDED(rc) && retIndexData) {
|
||||
IWineD3DBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
|
||||
IWineD3DBuffer_Release(retIndexData);
|
||||
|
@ -1746,6 +1967,36 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9EX ifac
|
|||
return rc;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(IDirect3DDevice9Ex *iface,
|
||||
const DWORD *byte_code, IDirect3DPixelShader9 **shader)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DPixelShader9Impl *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
FIXME("Failed to allocate pixel shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = pixelshader_init(object, This, byte_code);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created pixel shader %p.\n", object);
|
||||
*shader = (IDirect3DPixelShader9 *)object;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9EX iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hr;
|
||||
|
@ -2014,17 +2265,6 @@ const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl =
|
|||
IDirect3DDevice9ExImpl_GetDisplayModeEx
|
||||
};
|
||||
|
||||
ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface9Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
/* GetParent's AddRef was forwarded to an object in destruction.
|
||||
* Releasing it here again would cause an endless recursion. */
|
||||
surfaceParent->forwardReference = NULL;
|
||||
return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
|
||||
}
|
||||
|
||||
/* IWineD3DDeviceParent IUnknown methods */
|
||||
|
||||
static inline struct IDirect3DDevice9Impl *device_from_device_parent(IWineD3DDeviceParent *iface)
|
||||
|
@ -2084,9 +2324,13 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
d3d_surface->container = superior;
|
||||
IDirect3DDevice9Ex_Release(d3d_surface->parentDevice);
|
||||
d3d_surface->parentDevice = NULL;
|
||||
|
||||
IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
|
||||
d3d_surface->forwardReference = superior;
|
||||
|
||||
return hr;
|
||||
|
@ -2114,8 +2358,9 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
d3d_surface->container = superior;
|
||||
d3d_surface->isImplicit = TRUE;
|
||||
/* Implicit surfaces are created with an refcount of 0 */
|
||||
IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
|
||||
|
||||
|
@ -2144,8 +2389,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
|
|||
}
|
||||
|
||||
*surface = d3d_surface->wineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
d3d_surface->container = (IUnknown *)This;
|
||||
d3d_surface->isImplicit = TRUE;
|
||||
/* Implicit surfaces are created with an refcount of 0 */
|
||||
IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
|
||||
|
||||
|
@ -2172,23 +2417,22 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
|
|||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DVolume9_Vtbl;
|
||||
object->ref = 1;
|
||||
hr = IWineD3DDevice_CreateVolume(This->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
|
||||
format, pool, &object->wineD3DVolume, (IUnknown *)object);
|
||||
hr = volume_init(object, This, width, height, depth, usage, format, pool);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("(%p) CreateVolume failed, returning %#x\n", iface, hr);
|
||||
WARN("Failed to initialize volume, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*volume = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
*volume = object->wineD3DVolume;
|
||||
IWineD3DVolume_AddRef(*volume);
|
||||
IDirect3DVolume9_Release((IDirect3DVolume9 *)object);
|
||||
|
||||
object->container = superior;
|
||||
object->forwardReference = superior;
|
||||
|
||||
TRACE("(%p) Created volume %p\n", iface, *volume);
|
||||
TRACE("(%p) Created volume %p\n", iface, object);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -337,6 +337,7 @@ void filter_caps(D3DCAPS9* pCaps)
|
|||
D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
|
||||
|
||||
pCaps->MaxVertexShaderConst = min(D3D9_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst);
|
||||
pCaps->NumSimultaneousRTs = min(D3D9_MAX_SIMULTANEOUS_RENDERTARGETS, pCaps->NumSimultaneousRTs);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9EX iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
|
||||
|
@ -383,16 +384,6 @@ static HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9EX iface, UIN
|
|||
return ret;
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D9CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface9Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
surfaceParent->isImplicit = FALSE;
|
||||
/* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
|
||||
return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D9CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
|
||||
IDirect3DSwapChain9Impl* swapChainParent;
|
||||
TRACE("(%p) call back\n", pSwapChain);
|
||||
|
@ -403,16 +394,6 @@ ULONG WINAPI D3D9CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
|
|||
return IDirect3DSwapChain9_Release((IDirect3DSwapChain9*) swapChainParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D9CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
|
||||
IDirect3DSurface9Impl* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
|
||||
surfaceParent->isImplicit = FALSE;
|
||||
/* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
|
||||
return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adapter, D3DDEVTYPE DeviceType,
|
||||
HWND hFocusWindow, DWORD BehaviourFlags,
|
||||
D3DPRESENT_PARAMETERS* pPresentationParameters,
|
||||
|
|
|
@ -47,6 +47,14 @@ static ULONG WINAPI IDirect3DIndexBuffer9Impl_AddRef(LPDIRECT3DINDEXBUFFER9 ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_AddRef(This->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -57,12 +65,10 @@ static ULONG WINAPI IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 ifa
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_Release(This->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -230,43 +236,38 @@ static const IDirect3DIndexBuffer9Vtbl Direct3DIndexBuffer9_Vtbl =
|
|||
IDirect3DIndexBuffer9Impl_GetDesc
|
||||
};
|
||||
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DIndexBuffer9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(IDirect3DDevice9Ex *iface, UINT Length, DWORD Usage,
|
||||
D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9 **ppIndexBuffer, HANDLE *pSharedHandle)
|
||||
static void STDMETHODCALLTYPE d3d9_indexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DIndexBuffer9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
static const struct wined3d_parent_ops d3d9_indexbuffer_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_indexbuffer_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
object->lpVtbl = &Direct3DIndexBuffer9_Vtbl;
|
||||
object->ref = 1;
|
||||
object->format = wined3dformat_from_d3dformat(Format);
|
||||
TRACE("Calling wined3d create index buffer\n");
|
||||
HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
||||
UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
buffer->lpVtbl = &Direct3DIndexBuffer9_Vtbl;
|
||||
buffer->ref = 1;
|
||||
buffer->format = wined3dformat_from_d3dformat(format);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)Pool, &object->wineD3DIndexBuffer, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size,
|
||||
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DIndexBuffer,
|
||||
(IUnknown *)buffer, &d3d9_indexbuffer_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreateIndexBuffer failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppIndexBuffer = (LPDIRECT3DINDEXBUFFER9) object;
|
||||
TRACE("(%p) : Created index buffer %p\n", This, object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
buffer->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(buffer->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,14 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_AddRef(LPDIRECT3DPIXELSHADER9 ifac
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DPixelShader_AddRef(This->wineD3DPixelShader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -56,12 +64,10 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 ifa
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DPixelShader_Release(This->wineD3DPixelShader);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -107,49 +113,38 @@ static const IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl =
|
|||
IDirect3DPixelShader9Impl_GetFunction
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d9_pixelshader_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DPixelShader9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) {
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DPixelShader9Impl *object;
|
||||
HRESULT hrc = D3D_OK;
|
||||
static const struct wined3d_parent_ops d3d9_pixelshader_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_pixelshader_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, IDirect3DDevice9Impl *device, const DWORD *byte_code)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (ppShader == NULL) {
|
||||
TRACE("(%p) Invalid call\n", This);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->ref = 1;
|
||||
object->lpVtbl = &Direct3DPixelShader9_Vtbl;
|
||||
shader->ref = 1;
|
||||
shader->lpVtbl = &Direct3DPixelShader9_Vtbl;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreatePixelShader(This->WineD3DDevice, pFunction, NULL,
|
||||
&object->wineD3DPixelShader, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code,
|
||||
NULL, &shader->wineD3DPixelShader, (IUnknown *)shader,
|
||||
&d3d9_pixelshader_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK)
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* free up object */
|
||||
FIXME("(%p) call to IWineD3DDevice_CreatePixelShader failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0 , object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppShader = (IDirect3DPixelShader9*) object;
|
||||
TRACE("(%p) : Created pixel shader %p\n", This, object);
|
||||
WARN("Failed to created wined3d pixel shader, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : returning %p\n", This, *ppShader);
|
||||
return hrc;
|
||||
shader->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(shader->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9* pShader) {
|
||||
|
|
|
@ -53,7 +53,13 @@ static ULONG WINAPI IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface) {
|
|||
} else {
|
||||
/* No container, handle our own refcounting */
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
if(ref == 1 && This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
if (ref == 1)
|
||||
{
|
||||
if (This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSurface_AddRef(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
return ref;
|
||||
|
@ -77,13 +83,9 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) {
|
|||
|
||||
if (ref == 0) {
|
||||
if (This->parentDevice) IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
if (!This->isImplicit) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSurface_Release(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSurface_Release(This->wineD3DSurface);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -269,6 +271,13 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC*
|
|||
HRESULT hr;
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
if(!This->getdc_supported)
|
||||
{
|
||||
WARN("Surface does not support GetDC, returning D3DERR_INVALIDCALL\n");
|
||||
/* Don't touch the DC */
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DSurface_GetDC(This->wineD3DSurface, phdc);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -291,8 +300,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(LPDIRECT3DSURFACE9 iface,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
const IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl =
|
||||
static const IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DSurface9Impl_QueryInterface,
|
||||
|
@ -315,3 +323,63 @@ const IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl =
|
|||
IDirect3DSurface9Impl_GetDC,
|
||||
IDirect3DSurface9Impl_ReleaseDC
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
|
||||
{
|
||||
surface_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
||||
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
surface->lpVtbl = &Direct3DSurface9_Vtbl;
|
||||
surface->ref = 1;
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case D3DFMT_A8R8G8B8:
|
||||
case D3DFMT_X8R8G8B8:
|
||||
case D3DFMT_R5G6B5:
|
||||
case D3DFMT_X1R5G5B5:
|
||||
case D3DFMT_A1R5G5B5:
|
||||
case D3DFMT_R8G8B8:
|
||||
surface->getdc_supported = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
surface->getdc_supported = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* FIXME: Check MAX bounds of MultisampleQuality. */
|
||||
if (multisample_quality > 0)
|
||||
{
|
||||
FIXME("Multisample quality set to %u, substituting 0.\n", multisample_quality);
|
||||
multisample_quality = 0;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
|
||||
multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
|
||||
&d3d9_surface_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d surface, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
surface->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(surface->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ static ULONG WINAPI IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface)
|
|||
if (This->parentDevice) IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
if (!This->isImplicit) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DSwapChain_Destroy(This->wineD3DSwapChain, D3D9CB_DestroyRenderTarget);
|
||||
IWineD3DSwapChain_Destroy(This->wineD3DSwapChain);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
|
|
@ -49,6 +49,14 @@ static ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface) {
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DTexture_AddRef(This->wineD3DTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -59,12 +67,10 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DTexture_Destroy(This->wineD3DTexture, D3D9CB_DestroySurface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DTexture_Release(This->wineD3DTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -350,43 +356,37 @@ static const IDirect3DTexture9Vtbl Direct3DTexture9_Vtbl =
|
|||
IDirect3DTexture9Impl_AddDirtyRect
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DTexture9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, UINT Levels, DWORD Usage,
|
||||
D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
|
||||
IDirect3DTexture9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_texture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
TRACE("(%p) : W(%d) H(%d), Lvl(%d) d(%d), Fmt(%#x), Pool(%d)\n", This, Width, Height, Levels, Usage, Format, Pool);
|
||||
HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture9Impl));
|
||||
|
||||
if (NULL == object) {
|
||||
ERR("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DTexture9_Vtbl;
|
||||
object->ref = 1;
|
||||
texture->lpVtbl = &Direct3DTexture9_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK,
|
||||
wined3dformat_from_d3dformat(Format), Pool, &object->wineD3DTexture, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
&texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (FAILED(hrc))
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* free up object */
|
||||
WARN("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppTexture= (LPDIRECT3DTEXTURE9) object;
|
||||
TRACE("(%p) Created Texture %p, %p\n", This, object, object->wineD3DTexture);
|
||||
}
|
||||
WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return hrc;
|
||||
texture->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,14 @@ static ULONG WINAPI IDirect3DVertexBuffer9Impl_AddRef(LPDIRECT3DVERTEXBUFFER9 if
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_AddRef(This->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -58,12 +66,10 @@ static ULONG WINAPI IDirect3DVertexBuffer9Impl_Release(LPDIRECT3DVERTEXBUFFER9 i
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBuffer_Release(This->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -233,41 +239,38 @@ static const IDirect3DVertexBuffer9Vtbl Direct3DVertexBuffer9_Vtbl =
|
|||
IDirect3DVertexBuffer9Impl_GetDesc
|
||||
};
|
||||
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DVertexBuffer9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(IDirect3DDevice9Ex *iface, UINT Size, DWORD Usage,
|
||||
DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
|
||||
static void STDMETHODCALLTYPE d3d9_vertexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DVertexBuffer9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVertexBuffer9Impl));
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
static const struct wined3d_parent_ops d3d9_vertexbuffer_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_vertexbuffer_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
object->lpVtbl = &Direct3DVertexBuffer9_Vtbl;
|
||||
object->ref = 1;
|
||||
object->fvf = FVF;
|
||||
HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
||||
UINT size, UINT usage, DWORD fvf, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
buffer->lpVtbl = &Direct3DVertexBuffer9_Vtbl;
|
||||
buffer->ref = 1;
|
||||
buffer->fvf = fvf;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK,
|
||||
0 /* fvf for ddraw only */, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
|
||||
usage & WINED3DUSAGE_MASK, 0, (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
|
||||
(IUnknown *)buffer, &d3d9_vertexbuffer_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK) {
|
||||
|
||||
/* free up object */
|
||||
WARN("(%p) call to IWineD3DDevice_CreateVertexBuffer failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
TRACE("(%p) : Created vertex buffer %p\n", This, object);
|
||||
*ppVertexBuffer = (LPDIRECT3DVERTEXBUFFER9) object;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
return hrc;
|
||||
|
||||
buffer->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(buffer->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ static D3DDECLTYPE_INFO const d3d_dtype_lookup[D3DDECLTYPE_UNUSED] = {
|
|||
{D3DDECLTYPE_FLOAT2, WINED3DFMT_R32G32_FLOAT, 2, sizeof(float)},
|
||||
{D3DDECLTYPE_FLOAT3, WINED3DFMT_R32G32B32_FLOAT, 3, sizeof(float)},
|
||||
{D3DDECLTYPE_FLOAT4, WINED3DFMT_R32G32B32A32_FLOAT, 4, sizeof(float)},
|
||||
{D3DDECLTYPE_D3DCOLOR, WINED3DFMT_A8R8G8B8, 4, sizeof(BYTE)},
|
||||
{D3DDECLTYPE_D3DCOLOR, WINED3DFMT_B8G8R8A8_UNORM, 4, sizeof(BYTE)},
|
||||
{D3DDECLTYPE_UBYTE4, WINED3DFMT_R8G8B8A8_UINT, 4, sizeof(BYTE)},
|
||||
{D3DDECLTYPE_SHORT2, WINED3DFMT_R16G16_SINT, 2, sizeof(short int)},
|
||||
{D3DDECLTYPE_SHORT4, WINED3DFMT_R16G16B16A16_SINT, 4, sizeof(short int)},
|
||||
|
@ -217,6 +217,12 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_AddRef(LPDIRECT3DVERTEXDECLA
|
|||
|
||||
if(ref == 1) {
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
if (!This->convFVF)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexDeclaration_AddRef(This->wineD3DVertexDeclaration);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -233,9 +239,6 @@ void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface)
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->elements);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECLARATION9 iface) {
|
||||
|
@ -245,12 +248,10 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECL
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
if(!This->convFVF) {
|
||||
IDirect3DVertexDeclaration9Impl_Release(iface);
|
||||
IDirect3DVertexDeclaration9Impl_Destroy(iface);
|
||||
}
|
||||
IDirect3DDevice9Ex_Release(parentDevice);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -304,6 +305,18 @@ static const IDirect3DVertexDeclaration9Vtbl Direct3DVertexDeclaration9_Vtbl =
|
|||
IDirect3DVertexDeclaration9Impl_GetDeclaration
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d9_vertexdeclaration_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DVertexDeclaration9Impl *declaration = parent;
|
||||
HeapFree(GetProcessHeap(), 0, declaration->elements);
|
||||
HeapFree(GetProcessHeap(), 0, declaration);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d9_vertexdeclaration_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_vertexdeclaration_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9* d3d9_elements,
|
||||
WINED3DVERTEXELEMENT **wined3d_elements, UINT *element_count)
|
||||
{
|
||||
|
@ -349,72 +362,51 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9* d3d9_elem
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DVertexDeclaration9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(IDirect3DDevice9Ex *iface,
|
||||
const D3DVERTEXELEMENT9 *pVertexElements, IDirect3DVertexDeclaration9 **ppDecl)
|
||||
HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
|
||||
IDirect3DDevice9Impl *device, const D3DVERTEXELEMENT9 *elements)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IDirect3DVertexDeclaration9Impl *object = NULL;
|
||||
WINED3DVERTEXELEMENT* wined3d_elements;
|
||||
WINED3DVERTEXELEMENT *wined3d_elements;
|
||||
UINT wined3d_element_count;
|
||||
UINT element_count;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : Relay\n", iface);
|
||||
if (NULL == ppDecl) {
|
||||
WARN("(%p) : Caller passed NULL As ppDecl, returning D3DERR_INVALIDCALL\n",This);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
hr = convert_to_wined3d_declaration(pVertexElements, &wined3d_elements, &wined3d_element_count);
|
||||
hr = convert_to_wined3d_declaration(elements, &wined3d_elements, &wined3d_element_count);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("(%p) : Error parsing vertex declaration\n", This);
|
||||
WARN("Failed to create wined3d vertex declaration elements, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVertexDeclaration9Impl));
|
||||
if (NULL == object) {
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &Direct3DVertexDeclaration9_Vtbl;
|
||||
object->ref = 0;
|
||||
declaration->lpVtbl = &Direct3DVertexDeclaration9_Vtbl;
|
||||
declaration->ref = 1;
|
||||
|
||||
element_count = wined3d_element_count + 1;
|
||||
object->elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(D3DVERTEXELEMENT9));
|
||||
if (!object->elements) {
|
||||
declaration->elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(*declaration->elements));
|
||||
if (!declaration->elements)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
ERR("Memory allocation failed\n");
|
||||
ERR("Failed to allocate vertex declaration elements memory.\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
CopyMemory(object->elements, pVertexElements, element_count * sizeof(D3DVERTEXELEMENT9));
|
||||
object->element_count = element_count;
|
||||
memcpy(declaration->elements, elements, element_count * sizeof(*elements));
|
||||
declaration->element_count = element_count;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(This->WineD3DDevice, &object->wineD3DVertexDeclaration,
|
||||
(IUnknown *)object, wined3d_elements, wined3d_element_count);
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, &declaration->wineD3DVertexDeclaration,
|
||||
(IUnknown *)declaration, &d3d9_vertexdeclaration_wined3d_parent_ops,
|
||||
wined3d_elements, wined3d_element_count);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
||||
/* free up object */
|
||||
WARN("(%p) call to IWineD3DDevice_CreateVertexDeclaration failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object->elements);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
object->parentDevice = iface;
|
||||
*ppDecl = (LPDIRECT3DVERTEXDECLARATION9) object;
|
||||
IDirect3DVertexDeclaration9_AddRef(*ppDecl);
|
||||
TRACE("(%p) : Created vertex declaration %p\n", This, object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
return hr;
|
||||
|
||||
declaration->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(declaration->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9* pDecl) {
|
||||
|
|
|
@ -46,6 +46,14 @@ static ULONG WINAPI IDirect3DVertexShader9Impl_AddRef(LPDIRECT3DVERTEXSHADER9 if
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexShader_AddRef(This->wineD3DVertexShader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -56,12 +64,10 @@ static ULONG WINAPI IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 i
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVertexShader_Release(This->wineD3DVertexShader);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -111,43 +117,38 @@ static const IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl =
|
|||
IDirect3DVertexShader9Impl_GetFunction
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE d3d9_vertexshader_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DVertexShader9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) {
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
IDirect3DVertexShader9Impl *object;
|
||||
static const struct wined3d_parent_ops d3d9_vertexshader_wined3d_parent_ops =
|
||||
{
|
||||
d3d9_vertexshader_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
/* Setup a stub object for now */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
TRACE("(%p) : pFunction(%p), ppShader(%p)\n", This, pFunction, ppShader);
|
||||
if (NULL == object) {
|
||||
FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, IDirect3DDevice9Impl *device, const DWORD *byte_code)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
object->ref = 1;
|
||||
object->lpVtbl = &Direct3DVertexShader9_Vtbl;
|
||||
shader->ref = 1;
|
||||
shader->lpVtbl = &Direct3DVertexShader9_Vtbl;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hrc= IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, pFunction,
|
||||
NULL /* output signature */, &object->wineD3DVertexShader, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code,
|
||||
NULL /* output signature */, &shader->wineD3DVertexShader,
|
||||
(IUnknown *)shader, &d3d9_vertexshader_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (FAILED(hrc)) {
|
||||
|
||||
/* free up object */
|
||||
FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n");
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
}else{
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppShader = (IDirect3DVertexShader9 *)object;
|
||||
TRACE("(%p) : Created vertex shader %p\n", This, object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d vertex shader, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : returning %p\n", This, *ppShader);
|
||||
return hrc;
|
||||
shader->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(shader->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9* pShader) {
|
||||
|
|
|
@ -53,6 +53,14 @@ static ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) {
|
|||
/* No container, handle our own refcounting */
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolume_AddRef(This->wineD3DVolume);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +83,6 @@ static ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) {
|
|||
wined3d_mutex_lock();
|
||||
IWineD3DVolume_Release(This->wineD3DVolume);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -223,7 +229,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
|
|||
return hr;
|
||||
}
|
||||
|
||||
const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
|
||||
static const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IDirect3DVolume9Impl_QueryInterface,
|
||||
|
@ -240,12 +246,31 @@ const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
|
|||
IDirect3DVolume9Impl_UnlockBox
|
||||
};
|
||||
|
||||
ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume) {
|
||||
IDirect3DVolume9Impl* volumeParent;
|
||||
|
||||
IWineD3DVolume_GetParent(pVolume, (IUnknown **) &volumeParent);
|
||||
/* GetParent's AddRef was forwarded to an object in destruction.
|
||||
* Releasing it here again would cause an endless recursion. */
|
||||
volumeParent->forwardReference = NULL;
|
||||
return IDirect3DVolume9_Release((IDirect3DVolume9*) volumeParent);
|
||||
static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops =
|
||||
{
|
||||
volume_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, UINT width, UINT height,
|
||||
UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
volume->lpVtbl = &Direct3DVolume9_Vtbl;
|
||||
volume->ref = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
|
||||
format, pool, &volume->wineD3DVolume, (IUnknown *)volume, &d3d9_volume_wined3d_parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d volume, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,14 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_AddRef(LPDIRECT3DVOLUMETEXTURE9
|
|||
|
||||
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
||||
|
||||
if (ref == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_AddRef(This->wineD3DVolumeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -58,12 +66,10 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9
|
|||
TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_Destroy(This->wineD3DVolumeTexture, D3D9CB_DestroyVolume);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(This->parentDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DVolumeTexture_Release(This->wineD3DVolumeTexture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -403,47 +409,37 @@ static const IDirect3DVolumeTexture9Vtbl Direct3DVolumeTexture9_Vtbl =
|
|||
IDirect3DVolumeTexture9Impl_AddDirtyBox
|
||||
};
|
||||
|
||||
|
||||
/* IDirect3DDevice9 IDirect3DVolumeTexture9 Methods follow: */
|
||||
HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(IDirect3DDevice9Ex *iface,
|
||||
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format,
|
||||
D3DPOOL Pool, IDirect3DVolumeTexture9 **ppVolumeTexture, HANDLE *pSharedHandle)
|
||||
static void STDMETHODCALLTYPE volumetexture_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
IDirect3DVolumeTexture9Impl *object;
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hrc = D3D_OK;
|
||||
HeapFree(GetProcessHeap(), 0, parent);
|
||||
}
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
static const struct wined3d_parent_ops d3d9_volumetexture_wined3d_parent_ops =
|
||||
{
|
||||
volumetexture_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolumeTexture9Impl));
|
||||
if (NULL == object) {
|
||||
ERR("(%p) allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n", This);
|
||||
return D3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
HRESULT volumetexture_init(IDirect3DVolumeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
||||
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
object->lpVtbl = &Direct3DVolumeTexture9_Vtbl;
|
||||
object->ref = 1;
|
||||
texture->lpVtbl = &Direct3DVolumeTexture9_Vtbl;
|
||||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels,
|
||||
Usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(Format),
|
||||
Pool, &object->wineD3DVolumeTexture, (IUnknown *)object);
|
||||
|
||||
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
&texture->wineD3DVolumeTexture, (IUnknown *)texture, &d3d9_volumetexture_wined3d_parent_ops);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (hrc != D3D_OK) {
|
||||
|
||||
/* free up object */
|
||||
WARN("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
} else {
|
||||
IDirect3DDevice9Ex_AddRef(iface);
|
||||
object->parentDevice = iface;
|
||||
*ppVolumeTexture = (LPDIRECT3DVOLUMETEXTURE9) object;
|
||||
TRACE("(%p) : Created volume texture %p\n", This, object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create wined3d volume texture, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
TRACE("(%p) returning %p\n", This , *ppVolumeTexture);
|
||||
return hrc;
|
||||
|
||||
texture->parentDevice = (IDirect3DDevice9Ex *)device;
|
||||
IDirect3DDevice9Ex_AddRef(texture->parentDevice);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,13 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
|
|||
0
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed(void *parent) {}
|
||||
|
||||
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops =
|
||||
{
|
||||
ddraw_null_wined3d_object_destroyed,
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IUnknown Methods
|
||||
*****************************************************************************/
|
||||
|
@ -574,11 +581,11 @@ IDirectDrawImpl_SetDisplayModeNoOverride(IDirectDraw7 *iface,
|
|||
Mode.RefreshRate = RefreshRate;
|
||||
switch(BPP)
|
||||
{
|
||||
case 8: Mode.Format = WINED3DFMT_P8; break;
|
||||
case 15: Mode.Format = WINED3DFMT_X1R5G5B5; break;
|
||||
case 16: Mode.Format = WINED3DFMT_R5G6B5; break;
|
||||
case 24: Mode.Format = WINED3DFMT_R8G8B8; break;
|
||||
case 32: Mode.Format = WINED3DFMT_X8R8G8B8; break;
|
||||
case 8: Mode.Format = WINED3DFMT_P8_UINT; break;
|
||||
case 15: Mode.Format = WINED3DFMT_B5G5R5X1_UNORM; break;
|
||||
case 16: Mode.Format = WINED3DFMT_B5G6R5_UNORM; break;
|
||||
case 24: Mode.Format = WINED3DFMT_B8G8R8_UNORM; break;
|
||||
case 32: Mode.Format = WINED3DFMT_B8G8R8X8_UNORM; break;
|
||||
}
|
||||
|
||||
/* TODO: The possible return values from msdn suggest that
|
||||
|
@ -1329,22 +1336,22 @@ IDirectDrawImpl_EnumDisplayModes(IDirectDraw7 *iface,
|
|||
|
||||
WINED3DFORMAT checkFormatList[] =
|
||||
{
|
||||
WINED3DFMT_R8G8B8,
|
||||
WINED3DFMT_A8R8G8B8,
|
||||
WINED3DFMT_X8R8G8B8,
|
||||
WINED3DFMT_R5G6B5,
|
||||
WINED3DFMT_X1R5G5B5,
|
||||
WINED3DFMT_A1R5G5B5,
|
||||
WINED3DFMT_A4R4G4B4,
|
||||
WINED3DFMT_R3G3B2,
|
||||
WINED3DFMT_A8R3G3B2,
|
||||
WINED3DFMT_X4R4G4B4,
|
||||
WINED3DFMT_B8G8R8_UNORM,
|
||||
WINED3DFMT_B8G8R8A8_UNORM,
|
||||
WINED3DFMT_B8G8R8X8_UNORM,
|
||||
WINED3DFMT_B5G6R5_UNORM,
|
||||
WINED3DFMT_B5G5R5X1_UNORM,
|
||||
WINED3DFMT_B5G5R5A1_UNORM,
|
||||
WINED3DFMT_B4G4R4A4_UNORM,
|
||||
WINED3DFMT_B2G3R3_UNORM,
|
||||
WINED3DFMT_B2G3R3A8_UNORM,
|
||||
WINED3DFMT_B4G4R4X4_UNORM,
|
||||
WINED3DFMT_R10G10B10A2_UNORM,
|
||||
WINED3DFMT_R8G8B8A8_UNORM,
|
||||
WINED3DFMT_X8B8G8R8,
|
||||
WINED3DFMT_A2R10G10B10,
|
||||
WINED3DFMT_A8P8,
|
||||
WINED3DFMT_P8
|
||||
WINED3DFMT_R8G8B8X8_UNORM,
|
||||
WINED3DFMT_B10G10R10A2_UNORM,
|
||||
WINED3DFMT_P8_UINT_A8_UNORM,
|
||||
WINED3DFMT_P8_UINT,
|
||||
};
|
||||
|
||||
TRACE("(%p)->(%p,%p,%p): Relay\n", This, DDSD, Context, cb);
|
||||
|
@ -1655,11 +1662,9 @@ IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
|
|||
IDirectDrawSurfaceImpl *surfImpl = (IDirectDrawSurfaceImpl *)surf;
|
||||
IDirectDrawImpl *This = surfImpl->ddraw;
|
||||
IUnknown *Parent;
|
||||
IParentImpl *parImpl = NULL;
|
||||
IWineD3DSurface *wineD3DSurface;
|
||||
IWineD3DSwapChain *swapchain;
|
||||
HRESULT hr;
|
||||
void *tmp;
|
||||
IWineD3DClipper *clipper = NULL;
|
||||
|
||||
WINED3DSURFACE_DESC Desc;
|
||||
|
@ -1683,18 +1688,6 @@ IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
|
|||
swapchain = surfImpl->wineD3DSwapChain;
|
||||
surfImpl->wineD3DSwapChain = NULL;
|
||||
wineD3DSurface = surfImpl->WineD3DSurface;
|
||||
IWineD3DSurface_GetParent(wineD3DSurface, &Parent);
|
||||
IUnknown_Release(Parent); /* For the getParent */
|
||||
|
||||
/* Is the parent an IParent interface? */
|
||||
if(IUnknown_QueryInterface(Parent, &IID_IParent, &tmp) == S_OK)
|
||||
{
|
||||
/* It is a IParent interface! */
|
||||
IUnknown_Release(Parent); /* For the QueryInterface */
|
||||
parImpl = (IParentImpl *)Parent;
|
||||
/* Release the reference the parent interface is holding */
|
||||
IWineD3DSurface_Release(wineD3DSurface);
|
||||
}
|
||||
|
||||
/* get the clipper */
|
||||
IWineD3DSurface_GetClipper(wineD3DSurface, &clipper);
|
||||
|
@ -1711,34 +1704,19 @@ IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
|
|||
Width = Desc.width;
|
||||
Height = Desc.height;
|
||||
|
||||
if(swapchain) {
|
||||
/* If there's a swapchain, it owns the IParent interface. Create a new one for the
|
||||
* new surface
|
||||
*/
|
||||
parImpl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*parImpl));
|
||||
parImpl->lpVtbl = &IParent_Vtbl;
|
||||
parImpl->ref = 1;
|
||||
|
||||
Parent = (IUnknown *) parImpl;
|
||||
}
|
||||
IWineD3DSurface_GetParent(wineD3DSurface, &Parent);
|
||||
|
||||
/* Create the new surface */
|
||||
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, Width, Height, Format,
|
||||
TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface,
|
||||
Usage, Pool, MultiSampleType, MultiSampleQuality, This->ImplType, Parent);
|
||||
TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface, Usage, Pool,
|
||||
MultiSampleType, MultiSampleQuality, This->ImplType, Parent, &ddraw_null_wined3d_parent_ops);
|
||||
IUnknown_Release(Parent);
|
||||
|
||||
if(hr != D3D_OK)
|
||||
return hr;
|
||||
|
||||
IWineD3DSurface_SetClipper(surfImpl->WineD3DSurface, clipper);
|
||||
|
||||
/* Update the IParent if it exists */
|
||||
if(parImpl)
|
||||
{
|
||||
parImpl->child = (IUnknown *) surfImpl->WineD3DSurface;
|
||||
/* Add a reference for the IParent */
|
||||
IWineD3DSurface_AddRef(surfImpl->WineD3DSurface);
|
||||
}
|
||||
/* TODO: Copy the surface content, except for render targets */
|
||||
|
||||
/* If there's a swapchain, it owns the wined3d surfaces. So Destroy
|
||||
|
@ -1787,7 +1765,7 @@ IDirectDrawImpl_RecreateAllSurfaces(IDirectDrawImpl *This)
|
|||
/* Should happen almost never */
|
||||
FIXME("(%p) Switching to non-opengl surfaces with d3d started. Is this a bug?\n", This);
|
||||
/* Shutdown d3d */
|
||||
IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroyDepthStencilSurface, D3D7CB_DestroySwapChain);
|
||||
IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroySwapChain);
|
||||
}
|
||||
/* Contrary: D3D starting is handled by the caller, because it knows the render target */
|
||||
|
||||
|
@ -1806,15 +1784,6 @@ ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
|
|||
return IUnknown_Release(swapChainParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
|
||||
IUnknown* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
IWineD3DSurface_GetParent(pSurface, &surfaceParent);
|
||||
IUnknown_Release(surfaceParent);
|
||||
return IUnknown_Release(surfaceParent);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawImpl_CreateNewSurface
|
||||
*
|
||||
|
@ -1841,8 +1810,6 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
|
|||
DWORD Usage = 0;
|
||||
WINED3DSURFTYPE ImplType = This->ImplType;
|
||||
WINED3DSURFACE_DESC Desc;
|
||||
IUnknown *Parent;
|
||||
IParentImpl *parImpl = NULL;
|
||||
WINED3DPOOL Pool = WINED3DPOOL_DEFAULT;
|
||||
|
||||
if (TRACE_ON(ddraw))
|
||||
|
@ -1990,34 +1957,11 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
|
|||
/* A trace message for debugging */
|
||||
TRACE("(%p) Created IDirectDrawSurface implementation structure at %p\n", This, *ppSurf);
|
||||
|
||||
if(pDDSD->ddsCaps.dwCaps & ( DDSCAPS_PRIMARYSURFACE | DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE) )
|
||||
{
|
||||
/* Render targets and textures need a IParent interface,
|
||||
* because WineD3D will destroy them when the swapchain
|
||||
* is released
|
||||
*/
|
||||
parImpl = HeapAlloc(GetProcessHeap(), 0, sizeof(IParentImpl));
|
||||
if(!parImpl)
|
||||
{
|
||||
ERR("Out of memory when allocating memory for a IParent implementation\n");
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
parImpl->ref = 1;
|
||||
parImpl->lpVtbl = &IParent_Vtbl;
|
||||
Parent = (IUnknown *)parImpl;
|
||||
TRACE("Using IParent interface %p as parent\n", parImpl);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Use the surface as parent */
|
||||
Parent = (IUnknown *)*ppSurf;
|
||||
TRACE("Using Surface interface %p as parent\n", *ppSurf);
|
||||
}
|
||||
|
||||
/* Now create the WineD3D Surface */
|
||||
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, pDDSD->dwWidth, pDDSD->dwHeight, Format,
|
||||
TRUE /* Lockable */, FALSE /* Discard */, level, &(*ppSurf)->WineD3DSurface,
|
||||
Usage, Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType, Parent);
|
||||
Usage, Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType,
|
||||
(IUnknown *)*ppSurf, &ddraw_null_wined3d_parent_ops);
|
||||
|
||||
if(hr != D3D_OK)
|
||||
{
|
||||
|
@ -2025,16 +1969,6 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
|
|||
return hr;
|
||||
}
|
||||
|
||||
/* Set the child of the parent implementation if it exists */
|
||||
if(parImpl)
|
||||
{
|
||||
parImpl->child = (IUnknown *) (*ppSurf)->WineD3DSurface;
|
||||
/* The IParent releases the WineD3DSurface, and
|
||||
* the ddraw surface does that too. Hold a reference
|
||||
*/
|
||||
IWineD3DSurface_AddRef((*ppSurf)->WineD3DSurface);
|
||||
}
|
||||
|
||||
/* Increase the surface counter, and attach the surface */
|
||||
InterlockedIncrement(&This->surfaces);
|
||||
list_add_head(&This->surface_list, &(*ppSurf)->surface_list_entry);
|
||||
|
@ -2407,23 +2341,23 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
|
|||
switch(This->orig_bpp)
|
||||
{
|
||||
case 8:
|
||||
Mode.Format = WINED3DFMT_P8;
|
||||
Mode.Format = WINED3DFMT_P8_UINT;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
Mode.Format = WINED3DFMT_X1R5G5B5;
|
||||
Mode.Format = WINED3DFMT_B5G5R5X1_UNORM;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
Mode.Format = WINED3DFMT_R5G6B5;
|
||||
Mode.Format = WINED3DFMT_B5G6R5_UNORM;
|
||||
break;
|
||||
|
||||
case 24:
|
||||
Mode.Format = WINED3DFMT_R8G8B8;
|
||||
Mode.Format = WINED3DFMT_B8G8R8_UNORM;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
Mode.Format = WINED3DFMT_X8R8G8B8;
|
||||
Mode.Format = WINED3DFMT_B8G8R8X8_UNORM;
|
||||
break;
|
||||
}
|
||||
Mode.Width = This->orig_width;
|
||||
|
@ -2442,16 +2376,16 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
|
|||
switch(desc2.u2.dwMipMapCount) /* Who had this glorious idea? */
|
||||
{
|
||||
case 15:
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D15S1);
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_S1_UINT_D15_UNORM);
|
||||
break;
|
||||
case 16:
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D16_UNORM);
|
||||
break;
|
||||
case 24:
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D24X8);
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_X8D24_UNORM);
|
||||
break;
|
||||
case 32:
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D32);
|
||||
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D32_UNORM);
|
||||
break;
|
||||
default:
|
||||
ERR("Unknown Z buffer bit depth\n");
|
||||
|
@ -2686,13 +2620,15 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
|
|||
*/
|
||||
if(desc2.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
|
||||
{
|
||||
hr = IWineD3DDevice_CreateCubeTexture(This->wineD3DDevice, DDSD->dwWidth /* Edgelength */, levels,
|
||||
0 /* usage */, Format, Pool, (IWineD3DCubeTexture **)&object->wineD3DTexture, (IUnknown *)object);
|
||||
hr = IWineD3DDevice_CreateCubeTexture(This->wineD3DDevice, DDSD->dwWidth /* Edgelength */,
|
||||
levels, 0 /* usage */, Format, Pool, (IWineD3DCubeTexture **)&object->wineD3DTexture,
|
||||
(IUnknown *)object, &ddraw_null_wined3d_parent_ops);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IWineD3DDevice_CreateTexture(This->wineD3DDevice, DDSD->dwWidth, DDSD->dwHeight, levels,
|
||||
0 /* usage */, Format, Pool, (IWineD3DTexture **)&object->wineD3DTexture, (IUnknown *)object);
|
||||
0 /* usage */, Format, Pool, (IWineD3DTexture **)&object->wineD3DTexture,
|
||||
(IUnknown *)object, &ddraw_null_wined3d_parent_ops);
|
||||
}
|
||||
This->tex_root = NULL;
|
||||
}
|
||||
|
@ -3032,9 +2968,7 @@ IDirectDrawImpl_AttachD3DDevice(IDirectDrawImpl *This,
|
|||
{
|
||||
ERR("Error allocating an array for the converted vertex decls\n");
|
||||
This->declArraySize = 0;
|
||||
hr = IWineD3DDevice_Uninit3D(This->wineD3DDevice,
|
||||
D3D7CB_DestroyDepthStencilSurface,
|
||||
D3D7CB_DestroySwapChain);
|
||||
hr = IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroySwapChain);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
|
@ -3316,7 +3250,8 @@ IDirectDrawImpl_FindDecl(IDirectDrawImpl *This,
|
|||
}
|
||||
TRACE("not found. Creating and inserting at position %d.\n", low);
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->wineD3DDevice, &pDecl, (IUnknown *)This, fvf);
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->wineD3DDevice, &pDecl,
|
||||
(IUnknown *)This, &ddraw_null_wined3d_parent_ops, fvf);
|
||||
if (hr != S_OK) return NULL;
|
||||
|
||||
if(This->declArraySize == This->numConvertedDecls) {
|
||||
|
@ -3436,6 +3371,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
|
|||
|
||||
/* Return the surface */
|
||||
*surface = surf->WineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
|
||||
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, surf);
|
||||
|
||||
|
@ -3472,6 +3408,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
|
|||
/* TODO: Return failure if the dimensions do not match, but this shouldn't happen */
|
||||
|
||||
*surface = target->WineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
target->isRenderTarget = TRUE;
|
||||
|
||||
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, d3d_surface);
|
||||
|
@ -3484,7 +3421,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
|
|||
DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
|
||||
{
|
||||
struct IDirectDrawImpl *This = ddraw_from_device_parent(iface);
|
||||
/* Create a Depth Stencil surface to make WineD3D happy */
|
||||
IDirectDrawSurfaceImpl *ddraw_surface;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -3512,8 +3449,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
|
|||
}
|
||||
|
||||
This->depthstencil = TRUE;
|
||||
hr = IDirectDraw7_CreateSurface((IDirectDraw7 *)This,
|
||||
&ddsd, (IDirectDrawSurface7 **)&This->DepthStencilBuffer, NULL);
|
||||
hr = IDirectDraw7_CreateSurface((IDirectDraw7 *)This, &ddsd, (IDirectDrawSurface7 **)&ddraw_surface, NULL);
|
||||
This->depthstencil = FALSE;
|
||||
if(FAILED(hr))
|
||||
{
|
||||
|
@ -3521,7 +3457,9 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
|
|||
return hr;
|
||||
}
|
||||
|
||||
*surface = This->DepthStencilBuffer->WineD3DSurface;
|
||||
*surface = ddraw_surface->WineD3DSurface;
|
||||
IWineD3DSurface_AddRef(*surface);
|
||||
IDirectDrawSurface7_Release((IDirectDrawSurface7 *)ddraw_surface);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#endif
|
||||
#include "wine/wined3d.h"
|
||||
|
||||
extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IParent - a helper interface
|
||||
*****************************************************************************/
|
||||
|
@ -77,14 +79,12 @@ typedef struct IDirect3DVertexBufferImpl IDirect3DVertexBufferImpl;
|
|||
typedef struct IParentImpl IParentImpl;
|
||||
|
||||
/* Callbacks for implicit object destruction */
|
||||
extern ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain);
|
||||
|
||||
extern ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface);
|
||||
extern ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Global critical section */
|
||||
extern CRITICAL_SECTION ddraw_cs;
|
||||
extern CRITICAL_SECTION ddraw_cs DECLSPEC_HIDDEN;
|
||||
|
||||
extern DWORD force_refresh_rate;
|
||||
extern DWORD force_refresh_rate DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDraw implementation structure
|
||||
|
@ -114,7 +114,6 @@ struct IDirectDrawImpl
|
|||
/* WineD3D linkage */
|
||||
IWineD3D *wineD3D;
|
||||
IWineD3DDevice *wineD3DDevice;
|
||||
IDirectDrawSurfaceImpl *DepthStencilBuffer;
|
||||
BOOL d3d_initialized;
|
||||
|
||||
/* Misc ddraw fields */
|
||||
|
@ -166,11 +165,11 @@ struct IDirectDrawImpl
|
|||
};
|
||||
|
||||
/* Declare the VTables. They can be found ddraw.c */
|
||||
extern const IDirectDraw7Vtbl IDirectDraw7_Vtbl;
|
||||
extern const IDirectDraw4Vtbl IDirectDraw4_Vtbl;
|
||||
extern const IDirectDraw2Vtbl IDirectDraw2_Vtbl;
|
||||
extern const IDirectDrawVtbl IDirectDraw1_Vtbl;
|
||||
extern const IWineD3DDeviceParentVtbl ddraw_wined3d_device_parent_vtbl;
|
||||
extern const IDirectDraw7Vtbl IDirectDraw7_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirectDraw4Vtbl IDirectDraw4_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirectDraw2Vtbl IDirectDraw2_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirectDrawVtbl IDirectDraw1_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IWineD3DDeviceParentVtbl ddraw_wined3d_device_parent_vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper structures */
|
||||
typedef struct EnumDisplayModesCBS
|
||||
|
@ -188,22 +187,12 @@ typedef struct EnumSurfacesCBS
|
|||
} EnumSurfacesCBS;
|
||||
|
||||
/* Utility functions */
|
||||
void
|
||||
DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS* pIn,
|
||||
DDSCAPS2* pOut);
|
||||
void
|
||||
DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2* pIn,
|
||||
DDDEVICEIDENTIFIER* pOut);
|
||||
void
|
||||
IDirectDrawImpl_Destroy(IDirectDrawImpl *This);
|
||||
|
||||
HRESULT WINAPI
|
||||
IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
|
||||
DDSURFACEDESC2 *desc,
|
||||
void *Context);
|
||||
IWineD3DVertexDeclaration *
|
||||
IDirectDrawImpl_FindDecl(IDirectDrawImpl *This,
|
||||
DWORD fvf);
|
||||
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_HIDDEN;
|
||||
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut) DECLSPEC_HIDDEN;
|
||||
void IDirectDrawImpl_Destroy(IDirectDrawImpl *This) DECLSPEC_HIDDEN;
|
||||
HRESULT WINAPI IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
|
||||
DDSURFACEDESC2 *desc, void *Context) DECLSPEC_HIDDEN;
|
||||
IWineD3DVertexDeclaration *IDirectDrawImpl_FindDecl(IDirectDrawImpl *This, DWORD fvf) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline IDirectDrawImpl *ddraw_from_d3d1(IDirect3D *iface)
|
||||
{
|
||||
|
@ -241,7 +230,7 @@ static inline IDirectDrawImpl *ddraw_from_ddraw4(IDirectDraw4 *iface)
|
|||
}
|
||||
|
||||
/* The default surface type */
|
||||
extern WINED3DSURFTYPE DefaultSurfaceType;
|
||||
extern WINED3DSURFTYPE DefaultSurfaceType DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface implementation structure
|
||||
|
@ -304,14 +293,15 @@ struct IDirectDrawSurfaceImpl
|
|||
};
|
||||
|
||||
/* VTable declaration. It's located in surface.c / surface_thunks.c */
|
||||
extern const IDirectDrawSurface7Vtbl IDirectDrawSurface7_Vtbl;
|
||||
extern const IDirectDrawSurface3Vtbl IDirectDrawSurface3_Vtbl;
|
||||
extern const IDirectDrawGammaControlVtbl IDirectDrawGammaControl_Vtbl;
|
||||
extern const IDirect3DTexture2Vtbl IDirect3DTexture2_Vtbl;
|
||||
extern const IDirect3DTextureVtbl IDirect3DTexture1_Vtbl;
|
||||
extern const IDirectDrawSurface7Vtbl IDirectDrawSurface7_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirectDrawSurface3Vtbl IDirectDrawSurface3_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirectDrawGammaControlVtbl IDirectDrawGammaControl_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DTexture2Vtbl IDirect3DTexture2_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DTextureVtbl IDirect3DTexture1_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT WINAPI IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurfaceImpl *This, IDirectDrawSurfaceImpl *Surf);
|
||||
void IDirectDrawSurfaceImpl_Destroy(IDirectDrawSurfaceImpl *This);
|
||||
HRESULT WINAPI IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurfaceImpl *This,
|
||||
IDirectDrawSurfaceImpl *Surf) DECLSPEC_HIDDEN;
|
||||
void IDirectDrawSurfaceImpl_Destroy(IDirectDrawSurfaceImpl *This) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *surface_from_texture1(IDirect3DTexture *iface)
|
||||
{
|
||||
|
@ -346,7 +336,7 @@ struct IParentImpl
|
|||
|
||||
};
|
||||
|
||||
extern const IParentVtbl IParent_Vtbl;
|
||||
extern const IParentVtbl IParent_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DDevice implementation
|
||||
|
@ -409,19 +399,19 @@ struct IDirect3DDeviceImpl
|
|||
};
|
||||
|
||||
/* Vtables in various versions */
|
||||
extern const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUSetup_Vtbl;
|
||||
extern const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUPreserve_Vtbl;
|
||||
extern const IDirect3DDevice3Vtbl IDirect3DDevice3_Vtbl;
|
||||
extern const IDirect3DDevice2Vtbl IDirect3DDevice2_Vtbl;
|
||||
extern const IDirect3DDeviceVtbl IDirect3DDevice1_Vtbl;
|
||||
extern const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUSetup_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUPreserve_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DDevice3Vtbl IDirect3DDevice3_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DDevice2Vtbl IDirect3DDevice2_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DDeviceVtbl IDirect3DDevice1_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* The IID */
|
||||
extern const GUID IID_D3DDEVICE_WineD3D;
|
||||
extern const GUID IID_D3DDEVICE_WineD3D DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper functions */
|
||||
HRESULT IDirect3DImpl_GetCaps(IWineD3D *WineD3D, D3DDEVICEDESC *Desc123, D3DDEVICEDESC7 *Desc7);
|
||||
DWORD IDirect3DDeviceImpl_CreateHandle(IDirect3DDeviceImpl *This);
|
||||
WINED3DZBUFFERTYPE IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DDeviceImpl *This);
|
||||
HRESULT IDirect3DImpl_GetCaps(IWineD3D *WineD3D, D3DDEVICEDESC *Desc123, D3DDEVICEDESC7 *Desc7) DECLSPEC_HIDDEN;
|
||||
DWORD IDirect3DDeviceImpl_CreateHandle(IDirect3DDeviceImpl *This) DECLSPEC_HIDDEN;
|
||||
WINED3DZBUFFERTYPE IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DDeviceImpl *This) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline IDirect3DDeviceImpl *device_from_device1(IDirect3DDevice *iface)
|
||||
{
|
||||
|
@ -453,10 +443,10 @@ struct EnumTextureFormatsCBS
|
|||
/* No implementation structure as this is only another interface to DirectDraw */
|
||||
|
||||
/* the Vtables */
|
||||
extern const IDirect3DVtbl IDirect3D1_Vtbl;
|
||||
extern const IDirect3D2Vtbl IDirect3D2_Vtbl;
|
||||
extern const IDirect3D3Vtbl IDirect3D3_Vtbl;
|
||||
extern const IDirect3D7Vtbl IDirect3D7_Vtbl;
|
||||
extern const IDirect3DVtbl IDirect3D1_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3D2Vtbl IDirect3D2_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3D3Vtbl IDirect3D3_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3D7Vtbl IDirect3D7_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* Structure for EnumZBufferFormats */
|
||||
struct EnumZBufferFormatsData
|
||||
|
@ -478,9 +468,9 @@ struct IDirectDrawClipperImpl
|
|||
IDirectDrawImpl *ddraw_owner;
|
||||
};
|
||||
|
||||
extern const IDirectDrawClipperVtbl IDirectDrawClipper_Vtbl;
|
||||
extern const IDirectDrawClipperVtbl IDirectDrawClipper_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper;
|
||||
typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawPalette implementation structure
|
||||
|
@ -498,7 +488,7 @@ struct IDirectDrawPaletteImpl
|
|||
IDirectDrawImpl *ddraw_owner;
|
||||
IUnknown *ifaceToRelease;
|
||||
};
|
||||
extern const IDirectDrawPaletteVtbl IDirectDrawPalette_Vtbl;
|
||||
extern const IDirectDrawPaletteVtbl IDirectDrawPalette_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/******************************************************************************
|
||||
* DirectDraw ClassFactory implementation - incomplete
|
||||
|
@ -548,12 +538,12 @@ struct IDirect3DLightImpl
|
|||
};
|
||||
|
||||
/* Vtable */
|
||||
extern const IDirect3DLightVtbl IDirect3DLight_Vtbl;
|
||||
extern const IDirect3DLightVtbl IDirect3DLight_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper functions */
|
||||
void light_update(IDirect3DLightImpl* This);
|
||||
void light_activate(IDirect3DLightImpl* This);
|
||||
void light_desactivate(IDirect3DLightImpl* This);
|
||||
void light_update(IDirect3DLightImpl *This) DECLSPEC_HIDDEN;
|
||||
void light_activate(IDirect3DLightImpl *This) DECLSPEC_HIDDEN;
|
||||
void light_desactivate(IDirect3DLightImpl *This) DECLSPEC_HIDDEN;
|
||||
|
||||
/******************************************************************************
|
||||
* IDirect3DMaterial implementation structure - Wraps to D3D7
|
||||
|
@ -576,12 +566,12 @@ struct IDirect3DMaterialImpl
|
|||
};
|
||||
|
||||
/* VTables in various versions */
|
||||
extern const IDirect3DMaterialVtbl IDirect3DMaterial_Vtbl;
|
||||
extern const IDirect3DMaterial2Vtbl IDirect3DMaterial2_Vtbl;
|
||||
extern const IDirect3DMaterial3Vtbl IDirect3DMaterial3_Vtbl;
|
||||
extern const IDirect3DMaterialVtbl IDirect3DMaterial_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DMaterial2Vtbl IDirect3DMaterial2_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DMaterial3Vtbl IDirect3DMaterial3_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper functions */
|
||||
void material_activate(IDirect3DMaterialImpl* This);
|
||||
void material_activate(IDirect3DMaterialImpl* This) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DViewport - Wraps to D3D7
|
||||
|
@ -622,10 +612,10 @@ struct IDirect3DViewportImpl
|
|||
};
|
||||
|
||||
/* Vtable */
|
||||
extern const IDirect3DViewport3Vtbl IDirect3DViewport3_Vtbl;
|
||||
extern const IDirect3DViewport3Vtbl IDirect3DViewport3_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper functions */
|
||||
void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights);
|
||||
void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DExecuteBuffer - Wraps to D3D7
|
||||
|
@ -655,13 +645,11 @@ struct IDirect3DExecuteBufferImpl
|
|||
};
|
||||
|
||||
/* The VTable */
|
||||
extern const IDirect3DExecuteBufferVtbl IDirect3DExecuteBuffer_Vtbl;
|
||||
extern const IDirect3DExecuteBufferVtbl IDirect3DExecuteBuffer_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
/* The execute function */
|
||||
void
|
||||
IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
IDirect3DDeviceImpl *Device,
|
||||
IDirect3DViewportImpl *ViewportImpl);
|
||||
void IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
||||
IDirect3DDeviceImpl *Device, IDirect3DViewportImpl *ViewportImpl) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexBuffer
|
||||
|
@ -684,8 +672,8 @@ struct IDirect3DVertexBufferImpl
|
|||
};
|
||||
|
||||
/* The Vtables */
|
||||
extern const IDirect3DVertexBuffer7Vtbl IDirect3DVertexBuffer7_Vtbl;
|
||||
extern const IDirect3DVertexBufferVtbl IDirect3DVertexBuffer1_Vtbl;
|
||||
extern const IDirect3DVertexBuffer7Vtbl IDirect3DVertexBuffer7_Vtbl DECLSPEC_HIDDEN;
|
||||
extern const IDirect3DVertexBufferVtbl IDirect3DVertexBuffer1_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
static inline IDirect3DVertexBufferImpl *vb_from_vb1(IDirect3DVertexBuffer *iface)
|
||||
{
|
||||
|
@ -703,23 +691,23 @@ static inline IDirect3DVertexBufferImpl *vb_from_vb1(IDirect3DVertexBuffer *ifac
|
|||
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num) \
|
||||
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
|
||||
|
||||
void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, WINED3DFORMAT WineD3DFormat);
|
||||
WINED3DFORMAT PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat);
|
||||
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd);
|
||||
void dump_D3DMATRIX(const D3DMATRIX *mat);
|
||||
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps);
|
||||
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType);
|
||||
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in);
|
||||
void DDRAW_dump_cooperativelevel(DWORD cooplevel);
|
||||
void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, WINED3DFORMAT WineD3DFormat) DECLSPEC_HIDDEN;
|
||||
WINED3DFORMAT PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat) DECLSPEC_HIDDEN;
|
||||
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN;
|
||||
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN;
|
||||
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN;
|
||||
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
|
||||
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in) DECLSPEC_HIDDEN;
|
||||
void DDRAW_dump_cooperativelevel(DWORD cooplevel) DECLSPEC_HIDDEN;
|
||||
|
||||
/* This only needs to be here as long the processvertices functionality of
|
||||
* IDirect3DExecuteBuffer isn't in WineD3D */
|
||||
void multiply_matrix(LPD3DMATRIX dest, const D3DMATRIX *src1, const D3DMATRIX *src2);
|
||||
void multiply_matrix(LPD3DMATRIX dest, const D3DMATRIX *src1, const D3DMATRIX *src2) DECLSPEC_HIDDEN;
|
||||
|
||||
void multiply_matrix_D3D_way(LPD3DMATRIX result, const D3DMATRIX *m1, const D3DMATRIX *m2);
|
||||
void multiply_matrix_D3D_way(LPD3DMATRIX result, const D3DMATRIX *m1, const D3DMATRIX *m2) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Helper function in main.c */
|
||||
BOOL LoadWineD3D(void);
|
||||
BOOL LoadWineD3D(void) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Used for generic dumping */
|
||||
typedef struct
|
||||
|
@ -759,4 +747,4 @@ typedef struct
|
|||
|
||||
#endif
|
||||
|
||||
HRESULT hr_ddraw_from_wined3d(HRESULT hr);
|
||||
HRESULT hr_ddraw_from_wined3d(HRESULT hr) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -316,7 +316,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
|
|||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
/* Free the index buffer. */
|
||||
IWineD3DDevice_SetIndices(This->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
IWineD3DDevice_SetIndexBuffer(This->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
IWineD3DBuffer_GetParent(This->indexbuffer,
|
||||
(IUnknown **) &IndexBufferParent);
|
||||
IParent_Release(IndexBufferParent); /* Once for the getParent */
|
||||
|
@ -1147,18 +1147,18 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
|
|||
|
||||
WINED3DFORMAT FormatList[] = {
|
||||
/* 32 bit */
|
||||
WINED3DFMT_A8R8G8B8,
|
||||
WINED3DFMT_X8R8G8B8,
|
||||
WINED3DFMT_B8G8R8A8_UNORM,
|
||||
WINED3DFMT_B8G8R8X8_UNORM,
|
||||
/* 24 bit */
|
||||
WINED3DFMT_R8G8B8,
|
||||
WINED3DFMT_B8G8R8_UNORM,
|
||||
/* 16 Bit */
|
||||
WINED3DFMT_A1R5G5B5,
|
||||
WINED3DFMT_A4R4G4B4,
|
||||
WINED3DFMT_R5G6B5,
|
||||
WINED3DFMT_X1R5G5B5,
|
||||
WINED3DFMT_B5G5R5A1_UNORM,
|
||||
WINED3DFMT_B4G4R4A4_UNORM,
|
||||
WINED3DFMT_B5G6R5_UNORM,
|
||||
WINED3DFMT_B5G5R5X1_UNORM,
|
||||
/* 8 Bit */
|
||||
WINED3DFMT_R3G3B2,
|
||||
WINED3DFMT_P8,
|
||||
WINED3DFMT_B2G3R3_UNORM,
|
||||
WINED3DFMT_P8_UINT,
|
||||
/* FOURCC codes */
|
||||
WINED3DFMT_DXT1,
|
||||
WINED3DFMT_DXT3,
|
||||
|
@ -1167,12 +1167,12 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
|
|||
|
||||
WINED3DFORMAT BumpFormatList[] = {
|
||||
WINED3DFMT_R8G8_SNORM,
|
||||
WINED3DFMT_L6V5U5,
|
||||
WINED3DFMT_X8L8V8U8,
|
||||
WINED3DFMT_R5G5_SNORM_L6_UNORM,
|
||||
WINED3DFMT_R8G8_SNORM_L8X8_UNORM,
|
||||
WINED3DFMT_R8G8B8A8_SNORM,
|
||||
WINED3DFMT_R16G16_SNORM,
|
||||
WINED3DFMT_W11V11U10,
|
||||
WINED3DFMT_A2W10V10U10
|
||||
WINED3DFMT_R10G11B11_SNORM,
|
||||
WINED3DFMT_R10G10B10_SNORM_A2_UNORM
|
||||
};
|
||||
|
||||
TRACE("(%p)->(%p,%p): Relay\n", This, Callback, Arg);
|
||||
|
@ -1309,18 +1309,18 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
|
|||
|
||||
WINED3DFORMAT FormatList[] = {
|
||||
/* 32 bit */
|
||||
WINED3DFMT_A8R8G8B8,
|
||||
WINED3DFMT_X8R8G8B8,
|
||||
WINED3DFMT_B8G8R8A8_UNORM,
|
||||
WINED3DFMT_B8G8R8X8_UNORM,
|
||||
/* 24 bit */
|
||||
WINED3DFMT_R8G8B8,
|
||||
WINED3DFMT_B8G8R8_UNORM,
|
||||
/* 16 Bit */
|
||||
WINED3DFMT_A1R5G5B5,
|
||||
WINED3DFMT_A4R4G4B4,
|
||||
WINED3DFMT_R5G6B5,
|
||||
WINED3DFMT_X1R5G5B5,
|
||||
WINED3DFMT_B5G5R5A1_UNORM,
|
||||
WINED3DFMT_B4G4R4A4_UNORM,
|
||||
WINED3DFMT_B5G6R5_UNORM,
|
||||
WINED3DFMT_B5G5R5X1_UNORM,
|
||||
/* 8 Bit */
|
||||
WINED3DFMT_R3G3B2,
|
||||
WINED3DFMT_P8,
|
||||
WINED3DFMT_B2G3R3_UNORM,
|
||||
WINED3DFMT_P8_UINT,
|
||||
/* FOURCC codes - Not in this version*/
|
||||
};
|
||||
|
||||
|
@ -3603,9 +3603,8 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
|
|||
}
|
||||
|
||||
IWineD3DDevice_SetPrimitiveType(This->wineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->wineD3DDevice, 0 /* MinVertexIndex */,
|
||||
VertexCount /* UINT NumVertexIndex */, IndexCount, Indices, WINED3DFMT_R16_UINT,
|
||||
Vertices, get_flexible_vertex_size(VertexType));
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->wineD3DDevice, IndexCount, Indices,
|
||||
WINED3DFMT_R16_UINT, Vertices, get_flexible_vertex_size(VertexType));
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
@ -3842,14 +3841,14 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
|
|||
|
||||
if(VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
|
||||
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
|
||||
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
@ -3983,14 +3982,14 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
|
|||
|
||||
if(VertexType & D3DFVF_DIFFUSE)
|
||||
{
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
|
||||
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
|
||||
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
|
||||
}
|
||||
|
||||
if(VertexType & D3DFVF_SPECULAR)
|
||||
{
|
||||
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
|
||||
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
|
||||
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
|
||||
}
|
||||
|
@ -4267,7 +4266,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
|||
|
||||
/* Set the index stream */
|
||||
IWineD3DDevice_SetBaseVertexIndex(This->wineD3DDevice, StartVertex);
|
||||
hr = IWineD3DDevice_SetIndices(This->wineD3DDevice, This->indexbuffer,
|
||||
hr = IWineD3DDevice_SetIndexBuffer(This->wineD3DDevice, This->indexbuffer,
|
||||
WINED3DFMT_R16_UINT);
|
||||
|
||||
/* Set the vertex stream source */
|
||||
|
@ -4285,8 +4284,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
|||
|
||||
|
||||
IWineD3DDevice_SetPrimitiveType(This->wineD3DDevice, PrimitiveType);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->wineD3DDevice,
|
||||
0 /* minIndex */, NumVertices, 0 /* StartIndex */, IndexCount);
|
||||
hr = IWineD3DDevice_DrawIndexedPrimitive(This->wineD3DDevice, 0 /* StartIndex */, IndexCount);
|
||||
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
|
|
|
@ -824,7 +824,8 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
|
|||
* takes the pointer and avoids the memcpy
|
||||
*/
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(This->wineD3DDevice, 0x40000 /* Length. Don't know how long it should be */,
|
||||
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, &object->indexbuffer, (IUnknown *)IndexBufferParent);
|
||||
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, &object->indexbuffer, (IUnknown *)IndexBufferParent,
|
||||
&ddraw_null_wined3d_parent_ops);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
|
@ -1023,7 +1024,7 @@ IDirect3DImpl_7_CreateVertexBuffer(IDirect3D7 *iface,
|
|||
get_flexible_vertex_size(Desc->dwFVF) * Desc->dwNumVertices,
|
||||
Desc->dwCaps & D3DVBCAPS_WRITEONLY ? WINED3DUSAGE_WRITEONLY : 0, Desc->dwFVF,
|
||||
Desc->dwCaps & D3DVBCAPS_SYSTEMMEMORY ? WINED3DPOOL_SYSTEMMEM : WINED3DPOOL_DEFAULT,
|
||||
&object->wineD3DVertexBuffer, (IUnknown *)object);
|
||||
&object->wineD3DVertexBuffer, (IUnknown *)object, &ddraw_null_wined3d_parent_ops);
|
||||
if(hr != D3D_OK)
|
||||
{
|
||||
ERR("(%p) IWineD3DDevice::CreateVertexBuffer failed with hr=%08x\n", This, hr);
|
||||
|
@ -1111,12 +1112,12 @@ IDirect3DImpl_7_EnumZBufferFormats(IDirect3D7 *iface,
|
|||
/* Order matters. Specifically, BattleZone II (full version) expects the
|
||||
* 16-bit depth formats to be listed before the 24 and 32 ones. */
|
||||
WINED3DFORMAT FormatList[] = {
|
||||
WINED3DFMT_D15S1,
|
||||
WINED3DFMT_S1_UINT_D15_UNORM,
|
||||
WINED3DFMT_D16_UNORM,
|
||||
WINED3DFMT_D24X8,
|
||||
WINED3DFMT_D24X4S4,
|
||||
WINED3DFMT_D24S8,
|
||||
WINED3DFMT_D32
|
||||
WINED3DFMT_X8D24_UNORM,
|
||||
WINED3DFMT_S4X4_UINT_D24_UNORM,
|
||||
WINED3DFMT_S8_UINT_D24_UNORM,
|
||||
WINED3DFMT_D32_UNORM,
|
||||
};
|
||||
|
||||
TRACE("(%p)->(%s,%p,%p): Relay\n", iface, debugstr_guid(refiidDevice), Callback, Context);
|
||||
|
|
|
@ -747,7 +747,6 @@ DestroyCallback(IDirectDrawSurface7 *surf,
|
|||
void *context)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *Impl = (IDirectDrawSurfaceImpl *)surf;
|
||||
IDirectDrawImpl *ddraw = context;
|
||||
ULONG ref;
|
||||
|
||||
ref = IDirectDrawSurface7_Release(surf); /* For the EnumSurfaces */
|
||||
|
@ -759,9 +758,6 @@ DestroyCallback(IDirectDrawSurface7 *surf,
|
|||
*/
|
||||
if( (!Impl->is_complex_root) || (Impl->first_attached != Impl) )
|
||||
return DDENUMRET_OK;
|
||||
/* Skip our depth stencil surface, it will be released with the render target */
|
||||
if( Impl == ddraw->DepthStencilBuffer)
|
||||
return DDENUMRET_OK;
|
||||
|
||||
/* Destroy the surface */
|
||||
while(ref) ref = IDirectDrawSurface7_Release(surf);
|
||||
|
|
|
@ -159,6 +159,13 @@ IDirectDrawSurfaceImpl_AddRef(IDirectDrawSurface7 *iface)
|
|||
IDirectDrawSurfaceImpl *This = (IDirectDrawSurfaceImpl *)iface;
|
||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||
|
||||
if (refCount == 1 && This->WineD3DSurface)
|
||||
{
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
IWineD3DSurface_AddRef(This->WineD3DSurface);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
}
|
||||
|
||||
TRACE("(%p) : AddRef increasing from %d\n", This, refCount - 1);
|
||||
return refCount;
|
||||
}
|
||||
|
@ -310,7 +317,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
|
|||
TRACE("(%p) Destroying the render target, uninitializing D3D\n", This);
|
||||
|
||||
/* Unset any index buffer, just to be sure */
|
||||
IWineD3DDevice_SetIndices(ddraw->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
IWineD3DDevice_SetIndexBuffer(ddraw->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
|
||||
IWineD3DDevice_SetDepthStencilSurface(ddraw->wineD3DDevice, NULL);
|
||||
IWineD3DDevice_SetVertexDeclaration(ddraw->wineD3DDevice, NULL);
|
||||
for(i = 0; i < ddraw->numConvertedDecls; i++)
|
||||
|
@ -320,7 +327,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
|
|||
HeapFree(GetProcessHeap(), 0, ddraw->decls);
|
||||
ddraw->numConvertedDecls = 0;
|
||||
|
||||
if(IWineD3DDevice_Uninit3D(ddraw->wineD3DDevice, D3D7CB_DestroyDepthStencilSurface, D3D7CB_DestroySwapChain) != D3D_OK)
|
||||
if (FAILED(IWineD3DDevice_Uninit3D(ddraw->wineD3DDevice, D3D7CB_DestroySwapChain)))
|
||||
{
|
||||
/* Not good */
|
||||
ERR("(%p) Failed to uninit 3D\n", This);
|
||||
|
@ -358,43 +365,6 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
|
|||
*/
|
||||
TRACE("(%p) D3D unloaded\n", This);
|
||||
}
|
||||
else if(This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE |
|
||||
DDSCAPS_3DDEVICE |
|
||||
DDSCAPS_TEXTURE ) )
|
||||
{
|
||||
/* It's a render target, but no swapchain was created.
|
||||
* The IParent interfaces have to be released manually.
|
||||
* The same applies for textures without an
|
||||
* IWineD3DTexture object attached
|
||||
*/
|
||||
IParent *Parent;
|
||||
|
||||
for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
|
||||
{
|
||||
if(This->complex_array[i])
|
||||
{
|
||||
/* Only the topmost level can have more than 1 surfaces in the complex
|
||||
* attachment array(Cube texture roots), for all others there is only
|
||||
* one
|
||||
*/
|
||||
surf = This->complex_array[i];
|
||||
while(surf)
|
||||
{
|
||||
IWineD3DSurface_GetParent(surf->WineD3DSurface,
|
||||
(IUnknown **) &Parent);
|
||||
IParent_Release(Parent); /* For the getParent */
|
||||
IParent_Release(Parent); /* To release it */
|
||||
surf = surf->complex_array[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now the top-level surface */
|
||||
IWineD3DSurface_GetParent(This->WineD3DSurface,
|
||||
(IUnknown **) &Parent);
|
||||
IParent_Release(Parent); /* For the getParent */
|
||||
IParent_Release(Parent); /* To release it */
|
||||
}
|
||||
|
||||
/* The refcount test shows that the palette is detached when the surface is destroyed */
|
||||
IDirectDrawSurface7_SetPalette((IDirectDrawSurface7 *)This, NULL);
|
||||
|
@ -1069,7 +1039,17 @@ IDirectDrawSurfaceImpl_GetDC(IDirectDrawSurface7 *iface,
|
|||
hr = IWineD3DSurface_GetDC(This->WineD3DSurface,
|
||||
hdc);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
switch(hr)
|
||||
{
|
||||
/* Some, but not all errors set *hdc to NULL. E.g. DCALREADYCREATED does not
|
||||
* touch *hdc
|
||||
*/
|
||||
case WINED3DERR_INVALIDCALL:
|
||||
if(hdc) *hdc = NULL;
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
default: return hr;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -55,7 +55,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->dwSize = Size;
|
||||
switch(WineD3DFormat)
|
||||
{
|
||||
case WINED3DFMT_R8G8B8:
|
||||
case WINED3DFMT_B8G8R8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 24;
|
||||
|
@ -65,7 +65,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 32;
|
||||
|
@ -75,7 +75,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0xff000000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 32;
|
||||
|
@ -85,7 +85,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X8B8G8R8:
|
||||
case WINED3DFMT_R8G8B8X8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 32;
|
||||
|
@ -95,7 +95,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -105,7 +105,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -115,7 +115,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -125,7 +125,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x8000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -135,7 +135,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0xF000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 8;
|
||||
|
@ -145,7 +145,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
DDPixelFormat->dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 8;
|
||||
|
@ -164,7 +164,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A8R3G3B2:
|
||||
case WINED3DFMT_B2G3R3A8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -174,7 +174,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0xF000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_RGB;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwRGBBitCount = 16;
|
||||
|
@ -196,7 +196,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBZBitMask = 0x00000000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D32:
|
||||
case WINED3DFMT_D32_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ZBUFFER;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwZBufferBitDepth = 32;
|
||||
|
@ -206,7 +206,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBZBitMask = 0x00000000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D24X4S4:
|
||||
case WINED3DFMT_S4X4_UINT_D24_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ZBUFFER | DDPF_STENCILBUFFER;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
/* Should I set dwZBufferBitDepth to 32 here? */
|
||||
|
@ -217,7 +217,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D24S8:
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ZBUFFER | DDPF_STENCILBUFFER;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
/* Should I set dwZBufferBitDepth to 32 here? */
|
||||
|
@ -228,7 +228,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D24X8:
|
||||
case WINED3DFMT_X8D24_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ZBUFFER;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwZBufferBitDepth = 32;
|
||||
|
@ -238,7 +238,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
|
||||
|
||||
break;
|
||||
case WINED3DFMT_D15S1:
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ZBUFFER | DDPF_STENCILBUFFER;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwZBufferBitDepth = 16;
|
||||
|
@ -274,7 +274,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
break;
|
||||
|
||||
/* Luminance */
|
||||
case WINED3DFMT_L8:
|
||||
case WINED3DFMT_L8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_LUMINANCE;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwLuminanceBitCount = 8;
|
||||
|
@ -284,7 +284,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A4L4:
|
||||
case WINED3DFMT_L4A4_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ALPHAPIXELS | DDPF_LUMINANCE;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwLuminanceBitCount = 4;
|
||||
|
@ -294,7 +294,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0xf0;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A8L8:
|
||||
case WINED3DFMT_L8A8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_ALPHAPIXELS | DDPF_LUMINANCE;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwLuminanceBitCount = 16;
|
||||
|
@ -315,7 +315,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x00000000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_L6V5U5:
|
||||
case WINED3DFMT_R5G5_SNORM_L6_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_BUMPDUDV;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwBumpBitCount = 16;
|
||||
|
@ -325,6 +325,16 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
|
|||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x00000000;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM:
|
||||
DDPixelFormat->dwFlags = DDPF_BUMPDUDV;
|
||||
DDPixelFormat->dwFourCC = 0;
|
||||
DDPixelFormat->u1.dwBumpBitCount = 32;
|
||||
DDPixelFormat->u2.dwBumpDuBitMask = 0x000000ff;
|
||||
DDPixelFormat->u3.dwBumpDvBitMask = 0x0000ff00;
|
||||
DDPixelFormat->u4.dwBumpLuminanceBitMask = 0x00ff0000;
|
||||
DDPixelFormat->u5.dwLuminanceAlphaBitMask = 0x00000000;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERR("Can't translate this Pixelformat %d\n", WineD3DFormat);
|
||||
}
|
||||
|
@ -357,12 +367,12 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
|
||||
if(DDPixelFormat->dwFlags & DDPF_PALETTEINDEXED8)
|
||||
{
|
||||
return WINED3DFMT_P8;
|
||||
return WINED3DFMT_P8_UINT;
|
||||
}
|
||||
else if(DDPixelFormat->dwFlags & (DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2 | DDPF_PALETTEINDEXED4) )
|
||||
{
|
||||
FIXME("DDPF_PALETTEINDEXED1 to DDPF_PALETTEINDEXED4 are not supported by WineD3D (yet). Returning WINED3DFMT_P8\n");
|
||||
return WINED3DFMT_P8;
|
||||
return WINED3DFMT_P8_UINT;
|
||||
}
|
||||
else if(DDPixelFormat->dwFlags & DDPF_RGB)
|
||||
{
|
||||
|
@ -370,7 +380,7 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
case 8:
|
||||
/* This is the only format that can match here */
|
||||
return WINED3DFMT_R3G3B2;
|
||||
return WINED3DFMT_B2G3R3_UNORM;
|
||||
|
||||
case 16:
|
||||
/* Read the Color masks */
|
||||
|
@ -378,7 +388,7 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
(DDPixelFormat->u3.dwGBitMask == 0x07E0) &&
|
||||
(DDPixelFormat->u4.dwBBitMask == 0x001F) )
|
||||
{
|
||||
return WINED3DFMT_R5G6B5;
|
||||
return WINED3DFMT_B5G6R5_UNORM;
|
||||
}
|
||||
|
||||
if( (DDPixelFormat->u2.dwRBitMask == 0x7C00) &&
|
||||
|
@ -387,9 +397,9 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
if( (DDPixelFormat->dwFlags & DDPF_ALPHAPIXELS) &&
|
||||
(DDPixelFormat->u5.dwRGBAlphaBitMask == 0x8000))
|
||||
return WINED3DFMT_A1R5G5B5;
|
||||
return WINED3DFMT_B5G5R5A1_UNORM;
|
||||
else
|
||||
return WINED3DFMT_X1R5G5B5;
|
||||
return WINED3DFMT_B5G5R5X1_UNORM;
|
||||
}
|
||||
|
||||
if( (DDPixelFormat->u2.dwRBitMask == 0x0F00) &&
|
||||
|
@ -398,9 +408,9 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
if( (DDPixelFormat->dwFlags & DDPF_ALPHAPIXELS) &&
|
||||
(DDPixelFormat->u5.dwRGBAlphaBitMask == 0xF000))
|
||||
return WINED3DFMT_A4R4G4B4;
|
||||
return WINED3DFMT_B4G4R4A4_UNORM;
|
||||
else
|
||||
return WINED3DFMT_X4R4G4B4;
|
||||
return WINED3DFMT_B4G4R4X4_UNORM;
|
||||
}
|
||||
|
||||
if( (DDPixelFormat->dwFlags & DDPF_ALPHAPIXELS) &&
|
||||
|
@ -409,13 +419,13 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
(DDPixelFormat->u3.dwGBitMask == 0x001C) &&
|
||||
(DDPixelFormat->u4.dwBBitMask == 0x0003) )
|
||||
{
|
||||
return WINED3DFMT_A8R3G3B2;
|
||||
return WINED3DFMT_B2G3R3A8_UNORM;
|
||||
}
|
||||
ERR("16 bit RGB Pixel format does not match\n");
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
|
||||
case 24:
|
||||
return WINED3DFMT_R8G8B8;
|
||||
return WINED3DFMT_B8G8R8_UNORM;
|
||||
|
||||
case 32:
|
||||
/* Read the Color masks */
|
||||
|
@ -425,9 +435,9 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
if( (DDPixelFormat->dwFlags & DDPF_ALPHAPIXELS) &&
|
||||
(DDPixelFormat->u5.dwRGBAlphaBitMask == 0xFF000000))
|
||||
return WINED3DFMT_A8R8G8B8;
|
||||
return WINED3DFMT_B8G8R8A8_UNORM;
|
||||
else
|
||||
return WINED3DFMT_X8R8G8B8;
|
||||
return WINED3DFMT_B8G8R8X8_UNORM;
|
||||
|
||||
}
|
||||
ERR("32 bit RGB pixel format does not match\n");
|
||||
|
@ -464,17 +474,17 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
case 4:
|
||||
if(DDPixelFormat->u1.dwAlphaBitDepth == 4)
|
||||
return WINED3DFMT_A4L4;
|
||||
return WINED3DFMT_L4A4_UNORM;
|
||||
ERR("Unknown Alpha / Luminance bit depth combination\n");
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
|
||||
case 6:
|
||||
ERR("A luminance Pixelformat shouldn't have 6 luminance bits. Returning D3DFMT_L6V5U5 for now!!\n");
|
||||
return WINED3DFMT_L6V5U5;
|
||||
return WINED3DFMT_R5G5_SNORM_L6_UNORM;
|
||||
|
||||
case 8:
|
||||
if(DDPixelFormat->u1.dwAlphaBitDepth == 8)
|
||||
return WINED3DFMT_A8L8;
|
||||
return WINED3DFMT_L8A8_UNORM;
|
||||
ERR("Unknown Alpha / Lumincase bit depth combination\n");
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
}
|
||||
|
@ -486,10 +496,10 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
{
|
||||
case 6:
|
||||
ERR("A luminance Pixelformat shouldn't have 6 luminance bits. Returning D3DFMT_L6V5U5 for now!!\n");
|
||||
return WINED3DFMT_L6V5U5;
|
||||
return WINED3DFMT_R5G5_SNORM_L6_UNORM;
|
||||
|
||||
case 8:
|
||||
return WINED3DFMT_L8;
|
||||
return WINED3DFMT_L8_UNORM;
|
||||
|
||||
default:
|
||||
ERR("Unknown luminance-only bit depth 0x%x\n", DDPixelFormat->u1.dwLuminanceBitCount);
|
||||
|
@ -512,20 +522,20 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
FIXME("15 bit depth buffer not handled yet, assuming 16 bit\n");
|
||||
case 16:
|
||||
if(DDPixelFormat->u2.dwStencilBitDepth == 1)
|
||||
return WINED3DFMT_D15S1;
|
||||
return WINED3DFMT_S1_UINT_D15_UNORM;
|
||||
|
||||
FIXME("Don't know how to handle a 16 bit Z buffer with %d bit stencil buffer pixelformat\n", DDPixelFormat->u2.dwStencilBitDepth);
|
||||
return WINED3DFMT_UNKNOWN;
|
||||
|
||||
case 24:
|
||||
FIXME("Don't know how to handle a 24 bit depth buffer with stencil bits\n");
|
||||
return WINED3DFMT_D24S8;
|
||||
return WINED3DFMT_S8_UINT_D24_UNORM;
|
||||
|
||||
case 32:
|
||||
if(DDPixelFormat->u2.dwStencilBitDepth == 8)
|
||||
return WINED3DFMT_D24S8;
|
||||
return WINED3DFMT_S8_UINT_D24_UNORM;
|
||||
else
|
||||
return WINED3DFMT_D24X4S4;
|
||||
return WINED3DFMT_S4X4_UINT_D24_UNORM;
|
||||
|
||||
default:
|
||||
ERR("Unknown Z buffer depth %d\n", DDPixelFormat->u1.dwZBufferBitDepth);
|
||||
|
@ -547,12 +557,12 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
FIXME("24 Bit depth buffer, treating like a 32 bit one\n");
|
||||
case 32:
|
||||
if(DDPixelFormat->u3.dwZBitMask == 0x00FFFFFF) {
|
||||
return WINED3DFMT_D24X8;
|
||||
return WINED3DFMT_X8D24_UNORM;
|
||||
} else if(DDPixelFormat->u3.dwZBitMask == 0xFFFFFFFF) {
|
||||
return WINED3DFMT_D32;
|
||||
return WINED3DFMT_D32_UNORM;
|
||||
}
|
||||
FIXME("Unhandled 32 bit depth buffer bitmasks, returning WINED3DFMT_D24X8\n");
|
||||
return WINED3DFMT_D24X8; /* That's most likely to make games happy */
|
||||
return WINED3DFMT_X8D24_UNORM; /* That's most likely to make games happy */
|
||||
|
||||
default:
|
||||
ERR("Unsupported Z buffer depth %d\n", DDPixelFormat->u1.dwZBufferBitDepth);
|
||||
|
@ -618,7 +628,14 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|||
(DDPixelFormat->u3.dwBumpDvBitMask == 0x000003e0) &&
|
||||
(DDPixelFormat->u4.dwBumpLuminanceBitMask == 0x0000fc00) )
|
||||
{
|
||||
return WINED3DFMT_L6V5U5;
|
||||
return WINED3DFMT_R5G5_SNORM_L6_UNORM;
|
||||
}
|
||||
else if ( (DDPixelFormat->u1.dwBumpBitCount == 32 ) &&
|
||||
(DDPixelFormat->u2.dwBumpDuBitMask == 0x000000ff) &&
|
||||
(DDPixelFormat->u3.dwBumpDvBitMask == 0x0000ff00) &&
|
||||
(DDPixelFormat->u4.dwBumpLuminanceBitMask == 0x00ff0000) )
|
||||
{
|
||||
return WINED3DFMT_R8G8_SNORM_L8X8_UNORM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,8 @@ struct arb_ps_np2fixup_info
|
|||
struct arb_ps_compile_args
|
||||
{
|
||||
struct ps_compile_args super;
|
||||
DWORD bools; /* WORD is enough, use DWORD for alignment */
|
||||
WORD bools;
|
||||
WORD clip; /* only a boolean, use a WORD for alignment */
|
||||
unsigned char loop_ctrl[MAX_CONST_I][3];
|
||||
};
|
||||
|
||||
|
@ -276,10 +277,11 @@ static unsigned int shader_arb_load_constantsF(IWineD3DBaseShaderImpl *This, con
|
|||
GLuint target_type, unsigned int max_constants, const float *constants, char *dirty_consts)
|
||||
{
|
||||
local_constant* lconst;
|
||||
DWORD i = 0, j;
|
||||
DWORD i, j;
|
||||
unsigned int ret;
|
||||
|
||||
if (TRACE_ON(d3d_shader)) {
|
||||
if (TRACE_ON(d3d_constants))
|
||||
{
|
||||
for(i = 0; i < max_constants; i++) {
|
||||
if(!dirty_consts[i]) continue;
|
||||
TRACE_(d3d_constants)("Loading constants %i: %f, %f, %f, %f\n", i,
|
||||
|
@ -287,6 +289,9 @@ static unsigned int shader_arb_load_constantsF(IWineD3DBaseShaderImpl *This, con
|
|||
constants[i * 4 + 2], constants[i * 4 + 3]);
|
||||
}
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
||||
/* In 1.X pixel shaders constants are implicitly clamped in the range [-1;1] */
|
||||
if (target_type == GL_FRAGMENT_PROGRAM_ARB && This->baseShader.reg_maps.shader_version.major == 1)
|
||||
{
|
||||
|
@ -3237,7 +3242,7 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct
|
|||
struct shader_arb_ctx_priv priv_ctx;
|
||||
BOOL dcl_tmp = args->super.srgb_correction, dcl_td = FALSE;
|
||||
BOOL want_nv_prog = FALSE;
|
||||
struct arb_pshader_private *shader_priv = This->backend_priv;
|
||||
struct arb_pshader_private *shader_priv = This->baseShader.backend_data;
|
||||
GLint errPos;
|
||||
DWORD map;
|
||||
|
||||
|
@ -3496,7 +3501,7 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct
|
|||
next_local += fixup->super.num_consts;
|
||||
}
|
||||
|
||||
if (shader_priv->clipplane_emulation != ~0U)
|
||||
if (shader_priv->clipplane_emulation != ~0U && args->clip)
|
||||
{
|
||||
shader_addline(buffer, "KIL fragment.texcoord[%u];\n", shader_priv->clipplane_emulation);
|
||||
}
|
||||
|
@ -3965,13 +3970,14 @@ static struct arb_ps_compiled_shader *find_arb_pshader(IWineD3DPixelShaderImpl *
|
|||
struct arb_pshader_private *shader_data;
|
||||
GLuint ret;
|
||||
|
||||
if(!shader->backend_priv) {
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) shader->baseShader.device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
struct shader_arb_priv *priv = device->shader_priv;
|
||||
|
||||
shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
shader_data = shader->backend_priv;
|
||||
shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
shader_data = shader->baseShader.backend_data;
|
||||
shader_data->clamp_consts = shader->baseShader.reg_maps.shader_version.major == 1;
|
||||
|
||||
if(shader->baseShader.reg_maps.shader_version.major < 3) shader_data->input_signature_idx = ~0;
|
||||
|
@ -3986,7 +3992,7 @@ static struct arb_ps_compiled_shader *find_arb_pshader(IWineD3DPixelShaderImpl *
|
|||
else
|
||||
shader_data->clipplane_emulation = ~0U;
|
||||
}
|
||||
shader_data = shader->backend_priv;
|
||||
shader_data = shader->baseShader.backend_data;
|
||||
|
||||
/* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
|
||||
* so a linear search is more performant than a hashmap or a binary search
|
||||
|
@ -4060,10 +4066,11 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl
|
|||
GLuint ret;
|
||||
const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info;
|
||||
|
||||
if(!shader->backend_priv) {
|
||||
shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
}
|
||||
shader_data = shader->backend_priv;
|
||||
shader_data = shader->baseShader.backend_data;
|
||||
|
||||
/* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
|
||||
* so a linear search is more performant than a hashmap or a binary search
|
||||
|
@ -4128,6 +4135,20 @@ static inline void find_arb_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWi
|
|||
if(stateblock->pixelShaderConstantB[i]) args->bools |= ( 1 << i);
|
||||
}
|
||||
|
||||
/* Only enable the clip plane emulation KIL if at least one clipplane is enabled. The KIL instruction
|
||||
* is quite expensive because it forces the driver to disable early Z discards. It is cheaper to
|
||||
* duplicate the shader than have a no-op KIL instruction in every shader
|
||||
*/
|
||||
if((!((IWineD3DDeviceImpl *) shader->baseShader.device)->vs_clipping) && use_vs(stateblock) &&
|
||||
stateblock->renderState[WINED3DRS_CLIPPING] && stateblock->renderState[WINED3DRS_CLIPPLANEENABLE])
|
||||
{
|
||||
args->clip = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
args->clip = 0;
|
||||
}
|
||||
|
||||
/* Skip if unused or local, or supported natively */
|
||||
int_skip = ~shader->baseShader.reg_maps.integer_constants | shader->baseShader.reg_maps.local_int_consts;
|
||||
if(int_skip == 0xffff || GL_SUPPORT(NV_FRAGMENT_PROGRAM_OPTION))
|
||||
|
@ -4166,7 +4187,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
|
|||
if(use_ps(stateblock))
|
||||
{
|
||||
IWineD3DPixelShaderImpl *ps = (IWineD3DPixelShaderImpl *) stateblock->pixelShader;
|
||||
struct arb_pshader_private *shader_priv = ps->backend_priv;
|
||||
struct arb_pshader_private *shader_priv = ps->baseShader.backend_data;
|
||||
args->ps_signature = shader_priv->input_signature_idx;
|
||||
|
||||
args->boolclip.clip_control[0] = shader_priv->clipplane_emulation + 1;
|
||||
|
@ -4262,9 +4283,9 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
|
|||
/* Pixel Shader 1.x constants are clamped to [-1;1], Pixel Shader 2.0 constants are not. If switching between
|
||||
* a 1.x and newer shader, reload the first 8 constants
|
||||
*/
|
||||
if(priv->last_ps_const_clamped != ((struct arb_pshader_private *) ps->backend_priv)->clamp_consts)
|
||||
if(priv->last_ps_const_clamped != ((struct arb_pshader_private *)ps->baseShader.backend_data)->clamp_consts)
|
||||
{
|
||||
priv->last_ps_const_clamped = ((struct arb_pshader_private *) ps->backend_priv)->clamp_consts;
|
||||
priv->last_ps_const_clamped = ((struct arb_pshader_private *)ps->baseShader.backend_data)->clamp_consts;
|
||||
This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, 8);
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
|
@ -4380,7 +4401,7 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
|
|||
if (shader_is_pshader_version(baseShader->baseShader.reg_maps.shader_version.type))
|
||||
{
|
||||
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *) iface;
|
||||
struct arb_pshader_private *shader_data = This->backend_priv;
|
||||
struct arb_pshader_private *shader_data = This->baseShader.backend_data;
|
||||
UINT i;
|
||||
|
||||
if(!shader_data) return; /* This can happen if a shader was never compiled */
|
||||
|
@ -4395,10 +4416,10 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
|
|||
LEAVE_GL();
|
||||
HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders);
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
This->backend_priv = NULL;
|
||||
This->baseShader.backend_data = NULL;
|
||||
} else {
|
||||
IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *) iface;
|
||||
struct arb_vshader_private *shader_data = This->backend_priv;
|
||||
struct arb_vshader_private *shader_data = This->baseShader.backend_data;
|
||||
UINT i;
|
||||
|
||||
if(!shader_data) return; /* This can happen if a shader was never compiled */
|
||||
|
@ -4413,7 +4434,7 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
|
|||
LEAVE_GL();
|
||||
HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders);
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
This->backend_priv = NULL;
|
||||
This->baseShader.backend_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4423,7 +4444,7 @@ static int sig_tree_compare(const void *key, const struct wine_rb_entry *entry)
|
|||
return compare_sig(key, e->sig);
|
||||
}
|
||||
|
||||
struct wine_rb_functions sig_tree_functions =
|
||||
static const struct wine_rb_functions sig_tree_functions =
|
||||
{
|
||||
wined3d_rb_alloc,
|
||||
wined3d_rb_realloc,
|
||||
|
|
|
@ -206,11 +206,15 @@ int shader_addline(struct wined3d_shader_buffer *buffer, const char *format, ...
|
|||
return ret;
|
||||
}
|
||||
|
||||
void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDevice *device)
|
||||
void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDeviceImpl *device,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
shader->ref = 1;
|
||||
shader->device = device;
|
||||
shader->device = (IWineD3DDevice *)device;
|
||||
shader->parent = parent;
|
||||
shader->parent_ops = parent_ops;
|
||||
list_init(&shader->linked_programs);
|
||||
list_add_head(&device->shaders, &shader->shader_list_entry);
|
||||
}
|
||||
|
||||
/* Convert floating point offset relative
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2002-2004 Raphael Junqueira
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -29,11 +30,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
|
|||
|
||||
HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DRESOURCETYPE resource_type,
|
||||
IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc,
|
||||
WINED3DPOOL pool, IUnknown *parent)
|
||||
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
hr = resource_init((IWineD3DResource *)texture, resource_type, device, size, usage, format_desc, pool, parent);
|
||||
hr = resource_init((IWineD3DResource *)texture, resource_type, device,
|
||||
size, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x\n", hr);
|
||||
|
@ -43,8 +45,8 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DR
|
|||
texture->baseTexture.levels = levels;
|
||||
texture->baseTexture.filterType = (usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3DTEXF_LINEAR : WINED3DTEXF_NONE;
|
||||
texture->baseTexture.LOD = 0;
|
||||
texture->baseTexture.dirty = TRUE;
|
||||
texture->baseTexture.srgbDirty = TRUE;
|
||||
texture->baseTexture.texture_rgb.dirty = TRUE;
|
||||
texture->baseTexture.texture_srgb.dirty = TRUE;
|
||||
texture->baseTexture.is_srgb = FALSE;
|
||||
texture->baseTexture.pow2Matrix_identity = TRUE;
|
||||
|
||||
|
@ -68,28 +70,33 @@ void basetexture_cleanup(IWineD3DBaseTexture *iface)
|
|||
resource_cleanup((IWineD3DResource *)iface);
|
||||
}
|
||||
|
||||
/* A GL context is provided by the caller */
|
||||
static void gltexture_delete(struct gl_texture *tex)
|
||||
{
|
||||
ENTER_GL();
|
||||
glDeleteTextures(1, &tex->name);
|
||||
LEAVE_GL();
|
||||
tex->name = 0;
|
||||
}
|
||||
|
||||
void basetexture_unload(IWineD3DBaseTexture *iface)
|
||||
{
|
||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
||||
|
||||
if(This->baseTexture.textureName) {
|
||||
if(This->baseTexture.texture_rgb.name ||
|
||||
This->baseTexture.texture_srgb.name) {
|
||||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
ENTER_GL();
|
||||
glDeleteTextures(1, &This->baseTexture.textureName);
|
||||
This->baseTexture.textureName = 0;
|
||||
LEAVE_GL();
|
||||
}
|
||||
|
||||
if(This->baseTexture.srgbTextureName) {
|
||||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
ENTER_GL();
|
||||
glDeleteTextures(1, &This->baseTexture.srgbTextureName);
|
||||
This->baseTexture.srgbTextureName = 0;
|
||||
LEAVE_GL();
|
||||
if(This->baseTexture.texture_rgb.name) {
|
||||
gltexture_delete(&This->baseTexture.texture_rgb);
|
||||
}
|
||||
This->baseTexture.dirty = TRUE;
|
||||
This->baseTexture.srgbDirty = TRUE;
|
||||
if(This->baseTexture.texture_srgb.name) {
|
||||
gltexture_delete(&This->baseTexture.texture_srgb);
|
||||
}
|
||||
This->baseTexture.texture_rgb.dirty = TRUE;
|
||||
This->baseTexture.texture_srgb.dirty = TRUE;
|
||||
}
|
||||
|
||||
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew)
|
||||
|
@ -111,8 +118,8 @@ DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew)
|
|||
if(This->baseTexture.LOD != LODNew) {
|
||||
This->baseTexture.LOD = LODNew;
|
||||
|
||||
This->baseTexture.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
|
||||
This->baseTexture.srgbstates[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
|
||||
This->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
|
||||
This->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
|
||||
if(This->baseTexture.bindCount) {
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(This->baseTexture.sampler));
|
||||
}
|
||||
|
@ -156,7 +163,7 @@ HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DT
|
|||
*/
|
||||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
ENTER_GL();
|
||||
glBindTexture(textureDimensions, This->baseTexture.textureName);
|
||||
glBindTexture(textureDimensions, This->baseTexture.texture_rgb.name);
|
||||
checkGLcall("glBindTexture");
|
||||
switch(FilterType) {
|
||||
case WINED3DTEXF_NONE:
|
||||
|
@ -203,16 +210,16 @@ BOOL basetexture_set_dirty(IWineD3DBaseTexture *iface, BOOL dirty)
|
|||
{
|
||||
BOOL old;
|
||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||
old = This->baseTexture.dirty || This->baseTexture.srgbDirty;
|
||||
This->baseTexture.dirty = dirty;
|
||||
This->baseTexture.srgbDirty = dirty;
|
||||
old = This->baseTexture.texture_rgb.dirty || This->baseTexture.texture_srgb.dirty;
|
||||
This->baseTexture.texture_rgb.dirty = dirty;
|
||||
This->baseTexture.texture_srgb.dirty = dirty;
|
||||
return old;
|
||||
}
|
||||
|
||||
BOOL basetexture_get_dirty(IWineD3DBaseTexture *iface)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||
return This->baseTexture.dirty || This->baseTexture.srgbDirty;
|
||||
return This->baseTexture.texture_rgb.dirty || This->baseTexture.texture_srgb.dirty;
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
|
@ -222,49 +229,46 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
|
|||
HRESULT hr = WINED3D_OK;
|
||||
UINT textureDimensions;
|
||||
BOOL isNewTexture = FALSE;
|
||||
GLuint *texture;
|
||||
DWORD *states;
|
||||
struct gl_texture *gl_tex;
|
||||
TRACE("(%p) : About to bind texture\n", This);
|
||||
|
||||
This->baseTexture.is_srgb = srgb; /* SRGB mode cache for PreLoad calls outside drawprim */
|
||||
if(srgb) {
|
||||
texture = &This->baseTexture.srgbTextureName;
|
||||
states = This->baseTexture.srgbstates;
|
||||
gl_tex = &This->baseTexture.texture_srgb;
|
||||
} else {
|
||||
texture = &This->baseTexture.textureName;
|
||||
states = This->baseTexture.states;
|
||||
gl_tex = &This->baseTexture.texture_rgb;
|
||||
}
|
||||
|
||||
textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
|
||||
ENTER_GL();
|
||||
/* Generate a texture name if we don't already have one */
|
||||
if (*texture == 0) {
|
||||
if (gl_tex->name == 0) {
|
||||
*set_surface_desc = TRUE;
|
||||
glGenTextures(1, texture);
|
||||
glGenTextures(1, &gl_tex->name);
|
||||
checkGLcall("glGenTextures");
|
||||
TRACE("Generated texture %d\n", *texture);
|
||||
TRACE("Generated texture %d\n", gl_tex->name);
|
||||
if (This->resource.pool == WINED3DPOOL_DEFAULT) {
|
||||
/* Tell opengl to try and keep this texture in video ram (well mostly) */
|
||||
GLclampf tmp;
|
||||
tmp = 0.9f;
|
||||
glPrioritizeTextures(1, texture, &tmp);
|
||||
glPrioritizeTextures(1, &gl_tex->name, &tmp);
|
||||
|
||||
}
|
||||
/* Initialise the state of the texture object
|
||||
to the openGL defaults, not the directx defaults */
|
||||
states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_WRAP;
|
||||
states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_WRAP;
|
||||
states[WINED3DTEXSTA_ADDRESSW] = WINED3DTADDRESS_WRAP;
|
||||
states[WINED3DTEXSTA_BORDERCOLOR] = 0;
|
||||
states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR;
|
||||
states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */
|
||||
states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */
|
||||
states[WINED3DTEXSTA_MAXMIPLEVEL] = 0;
|
||||
states[WINED3DTEXSTA_MAXANISOTROPY] = 1;
|
||||
states[WINED3DTEXSTA_SRGBTEXTURE] = 0;
|
||||
states[WINED3DTEXSTA_ELEMENTINDEX] = 0;
|
||||
states[WINED3DTEXSTA_DMAPOFFSET] = 0;
|
||||
states[WINED3DTEXSTA_TSSADDRESSW] = WINED3DTADDRESS_WRAP;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_WRAP;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_WRAP;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSW] = WINED3DTADDRESS_WRAP;
|
||||
gl_tex->states[WINED3DTEXSTA_BORDERCOLOR] = 0;
|
||||
gl_tex->states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR;
|
||||
gl_tex->states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */
|
||||
gl_tex->states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */
|
||||
gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = 0;
|
||||
gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = 1;
|
||||
gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE] = 0;
|
||||
gl_tex->states[WINED3DTEXSTA_ELEMENTINDEX] = 0;
|
||||
gl_tex->states[WINED3DTEXSTA_DMAPOFFSET] = 0;
|
||||
gl_tex->states[WINED3DTEXSTA_TSSADDRESSW] = WINED3DTADDRESS_WRAP;
|
||||
IWineD3DBaseTexture_SetDirty(iface, TRUE);
|
||||
isNewTexture = TRUE;
|
||||
|
||||
|
@ -272,7 +276,7 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
|
|||
/* This means double binding the texture at creation, but keeps the code simpler all
|
||||
* in all, and the run-time path free from additional checks
|
||||
*/
|
||||
glBindTexture(textureDimensions, *texture);
|
||||
glBindTexture(textureDimensions, gl_tex->name);
|
||||
checkGLcall("glBindTexture");
|
||||
glTexParameteri(textureDimensions, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
checkGLcall("glTexParameteri(textureDimensions, GL_GENERATE_MIPMAP_SGIS, GL_TRUE)");
|
||||
|
@ -282,8 +286,8 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surfac
|
|||
}
|
||||
|
||||
/* Bind the texture */
|
||||
if (*texture != 0) {
|
||||
glBindTexture(textureDimensions, *texture);
|
||||
if (gl_tex->name != 0) {
|
||||
glBindTexture(textureDimensions, gl_tex->name);
|
||||
checkGLcall("glBindTexture");
|
||||
if (isNewTexture) {
|
||||
/* For a new texture we have to set the textures levels after binding the texture.
|
||||
|
@ -346,40 +350,41 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1])
|
||||
{
|
||||
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
|
||||
DWORD state, *states;
|
||||
DWORD state;
|
||||
GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
|
||||
BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface);
|
||||
DWORD aniso;
|
||||
struct gl_texture *gl_tex;
|
||||
|
||||
TRACE("iface %p, textureStates %p, samplerStates %p\n", iface, textureStates, samplerStates);
|
||||
|
||||
if(This->baseTexture.is_srgb) {
|
||||
states = This->baseTexture.srgbstates;
|
||||
gl_tex = &This->baseTexture.texture_srgb;
|
||||
} else {
|
||||
states = This->baseTexture.states;
|
||||
gl_tex = &This->baseTexture.texture_rgb;
|
||||
}
|
||||
|
||||
/* This function relies on the correct texture being bound and loaded. */
|
||||
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSU] != states[WINED3DTEXSTA_ADDRESSU]) {
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSU] != gl_tex->states[WINED3DTEXSTA_ADDRESSU]) {
|
||||
state = samplerStates[WINED3DSAMP_ADDRESSU];
|
||||
apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_S, cond_np2);
|
||||
states[WINED3DTEXSTA_ADDRESSU] = state;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSU] = state;
|
||||
}
|
||||
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSV] != states[WINED3DTEXSTA_ADDRESSV]) {
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSV] != gl_tex->states[WINED3DTEXSTA_ADDRESSV]) {
|
||||
state = samplerStates[WINED3DSAMP_ADDRESSV];
|
||||
apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_T, cond_np2);
|
||||
states[WINED3DTEXSTA_ADDRESSV] = state;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSV] = state;
|
||||
}
|
||||
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSW] != states[WINED3DTEXSTA_ADDRESSW]) {
|
||||
if(samplerStates[WINED3DSAMP_ADDRESSW] != gl_tex->states[WINED3DTEXSTA_ADDRESSW]) {
|
||||
state = samplerStates[WINED3DSAMP_ADDRESSW];
|
||||
apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_R, cond_np2);
|
||||
states[WINED3DTEXSTA_ADDRESSW] = state;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSW] = state;
|
||||
}
|
||||
|
||||
if(samplerStates[WINED3DSAMP_BORDERCOLOR] != states[WINED3DTEXSTA_BORDERCOLOR]) {
|
||||
if(samplerStates[WINED3DSAMP_BORDERCOLOR] != gl_tex->states[WINED3DTEXSTA_BORDERCOLOR]) {
|
||||
float col[4];
|
||||
|
||||
state = samplerStates[WINED3DSAMP_BORDERCOLOR];
|
||||
|
@ -387,10 +392,10 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
TRACE("Setting border color for %u to %x\n", textureDimensions, state);
|
||||
glTexParameterfv(textureDimensions, GL_TEXTURE_BORDER_COLOR, &col[0]);
|
||||
checkGLcall("glTexParameteri(..., GL_TEXTURE_BORDER_COLOR, ...)");
|
||||
states[WINED3DTEXSTA_BORDERCOLOR] = state;
|
||||
gl_tex->states[WINED3DTEXSTA_BORDERCOLOR] = state;
|
||||
}
|
||||
|
||||
if(samplerStates[WINED3DSAMP_MAGFILTER] != states[WINED3DTEXSTA_MAGFILTER]) {
|
||||
if(samplerStates[WINED3DSAMP_MAGFILTER] != gl_tex->states[WINED3DTEXSTA_MAGFILTER]) {
|
||||
GLint glValue;
|
||||
state = samplerStates[WINED3DSAMP_MAGFILTER];
|
||||
if (state > WINED3DTEXF_ANISOTROPIC) {
|
||||
|
@ -402,25 +407,25 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
|
||||
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
|
||||
|
||||
states[WINED3DTEXSTA_MAGFILTER] = state;
|
||||
gl_tex->states[WINED3DTEXSTA_MAGFILTER] = state;
|
||||
}
|
||||
|
||||
if((samplerStates[WINED3DSAMP_MINFILTER] != states[WINED3DTEXSTA_MINFILTER] ||
|
||||
samplerStates[WINED3DSAMP_MIPFILTER] != states[WINED3DTEXSTA_MIPFILTER] ||
|
||||
samplerStates[WINED3DSAMP_MAXMIPLEVEL] != states[WINED3DTEXSTA_MAXMIPLEVEL])) {
|
||||
if((samplerStates[WINED3DSAMP_MINFILTER] != gl_tex->states[WINED3DTEXSTA_MINFILTER] ||
|
||||
samplerStates[WINED3DSAMP_MIPFILTER] != gl_tex->states[WINED3DTEXSTA_MIPFILTER] ||
|
||||
samplerStates[WINED3DSAMP_MAXMIPLEVEL] != gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL])) {
|
||||
GLint glValue;
|
||||
|
||||
states[WINED3DTEXSTA_MIPFILTER] = samplerStates[WINED3DSAMP_MIPFILTER];
|
||||
states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER];
|
||||
states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL];
|
||||
gl_tex->states[WINED3DTEXSTA_MIPFILTER] = samplerStates[WINED3DSAMP_MIPFILTER];
|
||||
gl_tex->states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER];
|
||||
gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL];
|
||||
|
||||
if (states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC
|
||||
|| states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)
|
||||
if (gl_tex->states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC
|
||||
|| gl_tex->states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)
|
||||
{
|
||||
|
||||
FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %d D3DSAMP_MIPFILTER value %d\n",
|
||||
states[WINED3DTEXSTA_MINFILTER],
|
||||
states[WINED3DTEXSTA_MIPFILTER]);
|
||||
gl_tex->states[WINED3DTEXSTA_MINFILTER],
|
||||
gl_tex->states[WINED3DTEXSTA_MIPFILTER]);
|
||||
}
|
||||
glValue = wined3d_gl_min_mip_filter(This->baseTexture.minMipLookup,
|
||||
min(max(samplerStates[WINED3DSAMP_MINFILTER], WINED3DTEXF_POINT), WINED3DTEXF_LINEAR),
|
||||
|
@ -433,15 +438,15 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
checkGLcall("glTexParameter GL_TEXTURE_MIN_FILTER, ...");
|
||||
|
||||
if(!cond_np2) {
|
||||
if(states[WINED3DTEXSTA_MIPFILTER] == WINED3DTEXF_NONE) {
|
||||
if(gl_tex->states[WINED3DTEXSTA_MIPFILTER] == WINED3DTEXF_NONE) {
|
||||
glValue = This->baseTexture.LOD;
|
||||
} else if(states[WINED3DTEXSTA_MAXMIPLEVEL] >= This->baseTexture.levels) {
|
||||
} else if(gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] >= This->baseTexture.levels) {
|
||||
glValue = This->baseTexture.levels - 1;
|
||||
} else if(states[WINED3DTEXSTA_MAXMIPLEVEL] < This->baseTexture.LOD) {
|
||||
} else if(gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] < This->baseTexture.LOD) {
|
||||
/* baseTexture.LOD is already clamped in the setter */
|
||||
glValue = This->baseTexture.LOD;
|
||||
} else {
|
||||
glValue = states[WINED3DTEXSTA_MAXMIPLEVEL];
|
||||
glValue = gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL];
|
||||
}
|
||||
/* Note that D3DSAMP_MAXMIPLEVEL specifies the biggest mipmap(default 0), while
|
||||
* GL_TEXTURE_MAX_LEVEL specifies the smallest mimap used(default 1000).
|
||||
|
@ -451,9 +456,9 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
}
|
||||
}
|
||||
|
||||
if ((states[WINED3DSAMP_MAGFILTER] != WINED3DTEXF_ANISOTROPIC
|
||||
&& states[WINED3DSAMP_MINFILTER] != WINED3DTEXF_ANISOTROPIC
|
||||
&& states[WINED3DSAMP_MIPFILTER] != WINED3DTEXF_ANISOTROPIC)
|
||||
if ((gl_tex->states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_ANISOTROPIC
|
||||
&& gl_tex->states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_ANISOTROPIC
|
||||
&& gl_tex->states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_ANISOTROPIC)
|
||||
|| cond_np2)
|
||||
{
|
||||
aniso = 1;
|
||||
|
@ -463,7 +468,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
aniso = samplerStates[WINED3DSAMP_MAXANISOTROPY];
|
||||
}
|
||||
|
||||
if (states[WINED3DTEXSTA_MAXANISOTROPY] != aniso)
|
||||
if (gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] != aniso)
|
||||
{
|
||||
if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC))
|
||||
{
|
||||
|
@ -474,6 +479,6 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
|
|||
{
|
||||
WARN("Anisotropic filtering not supported.\n");
|
||||
}
|
||||
states[WINED3DTEXSTA_MAXANISOTROPY] = aniso;
|
||||
gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = aniso;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,11 +223,11 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
|
|||
else if (is_ffp_color) FIXME("test FLOAT16 fixed function processing colors\n");
|
||||
*float16_used = TRUE;
|
||||
}
|
||||
else if (check_d3dcolor && format == WINED3DFMT_A8R8G8B8)
|
||||
else if (check_d3dcolor && format == WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
ret = buffer_process_converted_attribute(This, CONV_D3DCOLOR, attrib, stride_this_run);
|
||||
|
||||
if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_A8R8G8B8 format\n");
|
||||
if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_B8G8R8A8_UNORM format\n");
|
||||
}
|
||||
else if (is_ffp_position && format == WINED3DFMT_R32G32B32A32_FLOAT)
|
||||
{
|
||||
|
@ -635,6 +635,7 @@ static ULONG STDMETHODCALLTYPE buffer_Release(IWineD3DBuffer *iface)
|
|||
{
|
||||
buffer_UnLoad(iface);
|
||||
resource_cleanup((IWineD3DResource *)iface);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1036,7 @@ static HRESULT STDMETHODCALLTYPE buffer_GetDesc(IWineD3DBuffer *iface, WINED3DBU
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
const struct IWineD3DBufferVtbl wined3d_buffer_vtbl =
|
||||
static const struct IWineD3DBufferVtbl wined3d_buffer_vtbl =
|
||||
{
|
||||
/* IUnknown methods */
|
||||
buffer_QueryInterface,
|
||||
|
@ -1058,3 +1059,58 @@ const struct IWineD3DBufferVtbl wined3d_buffer_vtbl =
|
|||
buffer_Unmap,
|
||||
buffer_GetDesc,
|
||||
};
|
||||
|
||||
HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
||||
UINT size, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, GLenum bind_hint,
|
||||
const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &device->adapter->gl_info);
|
||||
HRESULT hr;
|
||||
|
||||
if (!size)
|
||||
{
|
||||
WARN("Size 0 requested, returning WINED3DERR_INVALIDCALL\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
buffer->vtbl = &wined3d_buffer_vtbl;
|
||||
|
||||
hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER,
|
||||
device, size, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, hr %#x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
buffer->buffer_type_hint = bind_hint;
|
||||
|
||||
TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage,
|
||||
debug_d3dformat(buffer->resource.format_desc->format), buffer->resource.allocatedMemory, buffer);
|
||||
|
||||
if (data)
|
||||
{
|
||||
BYTE *ptr;
|
||||
|
||||
hr = IWineD3DBuffer_Map((IWineD3DBuffer *)buffer, 0, size, &ptr, 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to map buffer, hr %#x\n", hr);
|
||||
buffer_UnLoad((IWineD3DBuffer *)buffer);
|
||||
resource_cleanup((IWineD3DResource *)buffer);
|
||||
return hr;
|
||||
}
|
||||
|
||||
memcpy(ptr, data, size);
|
||||
|
||||
hr = IWineD3DBuffer_Unmap((IWineD3DBuffer *)buffer);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to unmap buffer, hr %#x\n", hr);
|
||||
buffer_UnLoad((IWineD3DBuffer *)buffer);
|
||||
resource_cleanup((IWineD3DResource *)buffer);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@ void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fb
|
|||
{
|
||||
if (!*fbo)
|
||||
{
|
||||
GL_EXTCALL(glGenFramebuffersEXT(1, fbo));
|
||||
checkGLcall("glGenFramebuffersEXT()");
|
||||
gl_info->fbo_ops.glGenFramebuffers(1, fbo);
|
||||
checkGLcall("glGenFramebuffers()");
|
||||
TRACE("Created FBO %u.\n", *fbo);
|
||||
}
|
||||
f = *fbo;
|
||||
|
@ -57,17 +57,17 @@ void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fb
|
|||
|
||||
switch (target)
|
||||
{
|
||||
case GL_READ_FRAMEBUFFER_EXT:
|
||||
case GL_READ_FRAMEBUFFER:
|
||||
if (context->fbo_read_binding == f) return;
|
||||
context->fbo_read_binding = f;
|
||||
break;
|
||||
|
||||
case GL_DRAW_FRAMEBUFFER_EXT:
|
||||
case GL_DRAW_FRAMEBUFFER:
|
||||
if (context->fbo_draw_binding == f) return;
|
||||
context->fbo_draw_binding = f;
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_EXT:
|
||||
case GL_FRAMEBUFFER:
|
||||
if (context->fbo_read_binding == f
|
||||
&& context->fbo_draw_binding == f) return;
|
||||
context->fbo_read_binding = f;
|
||||
|
@ -79,7 +79,7 @@ void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fb
|
|||
break;
|
||||
}
|
||||
|
||||
GL_EXTCALL(glBindFramebufferEXT(target, f));
|
||||
gl_info->fbo_ops.glBindFramebuffer(target, f);
|
||||
checkGLcall("glBindFramebuffer()");
|
||||
}
|
||||
|
||||
|
@ -90,13 +90,13 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info)
|
|||
|
||||
for (i = 0; i < GL_LIMITS(buffers); ++i)
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + i, GL_TEXTURE_2D, 0, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
|
||||
|
@ -105,11 +105,11 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
|
|||
{
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, fbo);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, fbo);
|
||||
context_clean_fbo_attachments(gl_info);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
|
||||
GL_EXTCALL(glDeleteFramebuffersEXT(1, fbo));
|
||||
gl_info->fbo_ops.glDeleteFramebuffers(1, fbo);
|
||||
checkGLcall("glDeleteFramebuffers()");
|
||||
}
|
||||
|
||||
|
@ -125,17 +125,17 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOO
|
|||
/* Update base texture states array */
|
||||
if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl)))
|
||||
{
|
||||
if (texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT
|
||||
|| texture_impl->baseTexture.states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE)
|
||||
if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT
|
||||
|| texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE)
|
||||
{
|
||||
texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
texture_impl->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
update_minfilter = TRUE;
|
||||
}
|
||||
|
||||
if (texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_POINT)
|
||||
if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_POINT)
|
||||
{
|
||||
texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
update_magfilter = TRUE;
|
||||
}
|
||||
|
||||
|
@ -194,16 +194,16 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
|
|||
{
|
||||
if (format_flags & WINED3DFMT_FLAG_DEPTH)
|
||||
{
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, depth_stencil_impl->current_renderbuffer->id));
|
||||
checkGLcall("glFramebufferRenderbufferEXT()");
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_DEPTH_ATTACHMENT,
|
||||
GL_RENDERBUFFER, depth_stencil_impl->current_renderbuffer->id);
|
||||
checkGLcall("glFramebufferRenderbuffer()");
|
||||
}
|
||||
|
||||
if (format_flags & WINED3DFMT_FLAG_STENCIL)
|
||||
{
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, depth_stencil_impl->current_renderbuffer->id));
|
||||
checkGLcall("glFramebufferRenderbufferEXT()");
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_STENCIL_ATTACHMENT,
|
||||
GL_RENDERBUFFER, depth_stencil_impl->current_renderbuffer->id);
|
||||
checkGLcall("glFramebufferRenderbuffer()");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -212,40 +212,40 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
|
|||
|
||||
if (format_flags & WINED3DFMT_FLAG_DEPTH)
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT,
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT,
|
||||
depth_stencil_impl->texture_target, depth_stencil_impl->texture_name,
|
||||
depth_stencil_impl->texture_level));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
depth_stencil_impl->texture_level);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
|
||||
if (format_flags & WINED3DFMT_FLAG_STENCIL)
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT,
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT,
|
||||
depth_stencil_impl->texture_target, depth_stencil_impl->texture_name,
|
||||
depth_stencil_impl->texture_level));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
depth_stencil_impl->texture_level);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
}
|
||||
|
||||
if (!(format_flags & WINED3DFMT_FLAG_DEPTH))
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
|
||||
if (!(format_flags & WINED3DFMT_FLAG_STENCIL))
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,12 +262,14 @@ void context_attach_surface_fbo(const struct wined3d_context *context,
|
|||
{
|
||||
context_apply_attachment_filter_states(surface, TRUE);
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, surface_impl->texture_target,
|
||||
surface_impl->texture_name, surface_impl->texture_level));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
} else {
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, GL_TEXTURE_2D, 0, 0));
|
||||
checkGLcall("glFramebufferTexture2DEXT()");
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, surface_impl->texture_target,
|
||||
surface_impl->texture_name, surface_impl->texture_level);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, GL_TEXTURE_2D, 0, 0);
|
||||
checkGLcall("glFramebufferTexture2D()");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,8 +279,8 @@ static void context_check_fbo_status(struct wined3d_context *context)
|
|||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
GLenum status;
|
||||
|
||||
status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
TRACE("FBO complete\n");
|
||||
} else {
|
||||
|
@ -329,7 +331,7 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_
|
|||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &entry->id);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id);
|
||||
context_clean_fbo_attachments(gl_info);
|
||||
|
||||
memcpy(entry->render_targets, device->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets));
|
||||
|
@ -394,7 +396,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
|
|||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
unsigned int i;
|
||||
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &entry->id);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id);
|
||||
|
||||
if (!entry->attached)
|
||||
{
|
||||
|
@ -402,7 +404,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
|
|||
for (i = 0; i < GL_LIMITS(buffers); ++i)
|
||||
{
|
||||
IWineD3DSurface *render_target = device->render_targets[i];
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER_EXT, i, render_target);
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER, i, render_target);
|
||||
}
|
||||
|
||||
/* Apply depth targets */
|
||||
|
@ -413,7 +415,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
|
|||
|
||||
surface_set_compatible_renderbuffer(device->stencilBufferTarget, w, h);
|
||||
}
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, device->stencilBufferTarget, TRUE);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, device->stencilBufferTarget, TRUE);
|
||||
|
||||
entry->attached = TRUE;
|
||||
} else {
|
||||
|
@ -429,7 +431,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
|
|||
for (i = 0; i < GL_LIMITS(buffers); ++i)
|
||||
{
|
||||
if (device->render_targets[i])
|
||||
device->draw_buffers[i] = GL_COLOR_ATTACHMENT0_EXT + i;
|
||||
device->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i;
|
||||
else
|
||||
device->draw_buffers[i] = GL_NONE;
|
||||
}
|
||||
|
@ -444,7 +446,7 @@ static void context_apply_fbo_state(struct wined3d_context *context)
|
|||
context_apply_fbo_entry(context, context->current_fbo);
|
||||
} else {
|
||||
context->current_fbo = NULL;
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
}
|
||||
|
||||
context_check_fbo_status(context);
|
||||
|
@ -757,17 +759,22 @@ BOOL context_set_current(struct wined3d_context *ctx)
|
|||
TRACE("Switching to D3D context %p, GL context %p, device context %p.\n", ctx, ctx->glCtx, ctx->hdc);
|
||||
if (!pwglMakeCurrent(ctx->hdc, ctx->glCtx))
|
||||
{
|
||||
ERR("Failed to make GL context %p current on device context %p.\n", ctx->glCtx, ctx->hdc);
|
||||
DWORD err = GetLastError();
|
||||
ERR("Failed to make GL context %p current on device context %p, last error %#x.\n",
|
||||
ctx->glCtx, ctx->hdc, err);
|
||||
TlsSetValue(wined3d_context_tls_idx, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
ctx->current = 1;
|
||||
}
|
||||
else
|
||||
else if(pwglGetCurrentContext())
|
||||
{
|
||||
TRACE("Clearing current D3D context.\n");
|
||||
if (!pwglMakeCurrent(NULL, NULL))
|
||||
{
|
||||
ERR("Failed to clear current GL context.\n");
|
||||
DWORD err = GetLastError();
|
||||
ERR("Failed to clear current GL context, last error %#x.\n", err);
|
||||
TlsSetValue(wined3d_context_tls_idx, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -915,10 +922,10 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
|
|||
* Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
|
||||
* time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
|
||||
* issue needs to be fixed. */
|
||||
if (ds_format_desc->format != WINED3DFMT_D24S8)
|
||||
if (ds_format_desc->format != WINED3DFMT_S8_UINT_D24_UNORM)
|
||||
{
|
||||
FIXME("Add OpenGL context recreation support to SetDepthStencilSurface\n");
|
||||
ds_format_desc = getFormatDescEntry(WINED3DFMT_D24S8, &This->adapter->gl_info);
|
||||
ds_format_desc = getFormatDescEntry(WINED3DFMT_S8_UINT_D24_UNORM, &This->adapter->gl_info);
|
||||
}
|
||||
|
||||
getDepthStencilBits(ds_format_desc, &depthBits, &stencilBits);
|
||||
|
@ -1130,18 +1137,18 @@ struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceI
|
|||
if(wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) {
|
||||
auxBuffers = TRUE;
|
||||
|
||||
if (color_format_desc->format == WINED3DFMT_X4R4G4B4)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_A4R4G4B4, &This->adapter->gl_info);
|
||||
else if (color_format_desc->format == WINED3DFMT_X8R8G8B8)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->adapter->gl_info);
|
||||
if (color_format_desc->format == WINED3DFMT_B4G4R4X4_UNORM)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_B4G4R4A4_UNORM, &This->adapter->gl_info);
|
||||
else if (color_format_desc->format == WINED3DFMT_B8G8R8X8_UNORM)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info);
|
||||
}
|
||||
|
||||
/* DirectDraw supports 8bit paletted render targets and these are used by old games like Starcraft and C&C.
|
||||
* Most modern hardware doesn't support 8bit natively so we perform some form of 8bit -> 32bit conversion.
|
||||
* The conversion (ab)uses the alpha component for storing the palette index. For this reason we require
|
||||
* a format with 8bit alpha, so request A8R8G8B8. */
|
||||
if (color_format_desc->format == WINED3DFMT_P8)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->adapter->gl_info);
|
||||
if (color_format_desc->format == WINED3DFMT_P8_UINT)
|
||||
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info);
|
||||
|
||||
/* Retrieve the depth stencil format from the present parameters.
|
||||
* The choice of the proper format can give a nice performance boost
|
||||
|
@ -1360,7 +1367,11 @@ struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceI
|
|||
checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)");
|
||||
}
|
||||
|
||||
if (GL_SUPPORT(EXT_PROVOKING_VERTEX))
|
||||
if (GL_SUPPORT(ARB_PROVOKING_VERTEX))
|
||||
{
|
||||
GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION));
|
||||
}
|
||||
else if (GL_SUPPORT(EXT_PROVOKING_VERTEX))
|
||||
{
|
||||
GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT));
|
||||
}
|
||||
|
@ -1958,7 +1969,7 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
|
|||
checkGLcall("glDrawBuffer()");
|
||||
}
|
||||
} else {
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
}
|
||||
}
|
||||
|
@ -2040,13 +2051,13 @@ struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurfac
|
|||
{
|
||||
FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n");
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER_EXT, 0, target);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, NULL, FALSE);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, target);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE);
|
||||
LEAVE_GL();
|
||||
} else {
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
LEAVE_GL();
|
||||
}
|
||||
context->draw_buffer_dirty = TRUE;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2002-2005 Raphael Junqueira
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -55,7 +56,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
|
|||
srgb_mode = This->baseTexture.is_srgb;
|
||||
break;
|
||||
}
|
||||
dirty = srgb_mode ? &This->baseTexture.srgbDirty : &This->baseTexture.dirty;
|
||||
dirty = srgb_mode ? &This->baseTexture.texture_srgb.dirty : &This->baseTexture.texture_rgb.dirty;
|
||||
|
||||
TRACE("(%p) : About to load texture: dirtified(%u).\n", This, *dirty);
|
||||
|
||||
|
@ -69,8 +70,8 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
|
|||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
}
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
for (i = 0; i < This->baseTexture.levels; ++i)
|
||||
{
|
||||
|
@ -110,7 +111,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
|
|||
*dirty = FALSE;
|
||||
}
|
||||
|
||||
static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This, D3DCB_DESTROYSURFACEFN surface_destroy_cb)
|
||||
static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
|
@ -130,128 +131,13 @@ static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This, D3DCB_DESTROYSURF
|
|||
surface_set_texture_name(surface, 0, FALSE);
|
||||
surface_set_texture_target(surface, 0);
|
||||
IWineD3DSurface_SetContainer(surface, NULL);
|
||||
surface_destroy_cb(surface);
|
||||
IWineD3DSurface_Release(surface);
|
||||
}
|
||||
}
|
||||
}
|
||||
basetexture_cleanup((IWineD3DBaseTexture *)This);
|
||||
}
|
||||
|
||||
HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT pow2_edge_length;
|
||||
unsigned int i, j;
|
||||
UINT tmp_w;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (!GL_SUPPORT(ARB_TEXTURE_CUBE_MAP) && pool != WINED3DPOOL_SCRATCH)
|
||||
{
|
||||
WARN("(%p) : Tried to create not supported cube texture.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))
|
||||
{
|
||||
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(edge_length) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,
|
||||
WINED3DRTYPE_CUBETEXTURE, device, 0, usage, format_desc, pool, parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Find the nearest pow2 match. */
|
||||
pow2_edge_length = 1;
|
||||
while (pow2_edge_length < edge_length) pow2_edge_length <<= 1;
|
||||
|
||||
if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO) || (edge_length == pow2_edge_length))
|
||||
{
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords. */
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords. */
|
||||
texture->baseTexture.pow2Matrix[0] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[5] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[10] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
}
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = edge_length;
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Create the 6 faces. */
|
||||
for (j = 0; j < 6; ++j)
|
||||
{
|
||||
static const GLenum cube_targets[6] =
|
||||
{
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
|
||||
};
|
||||
|
||||
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,
|
||||
format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);
|
||||
texture->surfaces[j][i] = NULL;
|
||||
cubetexture_cleanup(texture, D3DCB_DefaultDestroySurface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
IWineD3DSurface_SetContainer(texture->surfaces[j][i], (IWineD3DBase *)texture);
|
||||
TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[j][i]);
|
||||
surface_set_texture_target(texture->surfaces[j][i], cube_targets[j]);
|
||||
}
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = cubetexture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
#undef GLINFO_LOCATION
|
||||
|
||||
/* *******************************************
|
||||
|
@ -288,8 +174,11 @@ static ULONG WINAPI IWineD3DCubeTextureImpl_Release(IWineD3DCubeTexture *iface)
|
|||
ULONG ref;
|
||||
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
|
||||
ref = InterlockedDecrement(&This->resource.ref);
|
||||
if (ref == 0) {
|
||||
IWineD3DCubeTexture_Destroy(iface, D3DCB_DefaultDestroySurface);
|
||||
if (!ref)
|
||||
{
|
||||
cubetexture_cleanup(This);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -404,9 +293,9 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *i
|
|||
for (i = 0; i < This->baseTexture.levels; ++i) {
|
||||
for (j = WINED3DCUBEMAP_FACE_POSITIVE_X; j <= WINED3DCUBEMAP_FACE_NEGATIVE_Z; ++j) {
|
||||
if(This->baseTexture.is_srgb) {
|
||||
surface_set_texture_name(This->surfaces[j][i], This->baseTexture.srgbTextureName, TRUE);
|
||||
surface_set_texture_name(This->surfaces[j][i], This->baseTexture.texture_srgb.name, TRUE);
|
||||
} else {
|
||||
surface_set_texture_name(This->surfaces[j][i], This->baseTexture.textureName, FALSE);
|
||||
surface_set_texture_name(This->surfaces[j][i], This->baseTexture.texture_rgb.name, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -432,14 +321,6 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture *iface)
|
|||
/* *******************************************
|
||||
IWineD3DCubeTexture IWineD3DCubeTexture parts follow
|
||||
******************************************* */
|
||||
static void WINAPI IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
|
||||
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
|
||||
|
||||
cubetexture_cleanup(This, D3DCB_DestroySurface);
|
||||
/* finally delete the object */
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture *iface, UINT Level, WINED3DSURFACE_DESC* pDesc) {
|
||||
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
|
||||
|
||||
|
@ -506,8 +387,8 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *if
|
|||
static HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface, WINED3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) {
|
||||
HRESULT hr = WINED3DERR_INVALIDCALL;
|
||||
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
|
||||
This->baseTexture.dirty = TRUE;
|
||||
This->baseTexture.srgbDirty = TRUE;
|
||||
This->baseTexture.texture_rgb.dirty = TRUE;
|
||||
This->baseTexture.texture_srgb.dirty = TRUE;
|
||||
TRACE("(%p) : dirtyfication of faceType(%d) Level (0)\n", This, FaceType);
|
||||
if (FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
|
||||
surface_add_dirty_rect(This->surfaces[FaceType][0], pDirtyRect);
|
||||
|
@ -518,8 +399,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture
|
|||
return hr;
|
||||
}
|
||||
|
||||
|
||||
const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
||||
static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DCubeTextureImpl_QueryInterface,
|
||||
|
@ -549,10 +429,127 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
|||
IWineD3DCubeTextureImpl_GetTextureDimensions,
|
||||
IWineD3DCubeTextureImpl_IsCondNP2,
|
||||
/* IWineD3DCubeTexture */
|
||||
IWineD3DCubeTextureImpl_Destroy,
|
||||
IWineD3DCubeTextureImpl_GetLevelDesc,
|
||||
IWineD3DCubeTextureImpl_GetCubeMapSurface,
|
||||
IWineD3DCubeTextureImpl_LockRect,
|
||||
IWineD3DCubeTextureImpl_UnlockRect,
|
||||
IWineD3DCubeTextureImpl_AddDirtyRect
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT pow2_edge_length;
|
||||
unsigned int i, j;
|
||||
UINT tmp_w;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (!gl_info->supported[ARB_TEXTURE_CUBE_MAP] && pool != WINED3DPOOL_SCRATCH)
|
||||
{
|
||||
WARN("(%p) : Tried to create not supported cube texture.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
|
||||
{
|
||||
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(edge_length) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &IWineD3DCubeTexture_Vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_CUBETEXTURE,
|
||||
device, 0, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Find the nearest pow2 match. */
|
||||
pow2_edge_length = 1;
|
||||
while (pow2_edge_length < edge_length) pow2_edge_length <<= 1;
|
||||
|
||||
if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || (edge_length == pow2_edge_length))
|
||||
{
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords. */
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords. */
|
||||
texture->baseTexture.pow2Matrix[0] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[5] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[10] = ((float)edge_length) / ((float)pow2_edge_length);
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
}
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = edge_length;
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Create the 6 faces. */
|
||||
for (j = 0; j < 6; ++j)
|
||||
{
|
||||
static const GLenum cube_targets[6] =
|
||||
{
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
|
||||
};
|
||||
|
||||
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,
|
||||
format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);
|
||||
texture->surfaces[j][i] = NULL;
|
||||
cubetexture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
IWineD3DSurface_SetContainer(texture->surfaces[j][i], (IWineD3DBase *)texture);
|
||||
TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[j][i]);
|
||||
surface_set_texture_target(texture->surfaces[j][i], cube_targets[j]);
|
||||
}
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = cubetexture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2006-2008 Henri Verbeet
|
||||
* Copyright 2007 Andrew Riedi
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -297,7 +298,7 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
|
|||
stream_info->elements[idx].stream_idx = element->input_slot;
|
||||
stream_info->elements[idx].buffer_object = buffer_object;
|
||||
|
||||
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_A8R8G8B8)
|
||||
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
stream_info->swizzle_map |= 1 << idx;
|
||||
}
|
||||
|
@ -359,7 +360,8 @@ void device_stream_info_from_strided(IWineD3DDeviceImpl *This,
|
|||
{
|
||||
if (!stream_info->elements[i].format_desc) continue;
|
||||
|
||||
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && stream_info->elements[i].format_desc->format == WINED3DFMT_A8R8G8B8)
|
||||
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)
|
||||
&& stream_info->elements[i].format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
stream_info->swizzle_map |= 1 << i;
|
||||
}
|
||||
|
@ -441,11 +443,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetParent(IWineD3DDevice *iface, IUnkno
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface,
|
||||
struct wined3d_buffer_desc *desc, const void *data, IUnknown *parent, IWineD3DBuffer **buffer)
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface, struct wined3d_buffer_desc *desc,
|
||||
const void *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DBuffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_UNKNOWN, &This->adapter->gl_info);
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -458,70 +459,37 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface,
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->vtbl = &wined3d_buffer_vtbl;
|
||||
object->desc = *desc;
|
||||
|
||||
FIXME("Ignoring access flags (pool)\n");
|
||||
|
||||
hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, desc->byte_width,
|
||||
desc->usage, format_desc, WINED3DPOOL_MANAGED, parent);
|
||||
hr = buffer_init(object, This, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
|
||||
WINED3DPOOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x\n", hr);
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
object->buffer_type_hint = GL_ARRAY_BUFFER_ARB;
|
||||
object->desc = *desc;
|
||||
|
||||
TRACE("Created resource %p\n", object);
|
||||
|
||||
TRACE("size %#x, usage=%#x, format %s, memory @ %p, iface @ %p\n", object->resource.size, object->resource.usage,
|
||||
debug_d3dformat(object->resource.format_desc->format), object->resource.allocatedMemory, object);
|
||||
|
||||
if (data)
|
||||
{
|
||||
BYTE *ptr;
|
||||
|
||||
hr = IWineD3DBuffer_Map((IWineD3DBuffer *)object, 0, desc->byte_width, &ptr, 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to map buffer, hr %#x\n", hr);
|
||||
IWineD3DBuffer_Release((IWineD3DBuffer *)object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
memcpy(ptr, data, desc->byte_width);
|
||||
|
||||
hr = IWineD3DBuffer_Unmap((IWineD3DBuffer *)object);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Failed to unmap buffer, hr %#x\n", hr);
|
||||
IWineD3DBuffer_Release((IWineD3DBuffer *)object);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
|
||||
*buffer = (IWineD3DBuffer *)object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, DWORD Usage,
|
||||
DWORD FVF, WINED3DPOOL Pool, IWineD3DBuffer **ppVertexBuffer, IUnknown *parent)
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size,
|
||||
DWORD Usage, DWORD FVF, WINED3DPOOL Pool, IWineD3DBuffer **ppVertexBuffer,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
/* Dummy format for now */
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_VERTEXDATA, &This->adapter->gl_info);
|
||||
struct wined3d_buffer *object;
|
||||
int dxVersion = ( (IWineD3DImpl *) This->wineD3D)->dxVersion;
|
||||
HRESULT hr;
|
||||
BOOL conv;
|
||||
|
||||
if(Size == 0) {
|
||||
WARN("Size 0 requested, returning WINED3DERR_INVALIDCALL\n");
|
||||
*ppVertexBuffer = NULL;
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
} else if(Pool == WINED3DPOOL_SCRATCH) {
|
||||
if (Pool == WINED3DPOOL_SCRATCH)
|
||||
{
|
||||
/* The d3d9 testsuit shows that this is not allowed. It doesn't make much sense
|
||||
* anyway, SCRATCH vertex buffers aren't usable anywhere
|
||||
*/
|
||||
|
@ -538,20 +506,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->vtbl = &wined3d_buffer_vtbl;
|
||||
hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, Size, Usage, format_desc, Pool, parent);
|
||||
hr = buffer_init(object, This, Size, Usage, WINED3DFMT_VERTEXDATA,
|
||||
Pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x\n", hr);
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppVertexBuffer = NULL;
|
||||
return hr;
|
||||
}
|
||||
object->buffer_type_hint = GL_ARRAY_BUFFER_ARB;
|
||||
|
||||
TRACE("(%p) : Created resource %p\n", This, object);
|
||||
|
||||
TRACE("(%p) : Size=%d, Usage=0x%08x, FVF=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Size, Usage, FVF, Pool, object->resource.allocatedMemory, object);
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
TRACE("FVF %#x, Pool %#x.\n", FVF, Pool);
|
||||
*ppVertexBuffer = (IWineD3DBuffer *)object;
|
||||
|
||||
/* Observations show that drawStridedSlow is faster on dynamic VBs than converting +
|
||||
|
@ -585,10 +550,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface,
|
||||
UINT Length, DWORD Usage, WINED3DPOOL Pool, IWineD3DBuffer **ppIndexBuffer, IUnknown *parent)
|
||||
UINT Length, DWORD Usage, WINED3DPOOL Pool, IWineD3DBuffer **ppIndexBuffer,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_UNKNOWN, &This->adapter->gl_info);
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -603,25 +568,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->vtbl = &wined3d_buffer_vtbl;
|
||||
hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, Length, Usage, format_desc, Pool, parent);
|
||||
hr = buffer_init(object, This, Length, Usage, WINED3DFMT_UNKNOWN,
|
||||
Pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x\n", hr);
|
||||
WARN("Failed to initialize buffer, hr %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppIndexBuffer = NULL;
|
||||
return hr;
|
||||
}
|
||||
object->buffer_type_hint = GL_ELEMENT_ARRAY_BUFFER_ARB;
|
||||
|
||||
TRACE("(%p) : Created resource %p\n", This, object);
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
|
||||
if(Pool != WINED3DPOOL_SYSTEMMEM && !(Usage & WINED3DUSAGE_DYNAMIC) && GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT)) {
|
||||
object->flags |= WINED3D_BUFFER_CREATEBO;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Len=%d, Use=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Length, Usage,
|
||||
Pool, object, object->resource.allocatedMemory);
|
||||
*ppIndexBuffer = (IWineD3DBuffer *) object;
|
||||
|
||||
return WINED3D_OK;
|
||||
|
@ -900,7 +861,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
|
|||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height,
|
||||
WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface,
|
||||
DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality,
|
||||
WINED3DSURFTYPE Impl, IUnknown *parent)
|
||||
WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DSurfaceImpl *object;
|
||||
|
@ -923,7 +884,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UI
|
|||
}
|
||||
|
||||
hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable,
|
||||
Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent);
|
||||
Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, returning %#x.\n", hr);
|
||||
|
@ -963,8 +924,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
|
||||
UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format,
|
||||
WINED3DPOOL Pool, IWineD3DTexture **ppTexture, IUnknown *parent)
|
||||
UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool,
|
||||
IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DTextureImpl *object;
|
||||
|
@ -982,9 +943,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DTexture_Vtbl;
|
||||
|
||||
hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent);
|
||||
hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x\n", hr);
|
||||
|
@ -1001,8 +960,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *iface,
|
||||
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format,
|
||||
WINED3DPOOL Pool, IWineD3DVolumeTexture **ppVolumeTexture, IUnknown *parent)
|
||||
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool,
|
||||
IWineD3DVolumeTexture **ppVolumeTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVolumeTextureImpl *object;
|
||||
|
@ -1019,8 +978,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DVolumeTexture_Vtbl;
|
||||
hr = volumetexture_init(object, Width, Height, Depth, Levels, This, Usage, Format, Pool, parent);
|
||||
hr = volumetexture_init(object, Width, Height, Depth, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volumetexture, returning %#x\n", hr);
|
||||
|
@ -1035,19 +993,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
|
||||
UINT Width, UINT Height, UINT Depth, DWORD Usage, WINED3DFORMAT Format,
|
||||
WINED3DPOOL Pool, IWineD3DVolume **ppVolume, IUnknown *parent)
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UINT Width, UINT Height,
|
||||
UINT Depth, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DVolume **ppVolume,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVolumeImpl *object; /** NOTE: impl ref allowed since this is a create function **/
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(Format, &GLINFO_LOCATION);
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVolumeImpl *object;
|
||||
HRESULT hr;
|
||||
|
||||
if(!GL_SUPPORT(EXT_TEXTURE3D)) {
|
||||
WARN("(%p) : Volume cannot be created - no volume texture support\n", This);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
|
||||
Depth, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool));
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
|
@ -1057,42 +1012,23 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DVolume_Vtbl;
|
||||
hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_VOLUME, This,
|
||||
Width * Height * Depth * format_desc->byte_count, Usage, format_desc, Pool, parent);
|
||||
hr = volume_init(object, This, Width, Height, Depth, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x\n", hr);
|
||||
WARN("Failed to initialize volume, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*ppVolume = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Created resource %p\n", This, object);
|
||||
|
||||
TRACE("(%p) : Created volume %p.\n", This, object);
|
||||
*ppVolume = (IWineD3DVolume *)object;
|
||||
|
||||
TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
|
||||
Depth, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool));
|
||||
|
||||
object->currentDesc.Width = Width;
|
||||
object->currentDesc.Height = Height;
|
||||
object->currentDesc.Depth = Depth;
|
||||
|
||||
/** Note: Volume textures cannot be dxtn, hence no need to check here **/
|
||||
object->lockable = TRUE;
|
||||
object->locked = FALSE;
|
||||
memset(&object->lockedBox, 0, sizeof(WINED3DBOX));
|
||||
object->dirty = TRUE;
|
||||
|
||||
volume_add_dirty_box((IWineD3DVolume *)object, NULL);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface,
|
||||
UINT EdgeLength, UINT Levels, DWORD Usage, WINED3DFORMAT Format,
|
||||
WINED3DPOOL Pool, IWineD3DCubeTexture **ppCubeTexture, IUnknown *parent)
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength, UINT Levels,
|
||||
DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DCubeTexture **ppCubeTexture,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DCubeTextureImpl *object; /** NOTE: impl ref allowed since this is a create function **/
|
||||
|
@ -1106,8 +1042,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
|
|||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DCubeTexture_Vtbl;
|
||||
hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent);
|
||||
hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize cubetexture, returning %#x\n", hr);
|
||||
|
@ -1342,7 +1277,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
|
|||
HDC hDc;
|
||||
IWineD3DSwapChainImpl *object; /** NOTE: impl ref allowed since this is a create function **/
|
||||
HRESULT hr;
|
||||
IUnknown *bufferParent;
|
||||
BOOL displaymode_set = FALSE;
|
||||
WINED3DDISPLAYMODE Mode;
|
||||
const struct GlPixelFormatDesc *format_desc;
|
||||
|
@ -1603,26 +1537,14 @@ error:
|
|||
if (object->backBuffer) {
|
||||
UINT i;
|
||||
for(i = 0; i < object->presentParms.BackBufferCount; i++) {
|
||||
if(object->backBuffer[i]) {
|
||||
IWineD3DSurface_GetParent(object->backBuffer[i], &bufferParent);
|
||||
IUnknown_Release(bufferParent); /* once for the get parent */
|
||||
if (IUnknown_Release(bufferParent) > 0) {
|
||||
FIXME("(%p) Something's still holding the back buffer\n",This);
|
||||
}
|
||||
}
|
||||
if (object->backBuffer[i]) IWineD3DSurface_Release(object->backBuffer[i]);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, object->backBuffer);
|
||||
object->backBuffer = NULL;
|
||||
}
|
||||
if(object->context && object->context[0])
|
||||
DestroyContext(This, object->context[0]);
|
||||
if(object->frontBuffer) {
|
||||
IWineD3DSurface_GetParent(object->frontBuffer, &bufferParent);
|
||||
IUnknown_Release(bufferParent); /* once for the get parent */
|
||||
if (IUnknown_Release(bufferParent) > 0) {
|
||||
FIXME("(%p) Something's still holding the front buffer\n",This);
|
||||
}
|
||||
}
|
||||
if (object->frontBuffer) IWineD3DSurface_Release(object->frontBuffer);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
@ -1651,41 +1573,36 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface, U
|
|||
}
|
||||
}
|
||||
|
||||
/*****
|
||||
* Vertex Declaration
|
||||
*****/
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration,
|
||||
IUnknown *parent, const WINED3DVERTEXELEMENT *elements, UINT element_count) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice *iface,
|
||||
IWineD3DVertexDeclaration **declaration, IUnknown *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVertexDeclarationImpl *object = NULL;
|
||||
HRESULT hr = WINED3D_OK;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : directXVersion %u, elements %p, element_count %d, ppDecl=%p\n",
|
||||
This, ((IWineD3DImpl *)This->wineD3D)->dxVersion, elements, element_count, ppVertexDeclaration);
|
||||
TRACE("iface %p, declaration %p, parent %p, elements %p, element_count %u.\n",
|
||||
iface, declaration, parent, elements, element_count);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if(!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*ppVertexDeclaration = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
ERR("Failed to allocate vertex declaration memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DVertexDeclaration_Vtbl;
|
||||
object->wineD3DDevice = This;
|
||||
object->parent = parent;
|
||||
object->ref = 1;
|
||||
|
||||
*ppVertexDeclaration = (IWineD3DVertexDeclaration *)object;
|
||||
|
||||
hr = vertexdeclaration_init(object, elements, element_count);
|
||||
|
||||
if(FAILED(hr)) {
|
||||
IWineD3DVertexDeclaration_Release((IWineD3DVertexDeclaration *)object);
|
||||
*ppVertexDeclaration = NULL;
|
||||
hr = vertexdeclaration_init(object, This, elements, element_count, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return hr;
|
||||
TRACE("Created verrtex declaration %p.\n", object);
|
||||
*declaration = (IWineD3DVertexDeclaration *)object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the GL info, which has the type table */
|
||||
|
@ -1739,7 +1656,7 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
|
|||
}
|
||||
if (has_blend && (num_blends > 0)) {
|
||||
if (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))
|
||||
elements[idx].format = WINED3DFMT_A8R8G8B8;
|
||||
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
else {
|
||||
switch(num_blends) {
|
||||
case 1: elements[idx].format = WINED3DFMT_R32_FLOAT; break;
|
||||
|
@ -1759,7 +1676,7 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
|
|||
(((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)))
|
||||
elements[idx].format = WINED3DFMT_R8G8B8A8_UINT;
|
||||
else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)
|
||||
elements[idx].format = WINED3DFMT_A8R8G8B8;
|
||||
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
else
|
||||
elements[idx].format = WINED3DFMT_R32_FLOAT;
|
||||
elements[idx].usage = WINED3DDECLUSAGE_BLENDINDICES;
|
||||
|
@ -1779,13 +1696,13 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
|
|||
idx++;
|
||||
}
|
||||
if (has_diffuse) {
|
||||
elements[idx].format = WINED3DFMT_A8R8G8B8;
|
||||
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
elements[idx].usage = WINED3DDECLUSAGE_COLOR;
|
||||
elements[idx].usage_idx = 0;
|
||||
idx++;
|
||||
}
|
||||
if (has_specular) {
|
||||
elements[idx].format = WINED3DFMT_A8R8G8B8;
|
||||
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
|
||||
elements[idx].usage = WINED3DDECLUSAGE_COLOR;
|
||||
elements[idx].usage_idx = 1;
|
||||
idx++;
|
||||
|
@ -1825,96 +1742,83 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
|
|||
return size;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration, IUnknown *Parent, DWORD Fvf) {
|
||||
WINED3DVERTEXELEMENT* elements = NULL;
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice *iface,
|
||||
IWineD3DVertexDeclaration **declaration, IUnknown *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, DWORD fvf)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
WINED3DVERTEXELEMENT *elements;
|
||||
unsigned int size;
|
||||
DWORD hr;
|
||||
|
||||
size = ConvertFvfToDeclaration(This, Fvf, &elements);
|
||||
if (size == ~0U) return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
TRACE("iface %p, declaration %p, parent %p, fvf %#x.\n", iface, declaration, parent, fvf);
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(iface, ppVertexDeclaration, Parent, elements, size);
|
||||
size = ConvertFvfToDeclaration(This, fvf, &elements);
|
||||
if (size == ~0U) return E_OUTOFMEMORY;
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(iface, declaration, parent, parent_ops, elements, size);
|
||||
HeapFree(GetProcessHeap(), 0, elements);
|
||||
if (hr != S_OK) return hr;
|
||||
|
||||
return WINED3D_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature,
|
||||
IWineD3DVertexShader **ppVertexShader, IUnknown *parent)
|
||||
IWineD3DVertexShader **ppVertexShader, IUnknown *parent,
|
||||
const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVertexShaderImpl *object; /* NOTE: impl usage is ok, this is a create */
|
||||
HRESULT hr = WINED3D_OK;
|
||||
|
||||
if (!pFunction) return WINED3DERR_INVALIDCALL;
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVertexShaderImpl *object;
|
||||
HRESULT hr;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*ppVertexShader = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DVertexShader_Vtbl;
|
||||
object->parent = parent;
|
||||
shader_init(&object->baseShader, iface);
|
||||
list_add_head(&This->shaders, &object->baseShader.shader_list_entry);
|
||||
*ppVertexShader = (IWineD3DVertexShader *)object;
|
||||
|
||||
TRACE("(%p) : Created vertex shader %p\n", This, *ppVertexShader);
|
||||
|
||||
hr = IWineD3DVertexShader_SetFunction(*ppVertexShader, pFunction, output_signature);
|
||||
hr = vertexshader_init(object, This, pFunction, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("(%p) : Failed to set function, returning %#x\n", iface, hr);
|
||||
IWineD3DVertexShader_Release(*ppVertexShader);
|
||||
*ppVertexShader = NULL;
|
||||
WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return hr;
|
||||
TRACE("Created vertex shader %p.\n", object);
|
||||
*ppVertexShader = (IWineD3DVertexShader *)object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature,
|
||||
IWineD3DPixelShader **ppPixelShader, IUnknown *parent)
|
||||
IWineD3DPixelShader **ppPixelShader, IUnknown *parent,
|
||||
const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DPixelShaderImpl *object; /* NOTE: impl allowed, this is a create */
|
||||
HRESULT hr = WINED3D_OK;
|
||||
|
||||
if (!pFunction) return WINED3DERR_INVALIDCALL;
|
||||
IWineD3DPixelShaderImpl *object;
|
||||
HRESULT hr;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*ppPixelShader = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
object->lpVtbl = &IWineD3DPixelShader_Vtbl;
|
||||
object->parent = parent;
|
||||
shader_init(&object->baseShader, iface);
|
||||
list_add_head(&This->shaders, &object->baseShader.shader_list_entry);
|
||||
*ppPixelShader = (IWineD3DPixelShader *)object;
|
||||
|
||||
TRACE("(%p) : Created pixel shader %p\n", This, *ppPixelShader);
|
||||
|
||||
hr = IWineD3DPixelShader_SetFunction(*ppPixelShader, pFunction, output_signature);
|
||||
hr = pixelshader_init(object, This, pFunction, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("(%p) : Failed to set function, returning %#x\n", iface, hr);
|
||||
IWineD3DPixelShader_Release(*ppPixelShader);
|
||||
*ppPixelShader = NULL;
|
||||
WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return hr;
|
||||
TRACE("Created pixel shader %p.\n", object);
|
||||
*ppPixelShader = (IWineD3DPixelShader *)object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DWORD Flags,
|
||||
|
@ -1981,8 +1885,9 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi
|
|||
bm.bmHeight = 32;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5, TRUE,
|
||||
FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL);
|
||||
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE,
|
||||
FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL,
|
||||
NULL, &wined3d_null_parent_ops);
|
||||
if(FAILED(hr)) {
|
||||
ERR("Wine logo requested, but failed to create surface\n");
|
||||
goto out;
|
||||
|
@ -2286,8 +2191,12 @@ static HRESULT WINAPI device_unload_resource(IWineD3DResource *resource, void *c
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyDepthStencilSurface, D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain) {
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
|
||||
D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
const struct wined3d_context *context;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
int sampler;
|
||||
UINT i;
|
||||
TRACE("(%p)\n", This);
|
||||
|
@ -2297,7 +2206,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
|
|||
/* I don't think that the interface guarantees that the device is destroyed from the same thread
|
||||
* it was created. Thus make sure a context is active for the glDelete* calls
|
||||
*/
|
||||
ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
if(This->logo_surface) IWineD3DSurface_Release(This->logo_surface);
|
||||
|
||||
|
@ -2351,7 +2261,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
|
|||
}
|
||||
if (This->depth_blt_rb) {
|
||||
ENTER_GL();
|
||||
GL_EXTCALL(glDeleteRenderbuffersEXT(1, &This->depth_blt_rb));
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers(1, &This->depth_blt_rb);
|
||||
LEAVE_GL();
|
||||
This->depth_blt_rb = 0;
|
||||
This->depth_blt_rb_w = 0;
|
||||
|
@ -2398,7 +2308,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
|
|||
This->render_targets[0] = NULL;
|
||||
|
||||
if (This->auto_depth_stencil_buffer) {
|
||||
if(D3DCB_DestroyDepthStencilSurface(This->auto_depth_stencil_buffer) > 0) {
|
||||
if (IWineD3DSurface_Release(This->auto_depth_stencil_buffer) > 0)
|
||||
{
|
||||
FIXME("(%p) Something's still holding the auto depth stencil buffer\n", This);
|
||||
}
|
||||
This->auto_depth_stencil_buffer = NULL;
|
||||
|
@ -3154,8 +3065,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetMaterial(IWineD3DDevice *iface, WINE
|
|||
/*****
|
||||
* Get / Set Indices
|
||||
*****/
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWineD3DBuffer* pIndexData, WINED3DFORMAT fmt) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_SetIndexBuffer(IWineD3DDevice *iface,
|
||||
IWineD3DBuffer *pIndexData, WINED3DFORMAT fmt)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DBuffer *oldIdxs;
|
||||
|
||||
TRACE("(%p) : Setting to %p\n", This, pIndexData);
|
||||
|
@ -3188,7 +3101,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWineD3DBuffer** ppIndexData) {
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_GetIndexBuffer(IWineD3DDevice *iface, IWineD3DBuffer **ppIndexData)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
*ppIndexData = This->stateBlock->pIndexData;
|
||||
|
@ -5143,13 +5057,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, UI
|
|||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
|
||||
}
|
||||
/* Account for the loading offset due to index buffers. Instead of reloading all sources correct it with the startvertex parameter */
|
||||
drawPrimitive(iface, vertex_count, 0/* NumVertices */, StartVertex /* start_idx */,
|
||||
0 /* indxSize */, NULL /* indxData */, 0 /* minIndex */);
|
||||
drawPrimitive(iface, vertex_count, StartVertex /* start_idx */, 0 /* indxSize */, NULL /* indxData */);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface,
|
||||
UINT minIndex, UINT NumVertices, UINT startIndex, UINT index_count)
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface, UINT startIndex, UINT index_count)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
UINT idxStride = 2;
|
||||
|
@ -5177,8 +5089,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *if
|
|||
}
|
||||
vbo = ((struct wined3d_buffer *) pIB)->buffer_object;
|
||||
|
||||
TRACE("(%p) : min %u, vertex count %u, startIdx %u, index count %u\n",
|
||||
This, minIndex, NumVertices, startIndex, index_count);
|
||||
TRACE("(%p) : startIndex %u, index count %u.\n", This, startIndex, index_count);
|
||||
|
||||
if (This->stateBlock->IndexFmt == WINED3DFMT_R16_UINT) {
|
||||
idxStride = 2;
|
||||
|
@ -5191,8 +5102,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *if
|
|||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
|
||||
}
|
||||
|
||||
drawPrimitive(iface, index_count, NumVertices, startIndex, idxStride,
|
||||
vbo ? NULL : ((struct wined3d_buffer *) pIB)->resource.allocatedMemory, minIndex);
|
||||
drawPrimitive(iface, index_count, startIndex, idxStride,
|
||||
vbo ? NULL : ((struct wined3d_buffer *)pIB)->resource.allocatedMemory);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -5223,8 +5134,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface,
|
|||
/* TODO: Only mark dirty if drawing from a different UP address */
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
|
||||
|
||||
drawPrimitive(iface, vertex_count, 0 /* NumVertices */, 0 /* start_idx */,
|
||||
0 /* indxSize*/, NULL /* indxData */, 0 /* indxMin */);
|
||||
drawPrimitive(iface, vertex_count, 0 /* start_idx */, 0 /* indxSize*/, NULL /* indxData */);
|
||||
|
||||
/* MSDN specifies stream zero settings must be set to NULL */
|
||||
This->stateBlock->streamStride[0] = 0;
|
||||
|
@ -5236,8 +5146,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface,
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface, UINT MinVertexIndex,
|
||||
UINT NumVertices, UINT index_count, const void *pIndexData, WINED3DFORMAT IndexDataFormat,
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface,
|
||||
UINT index_count, const void *pIndexData, WINED3DFORMAT IndexDataFormat,
|
||||
const void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
|
||||
{
|
||||
int idxStride;
|
||||
|
@ -5245,9 +5155,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
|
|||
IWineD3DBuffer *vb;
|
||||
IWineD3DBuffer *ib;
|
||||
|
||||
TRACE("(%p) : MinVtxIdx %u, NumVIdx %u, index count %u, pidxdata %p, IdxFmt %u, pVtxdata %p, stride=%u\n",
|
||||
This, MinVertexIndex, NumVertices, index_count, pIndexData,
|
||||
IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
TRACE("(%p) : index count %u, pidxdata %p, IdxFmt %u, pVtxdata %p, stride=%u.\n",
|
||||
This, index_count, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
|
||||
if(!This->stateBlock->vertexDecl) {
|
||||
WARN("(%p) : Called without a valid vertex declaration set\n", This);
|
||||
|
@ -5275,8 +5184,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
|
|||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL);
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
|
||||
|
||||
drawPrimitive(iface, index_count, NumVertices, 0 /* start_idx */,
|
||||
idxStride, pIndexData, MinVertexIndex);
|
||||
drawPrimitive(iface, index_count, 0 /* start_idx */, idxStride, pIndexData);
|
||||
|
||||
/* MSDN specifies stream zero settings and index buffer must be set to NULL */
|
||||
This->stateBlock->streamSource[0] = NULL;
|
||||
|
@ -5306,7 +5214,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided(IWineD3DDevice *if
|
|||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
|
||||
This->stateBlock->baseVertexIndex = 0;
|
||||
This->up_strided = DrawPrimStrideData;
|
||||
drawPrimitive(iface, vertex_count, 0, 0, 0, NULL, 0);
|
||||
drawPrimitive(iface, vertex_count, 0, 0, NULL);
|
||||
This->up_strided = NULL;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -5327,7 +5235,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveStrided(IWineD3DDev
|
|||
This->stateBlock->streamIsUP = TRUE;
|
||||
This->stateBlock->baseVertexIndex = 0;
|
||||
This->up_strided = DrawPrimStrideData;
|
||||
drawPrimitive(iface, vertex_count, 0 /* numindices */, 0 /* start_idx */, idxSize, pIndexData, 0 /* minindex */);
|
||||
drawPrimitive(iface, 0 /* numindices */, 0 /* start_idx */, idxSize, pIndexData);
|
||||
This->up_strided = NULL;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -5550,14 +5458,15 @@ static void dirtify_p8_texture_samplers(IWineD3DDeviceImpl *device)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_COMBINED_SAMPLERS; i++) {
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i];
|
||||
if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| texture->resource.format_desc->format == WINED3DFMT_A8P8))
|
||||
{
|
||||
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i));
|
||||
}
|
||||
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i];
|
||||
if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| texture->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM))
|
||||
{
|
||||
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_SetPaletteEntries(IWineD3DDevice *iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
|
||||
|
@ -6035,7 +5944,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
|
|||
|
||||
context = ActivateContext(This, surface, CTXUSAGE_RESOURCELOAD);
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
buffer = surface_get_gl_buffer(surface, swapchain);
|
||||
glDrawBuffer(buffer);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
|
@ -6044,9 +5953,9 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
|
|||
|
||||
context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER_EXT, 0, surface);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, NULL, FALSE);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, surface);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE);
|
||||
}
|
||||
|
||||
if (rect) {
|
||||
|
@ -6087,8 +5996,9 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
unsigned int r, g, b, a;
|
||||
DWORD ret;
|
||||
|
||||
if(destfmt == WINED3DFMT_A8R8G8B8 || destfmt == WINED3DFMT_X8R8G8B8 ||
|
||||
destfmt == WINED3DFMT_R8G8B8)
|
||||
if (destfmt == WINED3DFMT_B8G8R8A8_UNORM
|
||||
|| destfmt == WINED3DFMT_B8G8R8X8_UNORM
|
||||
|| destfmt == WINED3DFMT_B8G8R8_UNORM)
|
||||
return color;
|
||||
|
||||
TRACE("Converting color %08x to format %s\n", color, debug_d3dformat(destfmt));
|
||||
|
@ -6100,7 +6010,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
|
||||
switch(destfmt)
|
||||
{
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
if(r == 0xff && g == 0xff && b == 0xff) return 0xffff;
|
||||
r = (r * 32) / 256;
|
||||
g = (g * 64) / 256;
|
||||
|
@ -6111,8 +6021,8 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
TRACE("Returning %08x\n", ret);
|
||||
return ret;
|
||||
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
a = (a * 2) / 256;
|
||||
r = (r * 32) / 256;
|
||||
g = (g * 32) / 256;
|
||||
|
@ -6128,8 +6038,8 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
TRACE("Returning %08x\n", a);
|
||||
return a;
|
||||
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
a = (a * 16) / 256;
|
||||
r = (r * 16) / 256;
|
||||
g = (g * 16) / 256;
|
||||
|
@ -6141,7 +6051,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
TRACE("Returning %08x\n", ret);
|
||||
return ret;
|
||||
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
r = (r * 8) / 256;
|
||||
g = (g * 8) / 256;
|
||||
b = (b * 4) / 256;
|
||||
|
@ -6151,7 +6061,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
TRACE("Returning %08x\n", ret);
|
||||
return ret;
|
||||
|
||||
case WINED3DFMT_X8B8G8R8:
|
||||
case WINED3DFMT_R8G8B8X8_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
ret = a << 24;
|
||||
ret |= b << 16;
|
||||
|
@ -6160,7 +6070,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
|
|||
TRACE("Returning %08x\n", ret);
|
||||
return ret;
|
||||
|
||||
case WINED3DFMT_A2R10G10B10:
|
||||
case WINED3DFMT_B10G10R10A2_UNORM:
|
||||
a = (a * 4) / 256;
|
||||
r = (r * 1024) / 256;
|
||||
g = (g * 1024) / 256;
|
||||
|
@ -6403,6 +6313,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
|||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */
|
||||
IWineD3DSwapChain *src_swapchain, *dst_swapchain;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
GLenum gl_filter;
|
||||
POINT offset = {0, 0};
|
||||
|
@ -6433,6 +6344,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
|||
else if (dst_swapchain) context = ActivateContext(This, dst_surface, CTXUSAGE_RESOURCELOAD);
|
||||
else context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
|
||||
gl_info = context->gl_info;
|
||||
|
||||
if (src_swapchain) {
|
||||
GLenum buffer = surface_get_gl_buffer(src_surface, src_swapchain);
|
||||
|
||||
|
@ -6456,17 +6369,17 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
|||
}
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_READ_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_READ_FRAMEBUFFER, NULL);
|
||||
glReadBuffer(buffer);
|
||||
checkGLcall("glReadBuffer()");
|
||||
} else {
|
||||
TRACE("Source surface %p is offscreen\n", src_surface);
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_READ_FRAMEBUFFER_EXT, &context->src_fbo);
|
||||
context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER_EXT, 0, src_surface);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo);
|
||||
context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, src_surface);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
checkGLcall("glReadBuffer()");
|
||||
context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER_EXT, NULL, FALSE);
|
||||
context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
|
||||
}
|
||||
LEAVE_GL();
|
||||
|
||||
|
@ -6495,29 +6408,29 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
|||
}
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, NULL);
|
||||
glDrawBuffer(buffer);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
} else {
|
||||
TRACE("Destination surface %p is offscreen\n", dst_surface);
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER_EXT, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER_EXT, 0, dst_surface);
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, &context->dst_fbo);
|
||||
context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, dst_surface);
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER_EXT, NULL, FALSE);
|
||||
context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER, NULL, FALSE);
|
||||
}
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
|
||||
|
||||
if (flip) {
|
||||
GL_EXTCALL(glBlitFramebufferEXT(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,
|
||||
dst_rect->x1, dst_rect->y2, dst_rect->x2, dst_rect->y1, mask, gl_filter));
|
||||
gl_info->fbo_ops.glBlitFramebuffer(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,
|
||||
dst_rect->x1, dst_rect->y2, dst_rect->x2, dst_rect->y1, mask, gl_filter);
|
||||
checkGLcall("glBlitFramebuffer()");
|
||||
} else {
|
||||
GL_EXTCALL(glBlitFramebufferEXT(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,
|
||||
dst_rect->x1, dst_rect->y1, dst_rect->x2, dst_rect->y2, mask, gl_filter));
|
||||
gl_info->fbo_ops.glBlitFramebuffer(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,
|
||||
dst_rect->x1, dst_rect->y1, dst_rect->x2, dst_rect->y2, mask, gl_filter);
|
||||
checkGLcall("glBlitFramebuffer()");
|
||||
}
|
||||
|
||||
|
@ -6653,7 +6566,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
|
|||
WINED3DLOCKED_RECT rect;
|
||||
|
||||
/* MSDN: Cursor must be A8R8G8B8 */
|
||||
if (WINED3DFMT_A8R8G8B8 != pSur->resource.format_desc->format)
|
||||
if (pSur->resource.format_desc->format != WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
ERR("(%p) : surface(%p) has an invalid format\n", This, pCursorBitmap);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
@ -6679,7 +6592,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
|
|||
This->cursorHeight = pSur->currentDesc.Height;
|
||||
if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY)))
|
||||
{
|
||||
const struct GlPixelFormatDesc *glDesc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &GLINFO_LOCATION);
|
||||
const struct GlPixelFormatDesc *glDesc =
|
||||
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &GLINFO_LOCATION);
|
||||
char *mem, *bits = rect.pBits;
|
||||
GLint intfmt = glDesc->glInternal;
|
||||
GLint format = glDesc->glFormat;
|
||||
|
@ -6961,10 +6875,13 @@ static BOOL is_display_mode_supported(IWineD3DDeviceImpl *This, const WINED3DPRE
|
|||
void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain_iface) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *) swapchain_iface;
|
||||
const struct wined3d_context *context;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
UINT i;
|
||||
IWineD3DBaseShaderImpl *shader;
|
||||
|
||||
ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
IWineD3DDevice_EnumResources(iface, reset_unload_resources, NULL);
|
||||
LIST_FOR_EACH_ENTRY(shader, &This->shaders, IWineD3DBaseShaderImpl, baseShader.shader_list_entry) {
|
||||
|
@ -6977,7 +6894,7 @@ void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain_
|
|||
This->depth_blt_texture = 0;
|
||||
}
|
||||
if (This->depth_blt_rb) {
|
||||
GL_EXTCALL(glDeleteRenderbuffersEXT(1, &This->depth_blt_rb));
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers(1, &This->depth_blt_rb);
|
||||
This->depth_blt_rb = 0;
|
||||
This->depth_blt_rb_w = 0;
|
||||
This->depth_blt_rb_h = 0;
|
||||
|
@ -7140,6 +7057,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
|
|||
else
|
||||
IWineD3DDevice_SetDepthStencilSurface(iface, NULL);
|
||||
|
||||
TRACE("Resetting stateblock\n");
|
||||
IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock);
|
||||
IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock);
|
||||
|
||||
delete_opengl_contexts(iface, (IWineD3DSwapChain *) swapchain);
|
||||
|
||||
if(pPresentationParameters->Windowed) {
|
||||
|
@ -7214,10 +7135,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
|
|||
This->exStyle = exStyle;
|
||||
}
|
||||
|
||||
TRACE("Resetting stateblock\n");
|
||||
IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock);
|
||||
IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock);
|
||||
|
||||
/* Note: No parent needed for initial internal stateblock */
|
||||
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock, NULL);
|
||||
if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr);
|
||||
|
@ -7483,8 +7400,8 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
|
|||
IWineD3DDeviceImpl_GetDepthStencilSurface,
|
||||
IWineD3DDeviceImpl_SetGammaRamp,
|
||||
IWineD3DDeviceImpl_GetGammaRamp,
|
||||
IWineD3DDeviceImpl_SetIndices,
|
||||
IWineD3DDeviceImpl_GetIndices,
|
||||
IWineD3DDeviceImpl_SetIndexBuffer,
|
||||
IWineD3DDeviceImpl_GetIndexBuffer,
|
||||
IWineD3DDeviceImpl_SetBaseVertexIndex,
|
||||
IWineD3DDeviceImpl_GetBaseVertexIndex,
|
||||
IWineD3DDeviceImpl_SetLight,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -61,6 +62,7 @@ static const struct {
|
|||
{"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS, 0 },
|
||||
{"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM, 0 },
|
||||
{"GL_ARB_fragment_shader", ARB_FRAGMENT_SHADER, 0 },
|
||||
{"GL_ARB_framebuffer_object", ARB_FRAMEBUFFER_OBJECT, 0 },
|
||||
{"GL_ARB_geometry_shader4", ARB_GEOMETRY_SHADER4, 0 },
|
||||
{"GL_ARB_half_float_pixel", ARB_HALF_FLOAT_PIXEL, 0 },
|
||||
{"GL_ARB_imaging", ARB_IMAGING, 0 },
|
||||
|
@ -70,6 +72,7 @@ static const struct {
|
|||
{"GL_ARB_pixel_buffer_object", ARB_PIXEL_BUFFER_OBJECT, 0 },
|
||||
{"GL_ARB_point_parameters", ARB_POINT_PARAMETERS, 0 },
|
||||
{"GL_ARB_point_sprite", ARB_POINT_SPRITE, 0 },
|
||||
{"GL_ARB_provoking_vertex", ARB_PROVOKING_VERTEX, 0 },
|
||||
{"GL_ARB_texture_border_clamp", ARB_TEXTURE_BORDER_CLAMP, 0 },
|
||||
{"GL_ARB_texture_compression", ARB_TEXTURE_COMPRESSION, 0 },
|
||||
{"GL_ARB_texture_cube_map", ARB_TEXTURE_CUBE_MAP, 0 },
|
||||
|
@ -376,11 +379,9 @@ static ULONG WINAPI IWineD3DImpl_Release(IWineD3D *iface) {
|
|||
return ref;
|
||||
}
|
||||
|
||||
/* Set the shader type for this device, depending on the given capabilities,
|
||||
* the device type, and the user preferences in wined3d_settings */
|
||||
|
||||
static void select_shader_mode(const struct wined3d_gl_info *gl_info,
|
||||
WINED3DDEVTYPE DeviceType, int *ps_selected, int *vs_selected)
|
||||
/* Set the shader type for this device, depending on the given capabilities
|
||||
* and the user preferences in wined3d_settings. */
|
||||
static void select_shader_mode(const struct wined3d_gl_info *gl_info, int *ps_selected, int *vs_selected)
|
||||
{
|
||||
if (wined3d_settings.vs_mode == VS_NONE) {
|
||||
*vs_selected = SHADER_NONE;
|
||||
|
@ -789,7 +790,7 @@ struct driver_quirk
|
|||
const char *description;
|
||||
};
|
||||
|
||||
struct driver_quirk quirk_table[] =
|
||||
static const struct driver_quirk quirk_table[] =
|
||||
{
|
||||
{
|
||||
match_ati_r300_to_500,
|
||||
|
@ -987,7 +988,8 @@ static GL_Vendors wined3d_guess_vendor(const char *gl_vendor, const char *gl_ren
|
|||
return VENDOR_INTEL;
|
||||
|
||||
if (strstr(gl_vendor, "Mesa")
|
||||
|| strstr(gl_vendor, "Tungsten Graphics, Inc."))
|
||||
|| strstr(gl_vendor, "DRI R300 Project")
|
||||
|| strstr(gl_vendor, "Tungsten Graphics, Inc"))
|
||||
return VENDOR_MESA;
|
||||
|
||||
FIXME_(d3d_caps)("Received unrecognized GL_VENDOR %s. Returning VENDOR_WINE.\n", debugstr_a(gl_vendor));
|
||||
|
@ -1872,10 +1874,63 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
|
|||
* shaders), but 8 texture stages (register combiners). */
|
||||
gl_info->max_sampler_stages = max(gl_info->max_fragment_samplers, gl_info->max_texture_stages);
|
||||
|
||||
/* We can only use ORM_FBO when the hardware supports it. */
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) {
|
||||
WARN_(d3d_caps)("GL_EXT_framebuffer_object not supported, falling back to backbuffer offscreen rendering mode.\n");
|
||||
wined3d_settings.offscreen_rendering_mode = ORM_BACKBUFFER;
|
||||
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])
|
||||
{
|
||||
gl_info->fbo_ops.glIsRenderbuffer = gl_info->glIsRenderbuffer;
|
||||
gl_info->fbo_ops.glBindRenderbuffer = gl_info->glBindRenderbuffer;
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->glDeleteRenderbuffers;
|
||||
gl_info->fbo_ops.glGenRenderbuffers = gl_info->glGenRenderbuffers;
|
||||
gl_info->fbo_ops.glRenderbufferStorage = gl_info->glRenderbufferStorage;
|
||||
gl_info->fbo_ops.glRenderbufferStorageMultisample = gl_info->glRenderbufferStorageMultisample;
|
||||
gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->glGetRenderbufferParameteriv;
|
||||
gl_info->fbo_ops.glIsFramebuffer = gl_info->glIsFramebuffer;
|
||||
gl_info->fbo_ops.glBindFramebuffer = gl_info->glBindFramebuffer;
|
||||
gl_info->fbo_ops.glDeleteFramebuffers = gl_info->glDeleteFramebuffers;
|
||||
gl_info->fbo_ops.glGenFramebuffers = gl_info->glGenFramebuffers;
|
||||
gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->glCheckFramebufferStatus;
|
||||
gl_info->fbo_ops.glFramebufferTexture1D = gl_info->glFramebufferTexture1D;
|
||||
gl_info->fbo_ops.glFramebufferTexture2D = gl_info->glFramebufferTexture2D;
|
||||
gl_info->fbo_ops.glFramebufferTexture3D = gl_info->glFramebufferTexture3D;
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->glFramebufferRenderbuffer;
|
||||
gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv = gl_info->glGetFramebufferAttachmentParameteriv;
|
||||
gl_info->fbo_ops.glBlitFramebuffer = gl_info->glBlitFramebuffer;
|
||||
gl_info->fbo_ops.glGenerateMipmap = gl_info->glGenerateMipmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl_info->supported[EXT_FRAMEBUFFER_OBJECT])
|
||||
{
|
||||
gl_info->fbo_ops.glIsRenderbuffer = gl_info->glIsRenderbufferEXT;
|
||||
gl_info->fbo_ops.glBindRenderbuffer = gl_info->glBindRenderbufferEXT;
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->glDeleteRenderbuffersEXT;
|
||||
gl_info->fbo_ops.glGenRenderbuffers = gl_info->glGenRenderbuffersEXT;
|
||||
gl_info->fbo_ops.glRenderbufferStorage = gl_info->glRenderbufferStorageEXT;
|
||||
gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->glGetRenderbufferParameterivEXT;
|
||||
gl_info->fbo_ops.glIsFramebuffer = gl_info->glIsFramebufferEXT;
|
||||
gl_info->fbo_ops.glBindFramebuffer = gl_info->glBindFramebufferEXT;
|
||||
gl_info->fbo_ops.glDeleteFramebuffers = gl_info->glDeleteFramebuffersEXT;
|
||||
gl_info->fbo_ops.glGenFramebuffers = gl_info->glGenFramebuffersEXT;
|
||||
gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->glCheckFramebufferStatusEXT;
|
||||
gl_info->fbo_ops.glFramebufferTexture1D = gl_info->glFramebufferTexture1DEXT;
|
||||
gl_info->fbo_ops.glFramebufferTexture2D = gl_info->glFramebufferTexture2DEXT;
|
||||
gl_info->fbo_ops.glFramebufferTexture3D = gl_info->glFramebufferTexture3DEXT;
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->glFramebufferRenderbufferEXT;
|
||||
gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv = gl_info->glGetFramebufferAttachmentParameterivEXT;
|
||||
gl_info->fbo_ops.glGenerateMipmap = gl_info->glGenerateMipmapEXT;
|
||||
}
|
||||
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||
{
|
||||
WARN_(d3d_caps)("Framebuffer objects not supported, falling back to backbuffer offscreen rendering mode.\n");
|
||||
wined3d_settings.offscreen_rendering_mode = ORM_BACKBUFFER;
|
||||
}
|
||||
if (gl_info->supported[EXT_FRAMEBUFFER_BLIT])
|
||||
{
|
||||
gl_info->fbo_ops.glBlitFramebuffer = gl_info->glBlitFramebufferEXT;
|
||||
}
|
||||
if (gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE])
|
||||
{
|
||||
gl_info->fbo_ops.glRenderbufferStorageMultisample = gl_info->glRenderbufferStorageMultisampleEXT;
|
||||
}
|
||||
}
|
||||
|
||||
/* MRTs are currently only supported when FBOs are used. */
|
||||
|
@ -2021,15 +2076,15 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
|
|||
if (mode.dmBitsPerPel == 32 || mode.dmBitsPerPel == 16) ++i;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
if (mode.dmBitsPerPel == 32) ++i;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
if (mode.dmBitsPerPel == 16) ++i;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
if (mode.dmBitsPerPel == 8) ++i;
|
||||
break;
|
||||
|
||||
|
@ -2081,13 +2136,13 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
|
|||
if (DevModeW.dmBitsPerPel == 32 ||
|
||||
DevModeW.dmBitsPerPel == 16) i++;
|
||||
break;
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
if (DevModeW.dmBitsPerPel == 32) i++;
|
||||
break;
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
if (DevModeW.dmBitsPerPel == 16) i++;
|
||||
break;
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
if (DevModeW.dmBitsPerPel == 8) i++;
|
||||
break;
|
||||
default:
|
||||
|
@ -2312,7 +2367,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const struct wined3
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if ((format_desc->format == WINED3DFMT_D16_LOCKABLE) || (format_desc->format == WINED3DFMT_D32F_LOCKABLE))
|
||||
if ((format_desc->format == WINED3DFMT_D16_LOCKABLE) || (format_desc->format == WINED3DFMT_D32_FLOAT))
|
||||
lockable = TRUE;
|
||||
|
||||
/* On some modern cards like the Geforce8/9 GLX doesn't offer some dephthstencil formats which D3D9 reports.
|
||||
|
@ -2495,10 +2550,10 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter
|
|||
* At the moment we assume that fullscreen and windowed have the same capabilities */
|
||||
|
||||
/* There are only 4 display formats */
|
||||
if(!((DisplayFormat == WINED3DFMT_R5G6B5) ||
|
||||
(DisplayFormat == WINED3DFMT_X1R5G5B5) ||
|
||||
(DisplayFormat == WINED3DFMT_X8R8G8B8) ||
|
||||
(DisplayFormat == WINED3DFMT_A2R10G10B10)))
|
||||
if (!(DisplayFormat == WINED3DFMT_B5G6R5_UNORM
|
||||
|| DisplayFormat == WINED3DFMT_B5G5R5X1_UNORM
|
||||
|| DisplayFormat == WINED3DFMT_B8G8R8X8_UNORM
|
||||
|| DisplayFormat == WINED3DFMT_B10G10R10A2_UNORM))
|
||||
{
|
||||
TRACE_(d3d_caps)("Format %s unsupported as display format\n", debug_d3dformat(DisplayFormat));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
|
@ -2518,25 +2573,32 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter
|
|||
}
|
||||
|
||||
/* In FULLSCREEN mode R5G6B5 can only be mixed with backbuffer format R5G6B5 */
|
||||
if( (DisplayFormat == WINED3DFMT_R5G6B5) && (BackBufferFormat != WINED3DFMT_R5G6B5) ) {
|
||||
if (DisplayFormat == WINED3DFMT_B5G6R5_UNORM && BackBufferFormat != WINED3DFMT_B5G6R5_UNORM)
|
||||
{
|
||||
TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
/* In FULLSCREEN mode X1R5G5B5 can only be mixed with backbuffer format *1R5G5B5 */
|
||||
if( (DisplayFormat == WINED3DFMT_X1R5G5B5) && !((BackBufferFormat == WINED3DFMT_X1R5G5B5) || (BackBufferFormat == WINED3DFMT_A1R5G5B5)) ) {
|
||||
if (DisplayFormat == WINED3DFMT_B5G5R5X1_UNORM
|
||||
&& !(BackBufferFormat == WINED3DFMT_B5G5R5X1_UNORM || BackBufferFormat == WINED3DFMT_B5G5R5A1_UNORM))
|
||||
{
|
||||
TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
/* In FULLSCREEN mode X8R8G8B8 can only be mixed with backbuffer format *8R8G8B8 */
|
||||
if( (DisplayFormat == WINED3DFMT_X8R8G8B8) && !((BackBufferFormat == WINED3DFMT_X8R8G8B8) || (BackBufferFormat == WINED3DFMT_A8R8G8B8)) ) {
|
||||
if (DisplayFormat == WINED3DFMT_B8G8R8X8_UNORM
|
||||
&& !(BackBufferFormat == WINED3DFMT_B8G8R8X8_UNORM || BackBufferFormat == WINED3DFMT_B8G8R8A8_UNORM))
|
||||
{
|
||||
TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
/* A2R10G10B10 is only allowed in fullscreen mode and it can only be mixed with backbuffer format A2R10G10B10 */
|
||||
if( (DisplayFormat == WINED3DFMT_A2R10G10B10) && ((BackBufferFormat != WINED3DFMT_A2R10G10B10) || Windowed)) {
|
||||
if (DisplayFormat == WINED3DFMT_B10G10R10A2_UNORM
|
||||
&& (BackBufferFormat != WINED3DFMT_B10G10R10A2_UNORM || Windowed))
|
||||
{
|
||||
TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
@ -2560,8 +2622,8 @@ static BOOL CheckBumpMapCapability(struct WineD3DAdapter *adapter,
|
|||
{
|
||||
case WINED3DFMT_R8G8_SNORM:
|
||||
case WINED3DFMT_R16G16_SNORM:
|
||||
case WINED3DFMT_L6V5U5:
|
||||
case WINED3DFMT_X8L8V8U8:
|
||||
case WINED3DFMT_R5G5_SNORM_L6_UNORM:
|
||||
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_SNORM:
|
||||
/* Ask the fixed function pipeline implementation if it can deal
|
||||
* with the conversion. If we've got a GL extension giving native
|
||||
|
@ -2685,11 +2747,11 @@ static BOOL CheckSrgbReadCapability(struct WineD3DAdapter *adapter, const struct
|
|||
|
||||
switch (format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_L8:
|
||||
case WINED3DFMT_A8L8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
case WINED3DFMT_L8_UNORM:
|
||||
case WINED3DFMT_L8A8_UNORM:
|
||||
case WINED3DFMT_DXT1:
|
||||
case WINED3DFMT_DXT2:
|
||||
case WINED3DFMT_DXT3:
|
||||
|
@ -2711,11 +2773,11 @@ static BOOL CheckSrgbWriteCapability(struct WineD3DAdapter *adapter,
|
|||
/* Only offer SRGB writing on X8R8G8B8/A8R8G8B8 when we use ARB or GLSL shaders as we are
|
||||
* doing the color fixup in shaders.
|
||||
* Note Windows drivers (at least on the Geforce 8800) also offer this on R5G6B5. */
|
||||
if ((format_desc->format == WINED3DFMT_X8R8G8B8) || (format_desc->format == WINED3DFMT_A8R8G8B8))
|
||||
if ((format_desc->format == WINED3DFMT_B8G8R8X8_UNORM) || (format_desc->format == WINED3DFMT_B8G8R8A8_UNORM))
|
||||
{
|
||||
int vs_selected_mode;
|
||||
int ps_selected_mode;
|
||||
select_shader_mode(&adapter->gl_info, DeviceType, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
|
||||
if((ps_selected_mode == SHADER_ARB) || (ps_selected_mode == SHADER_GLSL)) {
|
||||
TRACE_(d3d_caps)("[OK]\n");
|
||||
|
@ -2764,48 +2826,48 @@ static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter,
|
|||
/*****
|
||||
* supported: RGB(A) formats
|
||||
*/
|
||||
case WINED3DFMT_R8G8B8: /* Enable for dx7, blacklisted for 8 and 9 above */
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_B8G8R8_UNORM: /* Enable for dx7, blacklisted for 8 and 9 above */
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
case WINED3DFMT_A8_UNORM:
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
case WINED3DFMT_X8B8G8R8:
|
||||
case WINED3DFMT_A2R10G10B10:
|
||||
case WINED3DFMT_R8G8B8X8_UNORM:
|
||||
case WINED3DFMT_B10G10R10A2_UNORM:
|
||||
case WINED3DFMT_R10G10B10A2_UNORM:
|
||||
case WINED3DFMT_R16G16_UNORM:
|
||||
TRACE_(d3d_caps)("[OK]\n");
|
||||
return TRUE;
|
||||
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
TRACE_(d3d_caps)("[FAILED] - Not supported on Windows\n");
|
||||
return FALSE;
|
||||
|
||||
/*****
|
||||
* supported: Palettized
|
||||
*/
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
TRACE_(d3d_caps)("[OK]\n");
|
||||
return TRUE;
|
||||
/* No Windows driver offers A8P8, so don't offer it either */
|
||||
case WINED3DFMT_A8P8:
|
||||
/* No Windows driver offers WINED3DFMT_P8_UINT_A8_UNORM, so don't offer it either */
|
||||
case WINED3DFMT_P8_UINT_A8_UNORM:
|
||||
return FALSE;
|
||||
|
||||
/*****
|
||||
* Supported: (Alpha)-Luminance
|
||||
*/
|
||||
case WINED3DFMT_L8:
|
||||
case WINED3DFMT_A8L8:
|
||||
case WINED3DFMT_L16:
|
||||
case WINED3DFMT_L8_UNORM:
|
||||
case WINED3DFMT_L8A8_UNORM:
|
||||
case WINED3DFMT_L16_UNORM:
|
||||
TRACE_(d3d_caps)("[OK]\n");
|
||||
return TRUE;
|
||||
|
||||
/* Not supported on Windows, thus disabled */
|
||||
case WINED3DFMT_A4L4:
|
||||
case WINED3DFMT_L4A4_UNORM:
|
||||
TRACE_(d3d_caps)("[FAILED] - not supported on windows\n");
|
||||
return FALSE;
|
||||
|
||||
|
@ -2814,13 +2876,13 @@ static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter,
|
|||
*/
|
||||
case WINED3DFMT_D16_LOCKABLE:
|
||||
case WINED3DFMT_D16_UNORM:
|
||||
case WINED3DFMT_D15S1:
|
||||
case WINED3DFMT_D24X8:
|
||||
case WINED3DFMT_D24X4S4:
|
||||
case WINED3DFMT_D24S8:
|
||||
case WINED3DFMT_D24FS8:
|
||||
case WINED3DFMT_D32:
|
||||
case WINED3DFMT_D32F_LOCKABLE:
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM:
|
||||
case WINED3DFMT_X8D24_UNORM:
|
||||
case WINED3DFMT_S4X4_UINT_D24_UNORM:
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM:
|
||||
case WINED3DFMT_S8_UINT_D24_FLOAT:
|
||||
case WINED3DFMT_D32_UNORM:
|
||||
case WINED3DFMT_D32_FLOAT:
|
||||
return TRUE;
|
||||
|
||||
/*****
|
||||
|
@ -2828,8 +2890,8 @@ static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter,
|
|||
* GL_NV_texture_shader). Emulated by shaders
|
||||
*/
|
||||
case WINED3DFMT_R8G8_SNORM:
|
||||
case WINED3DFMT_X8L8V8U8:
|
||||
case WINED3DFMT_L6V5U5:
|
||||
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM:
|
||||
case WINED3DFMT_R5G5_SNORM_L6_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_SNORM:
|
||||
case WINED3DFMT_R16G16_SNORM:
|
||||
/* Ask the shader backend if it can deal with the conversion. If
|
||||
|
@ -2864,15 +2926,15 @@ static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter,
|
|||
case WINED3DFMT_R16_UINT:
|
||||
case WINED3DFMT_R32_UINT:
|
||||
case WINED3DFMT_R16G16B16A16_SNORM:
|
||||
case WINED3DFMT_A2W10V10U10:
|
||||
case WINED3DFMT_W11V11U10:
|
||||
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM:
|
||||
case WINED3DFMT_R10G11B11_SNORM:
|
||||
TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
|
||||
return FALSE;
|
||||
|
||||
/*****
|
||||
* WINED3DFMT_CxV8U8: Not supported right now
|
||||
* WINED3DFMT_R8G8_SNORM_Cx: Not supported right now
|
||||
*/
|
||||
case WINED3DFMT_CxV8U8:
|
||||
case WINED3DFMT_R8G8_SNORM_Cx:
|
||||
TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
|
||||
return FALSE;
|
||||
|
||||
|
@ -2891,7 +2953,7 @@ static BOOL CheckTextureCapability(struct WineD3DAdapter *adapter,
|
|||
|
||||
/* Not supported */
|
||||
case WINED3DFMT_R16G16B16A16_UNORM:
|
||||
case WINED3DFMT_A8R3G3B2:
|
||||
case WINED3DFMT_B2G3R3A8_UNORM:
|
||||
TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
|
||||
return FALSE;
|
||||
|
||||
|
@ -2989,24 +3051,24 @@ static BOOL CheckSurfaceCapability(struct WineD3DAdapter *adapter, const struct
|
|||
if(SurfaceType == SURFACE_GDI) {
|
||||
switch(check_format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_R8G8B8:
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_B8G8R8_UNORM:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
case WINED3DFMT_A8_UNORM:
|
||||
case WINED3DFMT_A8R3G3B2:
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_B2G3R3A8_UNORM:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
case WINED3DFMT_R10G10B10A2_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
case WINED3DFMT_X8B8G8R8:
|
||||
case WINED3DFMT_R8G8B8X8_UNORM:
|
||||
case WINED3DFMT_R16G16_UNORM:
|
||||
case WINED3DFMT_A2R10G10B10:
|
||||
case WINED3DFMT_B10G10R10A2_UNORM:
|
||||
case WINED3DFMT_R16G16B16A16_UNORM:
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
TRACE_(d3d_caps)("[OK]\n");
|
||||
return TRUE;
|
||||
default:
|
||||
|
@ -3496,12 +3558,12 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
|
|||
* except of R32F.
|
||||
*/
|
||||
switch(CheckFormat) {
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_A4L4:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
case WINED3DFMT_L4A4_UNORM:
|
||||
case WINED3DFMT_R32_FLOAT:
|
||||
case WINED3DFMT_R16_FLOAT:
|
||||
case WINED3DFMT_X8L8V8U8:
|
||||
case WINED3DFMT_L6V5U5:
|
||||
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM:
|
||||
case WINED3DFMT_R5G5_SNORM_L6_UNORM:
|
||||
case WINED3DFMT_R16G16_UNORM:
|
||||
TRACE_(d3d_caps)("[FAILED] - No converted formats on volumes\n");
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
|
@ -3576,7 +3638,7 @@ static const shader_backend_t *select_shader_backend(struct WineD3DAdapter *adap
|
|||
int vs_selected_mode;
|
||||
int ps_selected_mode;
|
||||
|
||||
select_shader_mode(&adapter->gl_info, DeviceType, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
if (vs_selected_mode == SHADER_GLSL || ps_selected_mode == SHADER_GLSL) {
|
||||
ret = &glsl_shader_backend;
|
||||
} else if (vs_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_ARB) {
|
||||
|
@ -3594,7 +3656,7 @@ static const struct fragment_pipeline *select_fragment_implementation(struct Win
|
|||
int vs_selected_mode;
|
||||
int ps_selected_mode;
|
||||
|
||||
select_shader_mode(&adapter->gl_info, DeviceType, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
if((ps_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_GLSL) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) {
|
||||
return &arbfp_fragment_pipeline;
|
||||
} else if(ps_selected_mode == SHADER_ATI) {
|
||||
|
@ -3614,7 +3676,7 @@ static const struct blit_shader *select_blit_implementation(struct WineD3DAdapte
|
|||
int vs_selected_mode;
|
||||
int ps_selected_mode;
|
||||
|
||||
select_shader_mode(&adapter->gl_info, DeviceType, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
if((ps_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_GLSL) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) {
|
||||
return &arbfp_blit;
|
||||
} else {
|
||||
|
@ -3644,7 +3706,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
|
|||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
select_shader_mode(&adapter->gl_info, DeviceType, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
|
||||
/* This function should *not* be modifying GL caps
|
||||
* TODO: move the functionality where it belongs */
|
||||
|
@ -4262,8 +4324,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
|
|||
object->adapterNo = Adapter;
|
||||
object->devType = DeviceType;
|
||||
|
||||
select_shader_mode(&adapter->gl_info, DeviceType,
|
||||
&object->ps_selected_mode, &object->vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &object->ps_selected_mode, &object->vs_selected_mode);
|
||||
object->shader_backend = select_shader_backend(adapter, DeviceType);
|
||||
|
||||
memset(&shader_caps, 0, sizeof(shader_caps));
|
||||
|
@ -4316,16 +4377,6 @@ static HRESULT WINAPI IWineD3DImpl_GetParent(IWineD3D *iface, IUnknown **pParent
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface) {
|
||||
IUnknown* surfaceParent;
|
||||
TRACE("(%p) call back\n", pSurface);
|
||||
|
||||
/* Now, release the parent, which will take care of cleaning up the surface for us */
|
||||
IWineD3DSurface_GetParent(pSurface, &surfaceParent);
|
||||
IUnknown_Release(surfaceParent);
|
||||
return IUnknown_Release(surfaceParent);
|
||||
}
|
||||
|
||||
ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pVolume) {
|
||||
IUnknown* volumeParent;
|
||||
TRACE("(%p) call back\n", pVolume);
|
||||
|
@ -4771,7 +4822,7 @@ BOOL InitAdapters(IWineD3DImpl *This)
|
|||
|
||||
WineD3D_ReleaseFakeGLContext(&fake_gl_ctx);
|
||||
|
||||
select_shader_mode(&adapter->gl_info, WINED3DDEVTYPE_HAL, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode);
|
||||
select_shader_max_constants(ps_selected_mode, vs_selected_mode, &adapter->gl_info);
|
||||
fillGLAttribFuncs(&adapter->gl_info);
|
||||
adapter->opengl = TRUE;
|
||||
|
@ -4830,3 +4881,10 @@ const IWineD3DVtbl IWineD3D_Vtbl =
|
|||
IWineD3DImpl_GetDeviceCaps,
|
||||
IWineD3DImpl_CreateDevice
|
||||
};
|
||||
|
||||
static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {}
|
||||
|
||||
const struct wined3d_parent_ops wined3d_null_parent_ops =
|
||||
{
|
||||
wined3d_null_wined3d_object_destroyed,
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2006, 2008 Henri Verbeet
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -34,26 +35,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_draw);
|
|||
|
||||
/* GL locking is done by the caller */
|
||||
static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type,
|
||||
UINT min_vertex_idx, UINT max_vertex_idx, UINT count, UINT idx_size,
|
||||
const void *idx_data, UINT start_idx)
|
||||
UINT count, UINT idx_size, const void *idx_data, UINT start_idx)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
if (idx_size)
|
||||
{
|
||||
TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, primitive_type, count, min_vertex_idx);
|
||||
TRACE("(%p) : glElements(%x, %d, ...)\n", This, primitive_type, count);
|
||||
|
||||
#if 1
|
||||
glDrawElements(primitive_type, count,
|
||||
idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT,
|
||||
(const char *)idx_data + (idx_size * start_idx));
|
||||
checkGLcall("glDrawElements");
|
||||
#else
|
||||
glDrawRangeElements(primitive_type, min_vertex_idx, max_vertex_idx, count,
|
||||
idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT,
|
||||
(const char *)idx_data + (idx_size * start_idx));
|
||||
checkGLcall("glDrawRangeElements");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -72,7 +65,7 @@ static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type,
|
|||
/* GL locking is done by the caller */
|
||||
static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context *context,
|
||||
const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType,
|
||||
const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx)
|
||||
const void *idxData, UINT idxSize, UINT startIdx)
|
||||
{
|
||||
unsigned int textureNo = 0;
|
||||
const WORD *pIdxBufS = NULL;
|
||||
|
@ -129,18 +122,19 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
|
|||
glNormal3f(0, 0, 0);
|
||||
}
|
||||
|
||||
num_untracked_materials = context->num_untracked_materials;
|
||||
if (si->use_map & (1 << WINED3D_FFP_DIFFUSE))
|
||||
{
|
||||
element = &si->elements[WINED3D_FFP_DIFFUSE];
|
||||
diffuse = element->data + streamOffset[element->stream_idx];
|
||||
|
||||
if (num_untracked_materials && element->format_desc->format != WINED3DFMT_B8G8R8A8_UNORM)
|
||||
FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->format));
|
||||
}
|
||||
else
|
||||
{
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
num_untracked_materials = context->num_untracked_materials;
|
||||
if (num_untracked_materials && element->format_desc->format != WINED3DFMT_A8R8G8B8)
|
||||
FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->format));
|
||||
|
||||
if (si->use_map & (1 << WINED3D_FFP_SPECULAR))
|
||||
{
|
||||
|
@ -155,7 +149,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
|
|||
{
|
||||
if (GL_SUPPORT(EXT_FOG_COORD))
|
||||
{
|
||||
if (element->format_desc->format == WINED3DFMT_A8R8G8B8) specular_fog = TRUE;
|
||||
if (element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) specular_fog = TRUE;
|
||||
else FIXME("Implement fog coordinates from %s\n", debug_d3dformat(element->format_desc->format));
|
||||
}
|
||||
else
|
||||
|
@ -338,7 +332,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, WINED3DFORMAT format
|
|||
case WINED3DFMT_R8G8B8A8_UINT:
|
||||
GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr));
|
||||
break;
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
|
||||
{
|
||||
const DWORD *src = ptr;
|
||||
|
@ -422,7 +416,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, WINED3DFORMAT format
|
|||
|
||||
/* GL locking is done by the caller */
|
||||
static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT numberOfVertices,
|
||||
GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx)
|
||||
GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT startIdx)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
long SkipnStrides = startIdx + This->stateBlock->loadBaseVertexIndex;
|
||||
|
@ -484,7 +478,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream
|
|||
|
||||
/* GL locking is done by the caller */
|
||||
static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wined3d_stream_info *si,
|
||||
UINT numberOfVertices, GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT minIndex,
|
||||
UINT numberOfVertices, GLenum glPrimitiveType, const void *idxData, UINT idxSize,
|
||||
UINT startIdx)
|
||||
{
|
||||
UINT numInstances = 0, i;
|
||||
|
@ -504,7 +498,7 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wine
|
|||
return;
|
||||
}
|
||||
|
||||
TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, glPrimitiveType, numberOfVertices, minIndex);
|
||||
TRACE("(%p) : glElements(%x, %d, ...)\n", This, glPrimitiveType, numberOfVertices);
|
||||
|
||||
/* First, figure out how many instances we have to draw */
|
||||
for(i = 0; i < MAX_STREAMS; i++) {
|
||||
|
@ -575,8 +569,7 @@ static inline void remove_vbos(IWineD3DDeviceImpl *This, struct wined3d_stream_i
|
|||
}
|
||||
|
||||
/* Routine common to the draw primitive and draw indexed primitive routines */
|
||||
void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertices,
|
||||
UINT StartIdx, UINT idxSize, const void *idxData, UINT minIndex)
|
||||
void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT idxSize, const void *idxData)
|
||||
{
|
||||
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
@ -627,8 +620,6 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
|
|||
const struct wined3d_stream_info *stream_info = &This->strided_streams;
|
||||
struct wined3d_stream_info stridedlcl;
|
||||
|
||||
if (!numberOfVertices) numberOfVertices = index_count;
|
||||
|
||||
if (!use_vs(This->stateBlock))
|
||||
{
|
||||
if (!This->strided_streams.position_transformed && context->num_untracked_materials
|
||||
|
@ -676,18 +667,17 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
|
|||
} else {
|
||||
TRACE("Using immediate mode with vertex shaders for half float emulation\n");
|
||||
}
|
||||
drawStridedSlowVs(iface, stream_info, index_count, glPrimType, idxData, idxSize, minIndex, StartIdx);
|
||||
drawStridedSlowVs(iface, stream_info, index_count, glPrimType, idxData, idxSize, StartIdx);
|
||||
} else {
|
||||
drawStridedSlow(iface, context, stream_info, index_count,
|
||||
glPrimType, idxData, idxSize, minIndex, StartIdx);
|
||||
glPrimType, idxData, idxSize, StartIdx);
|
||||
}
|
||||
} else if(This->instancedDraw) {
|
||||
/* Instancing emulation with mixing immediate mode and arrays */
|
||||
drawStridedInstanced(iface, &This->strided_streams, index_count,
|
||||
glPrimType, idxData, idxSize, minIndex, StartIdx);
|
||||
glPrimType, idxData, idxSize, StartIdx);
|
||||
} else {
|
||||
drawStridedFast(iface, glPrimType, minIndex, minIndex + numberOfVertices - 1,
|
||||
index_count, idxSize, idxData, StartIdx);
|
||||
drawStridedFast(iface, glPrimType, index_count, idxSize, idxData, StartIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -187,14 +187,14 @@ static void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLhandleA
|
|||
static const char * const spam[] =
|
||||
{
|
||||
"Vertex shader was successfully compiled to run on hardware.\n", /* fglrx */
|
||||
"Fragment shader was successfully compiled to run on hardware.\n", /* fglrx */
|
||||
"Fragment shader was successfully compiled to run on hardware.\n", /* fglrx, with \n */
|
||||
"Fragment shader was successfully compiled to run on hardware.", /* fglrx, no \n */
|
||||
"Fragment shader(s) linked, vertex shader(s) linked. \n ", /* fglrx, with \n */
|
||||
"Fragment shader(s) linked, vertex shader(s) linked.", /* fglrx, no \n */
|
||||
"Vertex shader(s) linked, no fragment shader(s) defined. \n ", /* fglrx, with \n */
|
||||
"Vertex shader(s) linked, no fragment shader(s) defined.", /* fglrx, no \n */
|
||||
"Fragment shader was successfully compiled to run on hardware.\n"
|
||||
"Fragment shader(s) linked, no vertex shader(s) defined.", /* fglrx, no \n */
|
||||
"Fragment shader(s) linked, no vertex shader(s) defined. \n ", /* fglrx, with \n */
|
||||
"Fragment shader(s) linked, no vertex shader(s) defined.", /* fglrx, no \n */
|
||||
};
|
||||
|
||||
if (!TRACE_ON(d3d_shader) && !FIXME_ON(d3d_shader)) return;
|
||||
|
@ -3880,10 +3880,16 @@ static GLhandleARB find_glsl_pshader(const struct wined3d_context *context,
|
|||
struct ps_np2fixup_info *np2fixup = NULL;
|
||||
GLhandleARB ret;
|
||||
|
||||
if(!shader->backend_priv) {
|
||||
shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
ERR("Failed to allocate backend data.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
shader_data = shader->backend_priv;
|
||||
shader_data = shader->baseShader.backend_data;
|
||||
|
||||
/* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
|
||||
* so a linear search is more performant than a hashmap or a binary search
|
||||
|
@ -3949,10 +3955,16 @@ static GLhandleARB find_glsl_vshader(const struct wined3d_context *context,
|
|||
struct glsl_vshader_private *shader_data;
|
||||
GLhandleARB ret;
|
||||
|
||||
if(!shader->backend_priv) {
|
||||
shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
|
||||
if (!shader->baseShader.backend_data)
|
||||
{
|
||||
ERR("Failed to allocate backend data.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
shader_data = shader->backend_priv;
|
||||
shader_data = shader->baseShader.backend_data;
|
||||
|
||||
/* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
|
||||
* so a linear search is more performant than a hashmap or a binary search
|
||||
|
@ -4351,11 +4363,11 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
|
|||
if(pshader) {
|
||||
struct glsl_pshader_private *shader_data;
|
||||
ps = (IWineD3DPixelShaderImpl *) This;
|
||||
shader_data = ps->backend_priv;
|
||||
shader_data = ps->baseShader.backend_data;
|
||||
if(!shader_data || shader_data->num_gl_shaders == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
ps->backend_priv = NULL;
|
||||
ps->baseShader.backend_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4371,11 +4383,11 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
|
|||
} else {
|
||||
struct glsl_vshader_private *shader_data;
|
||||
vs = (IWineD3DVertexShaderImpl *) This;
|
||||
shader_data = vs->backend_priv;
|
||||
shader_data = vs->baseShader.backend_data;
|
||||
if(!shader_data || shader_data->num_gl_shaders == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
vs->backend_priv = NULL;
|
||||
vs->baseShader.backend_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4411,7 +4423,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
|
|||
|
||||
if(pshader) {
|
||||
UINT i;
|
||||
struct glsl_pshader_private *shader_data = ps->backend_priv;
|
||||
struct glsl_pshader_private *shader_data = ps->baseShader.backend_data;
|
||||
|
||||
ENTER_GL();
|
||||
for(i = 0; i < shader_data->num_gl_shaders; i++) {
|
||||
|
@ -4422,10 +4434,10 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
|
|||
LEAVE_GL();
|
||||
HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders);
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
ps->backend_priv = NULL;
|
||||
ps->baseShader.backend_data = NULL;
|
||||
} else {
|
||||
UINT i;
|
||||
struct glsl_vshader_private *shader_data = vs->backend_priv;
|
||||
struct glsl_vshader_private *shader_data = vs->baseShader.backend_data;
|
||||
|
||||
ENTER_GL();
|
||||
for(i = 0; i < shader_data->num_gl_shaders; i++) {
|
||||
|
@ -4436,7 +4448,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
|
|||
LEAVE_GL();
|
||||
HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders);
|
||||
HeapFree(GetProcessHeap(), 0, shader_data);
|
||||
vs->backend_priv = NULL;
|
||||
vs->baseShader.backend_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2006 Ivan Gyurdiev
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -71,6 +72,7 @@ static ULONG WINAPI IWineD3DPixelShaderImpl_Release(IWineD3DPixelShader *iface)
|
|||
if (!refcount)
|
||||
{
|
||||
shader_cleanup((IWineD3DBaseShader *)iface);
|
||||
This->baseShader.parent_ops->wined3d_object_destroyed(This->baseShader.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
|
@ -84,7 +86,7 @@ static ULONG WINAPI IWineD3DPixelShaderImpl_Release(IWineD3DPixelShader *iface)
|
|||
static HRESULT WINAPI IWineD3DPixelShaderImpl_GetParent(IWineD3DPixelShader *iface, IUnknown** parent){
|
||||
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)iface;
|
||||
|
||||
*parent = This->parent;
|
||||
*parent = This->baseShader.parent;
|
||||
IUnknown_AddRef(*parent);
|
||||
TRACE("(%p) : returning %p\n", This, *parent);
|
||||
return WINED3D_OK;
|
||||
|
@ -208,50 +210,51 @@ static void pshader_set_limits(IWineD3DPixelShaderImpl *This)
|
|||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature)
|
||||
static HRESULT pixelshader_set_function(IWineD3DPixelShaderImpl *shader,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature)
|
||||
{
|
||||
IWineD3DPixelShaderImpl *This =(IWineD3DPixelShaderImpl *)iface;
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
unsigned int i, highest_reg_used = 0, num_regs_used = 0;
|
||||
shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
|
||||
shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
|
||||
const struct wined3d_shader_frontend *fe;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : pFunction %p\n", iface, pFunction);
|
||||
TRACE("shader %p, byte_code %p, output_signature %p.\n", shader, byte_code, output_signature);
|
||||
|
||||
fe = shader_select_frontend(*pFunction);
|
||||
fe = shader_select_frontend(*byte_code);
|
||||
if (!fe)
|
||||
{
|
||||
FIXME("Unable to find frontend for shader.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
This->baseShader.frontend = fe;
|
||||
This->baseShader.frontend_data = fe->shader_init(pFunction, output_signature);
|
||||
if (!This->baseShader.frontend_data)
|
||||
shader->baseShader.frontend = fe;
|
||||
shader->baseShader.frontend_data = fe->shader_init(byte_code, output_signature);
|
||||
if (!shader->baseShader.frontend_data)
|
||||
{
|
||||
FIXME("Failed to initialize frontend.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* First pass: trace shader */
|
||||
if (TRACE_ON(d3d_shader)) shader_trace_init(fe, This->baseShader.frontend_data, pFunction);
|
||||
if (TRACE_ON(d3d_shader)) shader_trace_init(fe, shader->baseShader.frontend_data, byte_code);
|
||||
|
||||
/* Initialize immediate constant lists */
|
||||
list_init(&This->baseShader.constantsF);
|
||||
list_init(&This->baseShader.constantsB);
|
||||
list_init(&This->baseShader.constantsI);
|
||||
list_init(&shader->baseShader.constantsF);
|
||||
list_init(&shader->baseShader.constantsB);
|
||||
list_init(&shader->baseShader.constantsI);
|
||||
|
||||
/* Second pass: figure out which registers are used, what the semantics are, etc.. */
|
||||
hr = shader_get_registers_used((IWineD3DBaseShader *)This, fe,
|
||||
reg_maps, NULL, This->input_signature, NULL,
|
||||
pFunction, GL_LIMITS(pshader_constantsF));
|
||||
hr = shader_get_registers_used((IWineD3DBaseShader *)shader, fe,
|
||||
reg_maps, NULL, shader->input_signature, NULL,
|
||||
byte_code, gl_info->max_pshader_constantsF);
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
pshader_set_limits(This);
|
||||
pshader_set_limits(shader);
|
||||
|
||||
for (i = 0; i < MAX_REG_INPUT; ++i)
|
||||
{
|
||||
if (This->input_reg_used[i])
|
||||
if (shader->input_reg_used[i])
|
||||
{
|
||||
++num_regs_used;
|
||||
highest_reg_used = i;
|
||||
|
@ -260,10 +263,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
|
|||
|
||||
/* Don't do any register mapping magic if it is not needed, or if we can't
|
||||
* achieve anything anyway */
|
||||
if (highest_reg_used < (GL_LIMITS(glsl_varyings) / 4)
|
||||
|| num_regs_used > (GL_LIMITS(glsl_varyings) / 4))
|
||||
if (highest_reg_used < (gl_info->max_glsl_varyings / 4)
|
||||
|| num_regs_used > (gl_info->max_glsl_varyings / 4))
|
||||
{
|
||||
if (num_regs_used > (GL_LIMITS(glsl_varyings) / 4))
|
||||
if (num_regs_used > (gl_info->max_glsl_varyings / 4))
|
||||
{
|
||||
/* This happens with relative addressing. The input mapper function
|
||||
* warns about this if the higher registers are declared too, so
|
||||
|
@ -273,28 +276,28 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
|
|||
|
||||
for (i = 0; i < MAX_REG_INPUT; ++i)
|
||||
{
|
||||
This->input_reg_map[i] = i;
|
||||
shader->input_reg_map[i] = i;
|
||||
}
|
||||
|
||||
This->declared_in_count = highest_reg_used + 1;
|
||||
shader->declared_in_count = highest_reg_used + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
This->declared_in_count = 0;
|
||||
shader->declared_in_count = 0;
|
||||
for (i = 0; i < MAX_REG_INPUT; ++i)
|
||||
{
|
||||
if (This->input_reg_used[i]) This->input_reg_map[i] = This->declared_in_count++;
|
||||
else This->input_reg_map[i] = ~0U;
|
||||
if (shader->input_reg_used[i]) shader->input_reg_map[i] = shader->declared_in_count++;
|
||||
else shader->input_reg_map[i] = ~0U;
|
||||
}
|
||||
}
|
||||
|
||||
This->baseShader.load_local_constsF = FALSE;
|
||||
shader->baseShader.load_local_constsF = FALSE;
|
||||
|
||||
TRACE("(%p) : Copying the function\n", This);
|
||||
TRACE("(%p) : Copying byte code.\n", shader);
|
||||
|
||||
This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength);
|
||||
if (!This->baseShader.function) return E_OUTOFMEMORY;
|
||||
memcpy(This->baseShader.function, pFunction, This->baseShader.functionLength);
|
||||
shader->baseShader.function = HeapAlloc(GetProcessHeap(), 0, shader->baseShader.functionLength);
|
||||
if (!shader->baseShader.function) return E_OUTOFMEMORY;
|
||||
memcpy(shader->baseShader.function, byte_code, shader->baseShader.functionLength);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -343,7 +346,7 @@ void pixelshader_update_samplers(struct shader_reg_maps *reg_maps, IWineD3DBaseT
|
|||
}
|
||||
}
|
||||
|
||||
const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =
|
||||
static const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
IWineD3DPixelShaderImpl_QueryInterface,
|
||||
|
@ -352,10 +355,9 @@ const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =
|
|||
/*** IWineD3DBase methods ***/
|
||||
IWineD3DPixelShaderImpl_GetParent,
|
||||
/*** IWineD3DBaseShader methods ***/
|
||||
IWineD3DPixelShaderImpl_SetFunction,
|
||||
/*** IWineD3DPixelShader methods ***/
|
||||
IWineD3DPixelShaderImpl_GetDevice,
|
||||
IWineD3DPixelShaderImpl_GetFunction
|
||||
/*** IWineD3DPixelShader methods ***/
|
||||
};
|
||||
|
||||
void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, struct ps_compile_args *args) {
|
||||
|
@ -421,3 +423,25 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (!byte_code) return WINED3DERR_INVALIDCALL;
|
||||
|
||||
shader->lpVtbl = &IWineD3DPixelShader_Vtbl;
|
||||
shader_init(&shader->baseShader, device, parent, parent_ops);
|
||||
|
||||
hr = pixelshader_set_function(shader, byte_code, output_signature);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to set function, hr %#x.\n", hr);
|
||||
shader_cleanup((IWineD3DBaseShader *)shader);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2003-2004 Raphael Junqueira
|
||||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -28,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
|||
|
||||
HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type,
|
||||
IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc,
|
||||
WINED3DPOOL pool, IUnknown *parent)
|
||||
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource;
|
||||
|
||||
|
@ -41,6 +42,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type
|
|||
resource->usage = usage;
|
||||
resource->size = size;
|
||||
resource->priority = 0;
|
||||
resource->parent_ops = parent_ops;
|
||||
list_init(&resource->privateData);
|
||||
|
||||
if (size)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2006 Henri Verbeet
|
||||
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1842,6 +1843,14 @@ static void state_ckeyblend(DWORD state, IWineD3DStateBlockImpl *stateblock, str
|
|||
}
|
||||
}
|
||||
|
||||
static void state_swvp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||
{
|
||||
if (stateblock->renderState[WINED3DRS_SOFTWAREVERTEXPROCESSING])
|
||||
{
|
||||
FIXME("Software vertex processing not implemented.\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Set texture operations up - The following avoids lots of ifdefs in this routine!*/
|
||||
#if defined (GL_VERSION_1_3)
|
||||
# define useext(A) A
|
||||
|
@ -4059,7 +4068,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
|
|||
case WINED3DFMT_R8G8B8A8_UINT:
|
||||
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
|
||||
break;
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
|
||||
{
|
||||
const DWORD *src = (const DWORD *)ptr;
|
||||
|
@ -4964,6 +4973,7 @@ const struct StateEntryTemplate misc_state_template[] = {
|
|||
{ STATE_RENDER(WINED3DRS_WRAP15), { STATE_RENDER(WINED3DRS_WRAP0), state_wrap }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_EXTENTS), { STATE_RENDER(WINED3DRS_EXTENTS), state_extents }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), { STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_ckeyblend }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), { STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), state_swvp }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), { STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), state_patchedgestyle}, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_PATCHSEGMENTS), { STATE_RENDER(WINED3DRS_PATCHSEGMENTS), state_patchsegments }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3DRS_POSITIONDEGREE), { STATE_RENDER(WINED3DRS_POSITIONDEGREE), state_positiondegree}, WINED3D_GL_EXT_NONE },
|
||||
|
|
|
@ -842,8 +842,9 @@ should really perform a delta so that only the changes get updated*/
|
|||
This->wineD3DDevice->updateStateBlock->gl_primitive_type = This->gl_primitive_type;
|
||||
}
|
||||
|
||||
if (This->changed.indices) {
|
||||
IWineD3DDevice_SetIndices(pDevice, This->pIndexData, This->IndexFmt);
|
||||
if (This->changed.indices)
|
||||
{
|
||||
IWineD3DDevice_SetIndexBuffer(pDevice, This->pIndexData, This->IndexFmt);
|
||||
IWineD3DDevice_SetBaseVertexIndex(pDevice, This->baseVertexIndex);
|
||||
}
|
||||
|
||||
|
@ -1025,7 +1026,7 @@ should really perform a delta so that only the changes get updated*/
|
|||
IWineD3DDevice_SetTransform(pDevice, i, &This->transforms[i]);
|
||||
}
|
||||
This->wineD3DDevice->updateStateBlock->gl_primitive_type = This->gl_primitive_type;
|
||||
IWineD3DDevice_SetIndices(pDevice, This->pIndexData, This->IndexFmt);
|
||||
IWineD3DDevice_SetIndexBuffer(pDevice, This->pIndexData, This->IndexFmt);
|
||||
IWineD3DDevice_SetBaseVertexIndex(pDevice, This->baseVertexIndex);
|
||||
IWineD3DDevice_SetVertexDeclaration(pDevice, This->vertexDecl);
|
||||
IWineD3DDevice_SetMaterial(pDevice, &This->material);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2007-2008 Henri Verbeet
|
||||
* Copyright 2006-2008 Roderick Colenbrander
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -69,7 +70,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
|
|||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry)
|
||||
{
|
||||
GL_EXTCALL(glDeleteRenderbuffersEXT(1, &entry->id));
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id);
|
||||
HeapFree(GetProcessHeap(), 0, entry);
|
||||
}
|
||||
|
||||
|
@ -122,7 +123,7 @@ UINT surface_calculate_size(const struct GlPixelFormatDesc *format_desc, UINT al
|
|||
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
|
||||
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
|
||||
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format,
|
||||
WINED3DPOOL pool, IUnknown *parent)
|
||||
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &GLINFO_LOCATION);
|
||||
|
@ -159,7 +160,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
|
|||
}
|
||||
|
||||
hr = resource_init((IWineD3DResource *)surface, WINED3DRTYPE_SURFACE,
|
||||
device, resource_size, usage, format_desc, pool, parent);
|
||||
device, resource_size, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x.\n", hr);
|
||||
|
@ -333,7 +334,7 @@ static BOOL primary_render_target_is_p8(IWineD3DDeviceImpl *device)
|
|||
if (device->render_targets && device->render_targets[0]) {
|
||||
IWineD3DSurfaceImpl* render_target = (IWineD3DSurfaceImpl*)device->render_targets[0];
|
||||
if ((render_target->resource.usage & WINED3DUSAGE_RENDERTARGET)
|
||||
&& (render_target->resource.format_desc->format == WINED3DFMT_P8))
|
||||
&& (render_target->resource.format_desc->format == WINED3DFMT_P8_UINT))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -350,7 +351,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
|
|||
const struct GlPixelFormatDesc *format_desc = This->resource.format_desc;
|
||||
|
||||
/* Only support read back of converted P8 surfaces */
|
||||
if (This->Flags & SFLAG_CONVERTED && format_desc->format != WINED3DFMT_P8)
|
||||
if (This->Flags & SFLAG_CONVERTED && format_desc->format != WINED3DFMT_P8_UINT)
|
||||
{
|
||||
FIXME("Read back converted textures unsupported, format=%s\n", debug_d3dformat(format_desc->format));
|
||||
return;
|
||||
|
@ -389,7 +390,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
|
|||
int dst_pitch = 0;
|
||||
|
||||
/* In case of P8 the index is stored in the alpha component if the primary render target uses P8 */
|
||||
if (format_desc->format == WINED3DFMT_P8 && primary_render_target_is_p8(This->resource.wineD3DDevice))
|
||||
if (format_desc->format == WINED3DFMT_P8_UINT && primary_render_target_is_p8(This->resource.wineD3DDevice))
|
||||
{
|
||||
format = GL_ALPHA;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
|
@ -609,6 +610,7 @@ static void surface_allocate_surface(IWineD3DSurfaceImpl *This, GLenum internal,
|
|||
/* GL locking is done by the caller */
|
||||
void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height) {
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
||||
const struct wined3d_gl_info *gl_info = &This->resource.wineD3DDevice->adapter->gl_info;
|
||||
renderbuffer_entry_t *entry;
|
||||
GLuint renderbuffer = 0;
|
||||
unsigned int src_width, src_height;
|
||||
|
@ -620,7 +622,9 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
|
|||
if (width > src_width || height > src_height) return;
|
||||
|
||||
/* Remove any renderbuffer set if the sizes match */
|
||||
if (width == src_width && height == src_height) {
|
||||
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
|
||||
|| (width == src_width && height == src_height))
|
||||
{
|
||||
This->current_renderbuffer = NULL;
|
||||
return;
|
||||
}
|
||||
|
@ -635,10 +639,10 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
|
|||
}
|
||||
|
||||
if (!renderbuffer) {
|
||||
GL_EXTCALL(glGenRenderbuffersEXT(1, &renderbuffer));
|
||||
GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffer));
|
||||
GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
|
||||
This->resource.format_desc->glInternal, width, height));
|
||||
gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer);
|
||||
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
|
||||
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER,
|
||||
This->resource.format_desc->glInternal, width, height);
|
||||
|
||||
entry = HeapAlloc(GetProcessHeap(), 0, sizeof(renderbuffer_entry_t));
|
||||
entry->width = width;
|
||||
|
@ -727,6 +731,7 @@ static ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface)
|
|||
if (!ref)
|
||||
{
|
||||
surface_cleanup(This);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
|
||||
TRACE("(%p) Released.\n", This);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
@ -759,8 +764,8 @@ void surface_internal_preload(IWineD3DSurface *iface, enum WINED3DSRGB srgb)
|
|||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
}
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
if(palette9_changed(This)) {
|
||||
TRACE("Reloading surface because the d3d8/9 palette was changed\n");
|
||||
|
@ -812,6 +817,8 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
|
|||
IWineD3DBaseTexture *texture = NULL;
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
|
||||
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
||||
const struct wined3d_context *context;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
renderbuffer_entry_t *entry, *entry2;
|
||||
TRACE("(%p)\n", iface);
|
||||
|
||||
|
@ -842,7 +849,8 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
|
|||
IWineD3DSurface_ModifyLocation(iface, SFLAG_INSRGBTEX, FALSE);
|
||||
This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
|
||||
|
||||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
context = ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
/* Destroy PBOs, but load them into real sysmem before */
|
||||
if(This->Flags & SFLAG_PBO) {
|
||||
|
@ -855,7 +863,7 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
|
|||
*/
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry) {
|
||||
ENTER_GL();
|
||||
GL_EXTCALL(glDeleteRenderbuffersEXT(1, &entry->id));
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id);
|
||||
LEAVE_GL();
|
||||
list_remove(&entry->entry);
|
||||
HeapFree(GetProcessHeap(), 0, entry);
|
||||
|
@ -952,7 +960,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
|
|||
|
||||
switch(This->resource.format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
{
|
||||
if(primary_render_target_is_p8(myDevice)) {
|
||||
/* In case of P8 render targets the index is stored in the alpha component */
|
||||
|
@ -1058,7 +1066,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
|
|||
row = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if(!row) {
|
||||
ERR("Out of memory\n");
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8) HeapFree(GetProcessHeap(), 0, mem);
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT) HeapFree(GetProcessHeap(), 0, mem);
|
||||
LEAVE_GL();
|
||||
return;
|
||||
}
|
||||
|
@ -1088,7 +1096,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
|
|||
* the same color but we have no choice.
|
||||
* In case of P8 render targets, the index is stored in the alpha component so no conversion is needed.
|
||||
*/
|
||||
if ((This->resource.format_desc->format == WINED3DFMT_P8) && !primary_render_target_is_p8(myDevice))
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && !primary_render_target_is_p8(myDevice))
|
||||
{
|
||||
const PALETTEENTRY *pal = NULL;
|
||||
DWORD width = pitch / 3;
|
||||
|
@ -1589,20 +1597,12 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
|
|||
if (This->Flags & SFLAG_LOCKED)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
/* According to Direct3D9 docs, only these formats are supported */
|
||||
if (((IWineD3DImpl *)This->resource.wineD3DDevice->wineD3D)->dxVersion > 7) {
|
||||
if (This->resource.format_desc->format != WINED3DFMT_R5G6B5
|
||||
&& This->resource.format_desc->format != WINED3DFMT_X1R5G5B5
|
||||
&& This->resource.format_desc->format != WINED3DFMT_R8G8B8
|
||||
&& This->resource.format_desc->format != WINED3DFMT_X8R8G8B8)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
memset(&lock, 0, sizeof(lock)); /* To be sure */
|
||||
|
||||
/* Create a DIB section if there isn't a hdc yet */
|
||||
if(!This->hDC) {
|
||||
IWineD3DBaseSurfaceImpl_CreateDIBSection(iface);
|
||||
hr = IWineD3DBaseSurfaceImpl_CreateDIBSection(iface);
|
||||
if(FAILED(hr)) return WINED3DERR_INVALIDCALL;
|
||||
if(This->Flags & SFLAG_CLIENT) {
|
||||
surface_internal_preload(iface, SRGB_RGB);
|
||||
}
|
||||
|
@ -1629,8 +1629,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
|
|||
return hr;
|
||||
}
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
/* GetDC on palettized formats is unsupported in D3D9, and the method is missing in
|
||||
D3D8, so this should only be used for DX <=7 surfaces (with non-device palettes) */
|
||||
|
@ -1722,7 +1722,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
/* Ok, now look if we have to do any conversion */
|
||||
switch(This->resource.format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
/* ****************
|
||||
Paletted Texture
|
||||
**************** */
|
||||
|
@ -1757,7 +1757,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
/* **********************
|
||||
GL_UNSIGNED_BYTE_3_3_2
|
||||
********************** */
|
||||
|
@ -1768,7 +1768,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
if (colorkey_active) {
|
||||
*convert = CONVERT_CK_565;
|
||||
*format = GL_RGBA;
|
||||
|
@ -1777,7 +1777,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
if (colorkey_active) {
|
||||
*convert = CONVERT_CK_5551;
|
||||
*format = GL_BGRA;
|
||||
|
@ -1786,7 +1786,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_R8G8B8:
|
||||
case WINED3DFMT_B8G8R8_UNORM:
|
||||
if (colorkey_active) {
|
||||
*convert = CONVERT_CK_RGB24;
|
||||
*format = GL_RGBA;
|
||||
|
@ -1796,7 +1796,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
if (colorkey_active) {
|
||||
*convert = CONVERT_RGB32_888;
|
||||
*format = GL_RGBA;
|
||||
|
@ -1813,7 +1813,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
*target_bpp = 3;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_L6V5U5:
|
||||
case WINED3DFMT_R5G5_SNORM_L6_UNORM:
|
||||
*convert = CONVERT_L6V5U5;
|
||||
if(GL_SUPPORT(NV_TEXTURE_SHADER)) {
|
||||
*target_bpp = 3;
|
||||
|
@ -1826,7 +1826,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X8L8V8U8:
|
||||
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM:
|
||||
*convert = CONVERT_X8L8V8U8;
|
||||
*target_bpp = 4;
|
||||
if(GL_SUPPORT(NV_TEXTURE_SHADER)) {
|
||||
|
@ -1858,8 +1858,8 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
*target_bpp = 6;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_A4L4:
|
||||
/* A4L4 exists as an internal gl format, but for some reason there is not
|
||||
case WINED3DFMT_L4A4_UNORM:
|
||||
/* WINED3DFMT_L4A4_UNORM exists as an internal gl format, but for some reason there is not
|
||||
* format+type combination to load it. Thus convert it to A8L8, then load it
|
||||
* with A4L4 internal, but A8L8 format+type
|
||||
*/
|
||||
|
@ -1890,22 +1890,24 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
|||
*target_bpp = 12;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D15S1:
|
||||
if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM:
|
||||
if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT)
|
||||
|| GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
{
|
||||
*convert = CONVERT_D15S1;
|
||||
*target_bpp = 4;
|
||||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D24X4S4:
|
||||
if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
case WINED3DFMT_S4X4_UINT_D24_UNORM:
|
||||
if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT)
|
||||
|| GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
{
|
||||
*convert = CONVERT_D24X4S4;
|
||||
}
|
||||
break;
|
||||
|
||||
case WINED3DFMT_D24FS8:
|
||||
case WINED3DFMT_S8_UINT_D24_FLOAT:
|
||||
if (GL_SUPPORT(ARB_DEPTH_BUFFER_FLOAT))
|
||||
{
|
||||
*convert = CONVERT_D24FS8;
|
||||
|
@ -2505,8 +2507,8 @@ static void d3dfmt_p8_upload_palette(IWineD3DSurface *iface, CONVERT_TYPES conve
|
|||
BOOL palette9_changed(IWineD3DSurfaceImpl *This) {
|
||||
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
||||
|
||||
if (This->palette || (This->resource.format_desc->format != WINED3DFMT_P8
|
||||
&& This->resource.format_desc->format != WINED3DFMT_A8P8))
|
||||
if (This->palette || (This->resource.format_desc->format != WINED3DFMT_P8_UINT
|
||||
&& This->resource.format_desc->format != WINED3DFMT_P8_UINT_A8_UNORM))
|
||||
{
|
||||
/* If a ddraw-style palette is attached assume no d3d9 palette change.
|
||||
* Also the palette isn't interesting if the surface format isn't P8 or A8P8
|
||||
|
@ -3096,6 +3098,11 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
|
|||
checkGLcall("glCopyTexSubImage2D");
|
||||
|
||||
LEAVE_GL();
|
||||
|
||||
/* The texture is now most up to date - If the surface is a render target and has a drawable, this
|
||||
* path is never entered
|
||||
*/
|
||||
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
|
||||
}
|
||||
|
||||
/* Uses the hardware to stretch and flip the image */
|
||||
|
@ -3343,6 +3350,11 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
|
|||
}
|
||||
|
||||
LEAVE_GL();
|
||||
|
||||
/* The texture is now most up to date - If the surface is a render target and has a drawable, this
|
||||
* path is never entered
|
||||
*/
|
||||
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
|
||||
}
|
||||
|
||||
/* Not called from the VTable */
|
||||
|
@ -3565,7 +3577,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
|
||||
/* When blitting from a render target a texture, the texture isn't required to have a palette.
|
||||
* In this case grab the palette from the render target. */
|
||||
if ((This->resource.format_desc->format == WINED3DFMT_P8) && (This->palette == NULL))
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && !This->palette)
|
||||
{
|
||||
paletteOverride = TRUE;
|
||||
TRACE("Source surface (%p) lacks palette, overriding palette with palette %p of destination surface (%p)\n", Src, This->palette, This);
|
||||
|
@ -3587,7 +3599,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
* FBO support, so it doesn't really make sense to try and make it work with different offscreen rendering
|
||||
* backends.
|
||||
*/
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT)
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
|
||||
&& myDevice->adapter->gl_info.fbo_ops.glBlitFramebuffer
|
||||
&& surface_can_stretch_rect(Src, This))
|
||||
{
|
||||
stretch_rect_fbo((IWineD3DDevice *)myDevice, SrcSurface, &srect,
|
||||
|
@ -3612,10 +3625,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
} else {
|
||||
This->Flags &= ~SFLAG_INSYSMEM;
|
||||
}
|
||||
/* The texture is now most up to date - If the surface is a render target and has a drawable, this
|
||||
* path is never entered
|
||||
*/
|
||||
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
|
||||
|
||||
return WINED3D_OK;
|
||||
} else if(Src) {
|
||||
|
@ -3644,14 +3653,15 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
* surface is not required to have a palette. Our rendering / conversion
|
||||
* code further down the road retrieves the palette from the surface, so
|
||||
* it must have a palette set. */
|
||||
if ((Src->resource.format_desc->format == WINED3DFMT_P8) && (Src->palette == NULL))
|
||||
if (Src->resource.format_desc->format == WINED3DFMT_P8_UINT && !Src->palette)
|
||||
{
|
||||
paletteOverride = TRUE;
|
||||
TRACE("Source surface (%p) lacks palette, overriding palette with palette %p of destination surface (%p)\n", Src, This->palette, This);
|
||||
Src->palette = This->palette;
|
||||
}
|
||||
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT)
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
|
||||
&& myDevice->adapter->gl_info.fbo_ops.glBlitFramebuffer
|
||||
&& !(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE))
|
||||
&& surface_can_stretch_rect(Src, This))
|
||||
{
|
||||
|
@ -3843,7 +3853,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
/* The color as given in the Blt function is in the format of the frame-buffer...
|
||||
* 'clear' expect it in ARGB format => we need to do some conversion :-)
|
||||
*/
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT)
|
||||
{
|
||||
DWORD alpha;
|
||||
|
||||
|
@ -3859,7 +3869,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
color = alpha;
|
||||
}
|
||||
}
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_R5G6B5)
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_B5G6R5_UNORM)
|
||||
{
|
||||
if (DDBltFx->u5.dwFillColor == 0xFFFF) {
|
||||
color = 0xFFFFFFFF;
|
||||
|
@ -3870,12 +3880,12 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
|
|||
((DDBltFx->u5.dwFillColor & 0x001F) << 3));
|
||||
}
|
||||
}
|
||||
else if ((This->resource.format_desc->format == WINED3DFMT_R8G8B8)
|
||||
|| (This->resource.format_desc->format == WINED3DFMT_X8R8G8B8))
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_B8G8R8_UNORM
|
||||
|| This->resource.format_desc->format == WINED3DFMT_B8G8R8X8_UNORM)
|
||||
{
|
||||
color = 0xFF000000 | DDBltFx->u5.dwFillColor;
|
||||
}
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_A8R8G8B8)
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
color = DDBltFx->u5.dwFillColor;
|
||||
}
|
||||
|
@ -3908,14 +3918,14 @@ static HRESULT IWineD3DSurfaceImpl_BltZ(IWineD3DSurfaceImpl *This, const RECT *D
|
|||
case WINED3DFMT_D16_UNORM:
|
||||
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000ffff;
|
||||
break;
|
||||
case WINED3DFMT_D15S1:
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM:
|
||||
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000fffe;
|
||||
break;
|
||||
case WINED3DFMT_D24S8:
|
||||
case WINED3DFMT_D24X8:
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM:
|
||||
case WINED3DFMT_X8D24_UNORM:
|
||||
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x00ffffff;
|
||||
break;
|
||||
case WINED3DFMT_D32:
|
||||
case WINED3DFMT_D32_UNORM:
|
||||
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0xffffffff;
|
||||
break;
|
||||
default:
|
||||
|
@ -4048,8 +4058,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
|
|||
|
||||
if (!pal) return WINED3D_OK;
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
int bpp;
|
||||
GLenum format, internal, type;
|
||||
|
@ -4161,9 +4171,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
|
|||
is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE
|
||||
doesn't work in combination with ARB_TEXTURE_RECTANGLE.
|
||||
*/
|
||||
if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE)
|
||||
&& !((This->resource.format_desc->format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE)
|
||||
&& (wined3d_settings.rendertargetlock_mode == RTL_READTEX)))
|
||||
if (This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE)
|
||||
&& !(This->resource.format_desc->format == WINED3DFMT_P8_UINT && GL_SUPPORT(EXT_PALETTED_TEXTURE)
|
||||
&& wined3d_settings.rendertargetlock_mode == RTL_READTEX))
|
||||
{
|
||||
This->texture_target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
This->pow2Width = This->currentDesc.Width;
|
||||
|
@ -4348,6 +4358,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *co
|
|||
{
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
||||
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
TRACE("(%p) New location %#x\n", This, location);
|
||||
|
||||
|
@ -4379,7 +4390,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *co
|
|||
|
||||
/* Note that we use depth_blt here as well, rather than glCopyTexImage2D
|
||||
* directly on the FBO texture. That's because we need to flip. */
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
if (This->texture_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding);
|
||||
|
@ -4401,30 +4412,32 @@ void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *co
|
|||
|
||||
/* Setup the destination */
|
||||
if (!device->depth_blt_rb) {
|
||||
GL_EXTCALL(glGenRenderbuffersEXT(1, &device->depth_blt_rb));
|
||||
gl_info->fbo_ops.glGenRenderbuffers(1, &device->depth_blt_rb);
|
||||
checkGLcall("glGenRenderbuffersEXT");
|
||||
}
|
||||
if (device->depth_blt_rb_w != This->currentDesc.Width
|
||||
|| device->depth_blt_rb_h != This->currentDesc.Height) {
|
||||
GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, device->depth_blt_rb));
|
||||
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, device->depth_blt_rb);
|
||||
checkGLcall("glBindRenderbufferEXT");
|
||||
GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA8, This->currentDesc.Width, This->currentDesc.Height));
|
||||
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8,
|
||||
This->currentDesc.Width, This->currentDesc.Height);
|
||||
checkGLcall("glRenderbufferStorageEXT");
|
||||
device->depth_blt_rb_w = This->currentDesc.Width;
|
||||
device->depth_blt_rb_h = This->currentDesc.Height;
|
||||
}
|
||||
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->dst_fbo);
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, device->depth_blt_rb));
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo);
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, device->depth_blt_rb);
|
||||
checkGLcall("glFramebufferRenderbufferEXT");
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER_EXT, iface, FALSE);
|
||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, iface, FALSE);
|
||||
|
||||
/* Do the actual blit */
|
||||
surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height, bind_target);
|
||||
checkGLcall("depth_blt");
|
||||
|
||||
if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->current_fbo->id);
|
||||
else context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER, &context->current_fbo->id);
|
||||
else context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
|
||||
LEAVE_GL();
|
||||
} else {
|
||||
|
@ -4436,12 +4449,12 @@ void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *co
|
|||
|
||||
ENTER_GL();
|
||||
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER_EXT, NULL);
|
||||
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
|
||||
surface_depth_blt(This, This->texture_name, This->currentDesc.Width,
|
||||
This->currentDesc.Height, This->texture_target);
|
||||
checkGLcall("depth_blt");
|
||||
|
||||
if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->current_fbo->id);
|
||||
if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER, &context->current_fbo->id);
|
||||
|
||||
LEAVE_GL();
|
||||
} else {
|
||||
|
@ -4689,9 +4702,9 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
|
|||
*/
|
||||
if(SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface*)This, &IID_IWineD3DBaseTexture, (void **) &texture)))
|
||||
{
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
IWineD3DBaseTexture_Release(texture);
|
||||
}
|
||||
}
|
||||
|
@ -4838,12 +4851,18 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
|
|||
IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
|
||||
}
|
||||
} else {
|
||||
if((This->Flags & SFLAG_LOCATIONS) == SFLAG_INSRGBTEX) {
|
||||
if((This->Flags & (SFLAG_INSRGBTEX | SFLAG_INSYSMEM)) == SFLAG_INSRGBTEX) {
|
||||
/* Performance warning ... */
|
||||
FIXME("%p: Downloading srgb texture to reload it as rgb\n", This);
|
||||
IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
|
||||
}
|
||||
}
|
||||
if(!(This->Flags & SFLAG_INSYSMEM)) {
|
||||
/* Should not happen */
|
||||
ERR("Trying to load a texture from sysmem, but SFLAG_INSYSMEM is not set\n");
|
||||
/* Lets hope we get it from somewhere... */
|
||||
IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
|
||||
}
|
||||
|
||||
if (!device->isInDraw) ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
surface_bind_and_dirtify(This, srgb);
|
||||
|
@ -4881,7 +4900,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
|
|||
|
||||
This->Flags |= SFLAG_CONVERTED;
|
||||
}
|
||||
else if ((This->resource.format_desc->format == WINED3DFMT_P8)
|
||||
else if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
&& (GL_SUPPORT(EXT_PALETTED_TEXTURE) || GL_SUPPORT(ARB_FRAGMENT_PROGRAM)))
|
||||
{
|
||||
d3dfmt_p8_upload_palette(iface, convert);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2007 Henri Verbeet
|
||||
* Copyright 2006-2007 Roderick Colenbrander
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -542,6 +543,12 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) {
|
|||
DWORD *masks;
|
||||
UINT usage;
|
||||
|
||||
if(!(format_desc->Flags & WINED3DFMT_FLAG_GETDC))
|
||||
{
|
||||
WARN("Cannot use GetDC on a %s surface\n", debug_d3dformat(format_desc->format));
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
switch (format_desc->byte_count)
|
||||
{
|
||||
case 2:
|
||||
|
@ -592,22 +599,22 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) {
|
|||
masks = (DWORD *)b_info->bmiColors;
|
||||
switch (This->resource.format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_R8G8B8:
|
||||
case WINED3DFMT_B8G8R8_UNORM:
|
||||
usage = DIB_RGB_COLORS;
|
||||
b_info->bmiHeader.biCompression = BI_RGB;
|
||||
break;
|
||||
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_A8R3G3B2:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
case WINED3DFMT_B2G3R3A8_UNORM:
|
||||
case WINED3DFMT_R10G10B10A2_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
case WINED3DFMT_X8B8G8R8:
|
||||
case WINED3DFMT_A2R10G10B10:
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_R8G8B8X8_UNORM:
|
||||
case WINED3DFMT_B10G10R10A2_UNORM:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
case WINED3DFMT_R16G16B16A16_UNORM:
|
||||
usage = 0;
|
||||
b_info->bmiHeader.biCompression = BI_BITFIELDS;
|
||||
|
@ -750,9 +757,9 @@ struct d3dfmt_convertor_desc {
|
|||
|
||||
static const struct d3dfmt_convertor_desc convertors[] =
|
||||
{
|
||||
{WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT, convert_r32_float_r16_float},
|
||||
{WINED3DFMT_R5G6B5, WINED3DFMT_X8R8G8B8, convert_r5g6b5_x8r8g8b8},
|
||||
{WINED3DFMT_A8R8G8B8, WINED3DFMT_X8R8G8B8, convert_a8r8g8b8_x8r8g8b8},
|
||||
{WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT, convert_r32_float_r16_float},
|
||||
{WINED3DFMT_B5G6R5_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_r5g6b5_x8r8g8b8},
|
||||
{WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_a8r8g8b8_x8r8g8b8},
|
||||
};
|
||||
|
||||
static inline const struct d3dfmt_convertor_desc *find_convertor(WINED3DFORMAT from, WINED3DFORMAT to)
|
||||
|
@ -793,7 +800,8 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
|
|||
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.wineD3DDevice, source->currentDesc.Width,
|
||||
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret,
|
||||
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
|
||||
0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), NULL /* parent */);
|
||||
0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source),
|
||||
NULL /* parent */, &wined3d_null_parent_ops);
|
||||
if(!ret) {
|
||||
ERR("Failed to create a destination surface for conversion\n");
|
||||
return NULL;
|
||||
|
|
|
@ -313,7 +313,7 @@ const char* filename)
|
|||
}
|
||||
fprintf(f, "P6\n%d %d\n255\n", This->pow2Width, This->pow2Height);
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT)
|
||||
{
|
||||
unsigned char table[256][3];
|
||||
int i;
|
||||
|
@ -384,6 +384,12 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
|
|||
|
||||
TRACE("(%p)->(%p)\n",This,pHDC);
|
||||
|
||||
if(!(This->Flags & SFLAG_DIBSECTION))
|
||||
{
|
||||
WARN("DC not supported on this surface\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if(This->Flags & SFLAG_USERPTR) {
|
||||
ERR("Not supported on surfaces with an application-provided surfaces\n");
|
||||
return WINEDDERR_NODC;
|
||||
|
@ -412,8 +418,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
|
|||
return hr;
|
||||
}
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
unsigned int n;
|
||||
const PALETTEENTRY *pal = NULL;
|
||||
|
@ -525,26 +531,29 @@ static HRESULT WINAPI
|
|||
IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
|
||||
{
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
|
||||
HRESULT hr;
|
||||
|
||||
if(This->resource.usage & WINED3DUSAGE_OVERLAY)
|
||||
{
|
||||
ERR("(%p) Overlays not yet supported by GDI surfaces\n", This);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Sysmem textures have memory already allocated -
|
||||
* release it, this avoids an unnecessary memcpy
|
||||
*/
|
||||
HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
|
||||
This->resource.allocatedMemory = NULL;
|
||||
This->resource.heapMemory = NULL;
|
||||
hr = IWineD3DBaseSurfaceImpl_CreateDIBSection(iface);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
|
||||
This->resource.heapMemory = NULL;
|
||||
This->resource.allocatedMemory = This->dib.bitmap_data;
|
||||
}
|
||||
|
||||
/* We don't mind the nonpow2 stuff in GDI */
|
||||
This->pow2Width = This->currentDesc.Width;
|
||||
This->pow2Height = This->currentDesc.Height;
|
||||
|
||||
IWineD3DBaseSurfaceImpl_CreateDIBSection(iface);
|
||||
This->resource.allocatedMemory = This->dib.bitmap_data;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
|
|||
#define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info
|
||||
|
||||
/*IWineD3DSwapChain parts follow: */
|
||||
static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderTarget) {
|
||||
static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
|
||||
{
|
||||
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
|
||||
WINED3DDISPLAYMODE mode;
|
||||
unsigned int i;
|
||||
|
@ -50,9 +51,9 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
|
|||
if (This->frontBuffer)
|
||||
{
|
||||
IWineD3DSurface_SetContainer(This->frontBuffer, 0);
|
||||
if (D3DCB_DestroyRenderTarget(This->frontBuffer))
|
||||
if (IWineD3DSurface_Release(This->frontBuffer))
|
||||
{
|
||||
FIXME("(%p) Something's still holding the front buffer (%p).\n",
|
||||
WARN("(%p) Something's still holding the front buffer (%p).\n",
|
||||
This, This->frontBuffer);
|
||||
}
|
||||
This->frontBuffer = NULL;
|
||||
|
@ -65,8 +66,8 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
|
|||
while (i--)
|
||||
{
|
||||
IWineD3DSurface_SetContainer(This->backBuffer[i], 0);
|
||||
if (D3DCB_DestroyRenderTarget(This->backBuffer[i]))
|
||||
FIXME("(%p) Something's still holding back buffer %u (%p).\n",
|
||||
if (IWineD3DSurface_Release(This->backBuffer[i]))
|
||||
WARN("(%p) Something's still holding back buffer %u (%p).\n",
|
||||
This, i, This->backBuffer[i]);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, This->backBuffer);
|
||||
|
@ -119,7 +120,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
|
|||
cursor.resource.ref = 1;
|
||||
cursor.resource.wineD3DDevice = This->wineD3DDevice;
|
||||
cursor.resource.pool = WINED3DPOOL_SCRATCH;
|
||||
cursor.resource.format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->wineD3DDevice->adapter->gl_info);
|
||||
cursor.resource.format_desc =
|
||||
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->wineD3DDevice->adapter->gl_info);
|
||||
cursor.resource.resourceType = WINED3DRTYPE_SURFACE;
|
||||
cursor.texture_name = This->wineD3DDevice->cursorTexture;
|
||||
cursor.texture_target = GL_TEXTURE_2D;
|
||||
|
|
|
@ -59,7 +59,7 @@ ULONG WINAPI IWineD3DBaseSwapChainImpl_Release(IWineD3DSwapChain *iface) {
|
|||
refCount = InterlockedDecrement(&This->ref);
|
||||
TRACE("(%p) : ReleaseRef to %d\n", This, refCount);
|
||||
if (refCount == 0) {
|
||||
IWineD3DSwapChain_Destroy(iface, D3DCB_DefaultDestroySurface);
|
||||
IWineD3DSwapChain_Destroy(iface);
|
||||
}
|
||||
return refCount;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||
|
||||
static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderback) {
|
||||
static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface)
|
||||
{
|
||||
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
|
||||
WINED3DDISPLAYMODE mode;
|
||||
|
||||
|
@ -38,8 +39,9 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
|
|||
/* release the ref to the front and back buffer parents */
|
||||
if(This->frontBuffer) {
|
||||
IWineD3DSurface_SetContainer(This->frontBuffer, 0);
|
||||
if(D3DCB_DestroyRenderback(This->frontBuffer) > 0) {
|
||||
FIXME("(%p) Something's still holding the front buffer\n",This);
|
||||
if (IWineD3DSurface_Release(This->frontBuffer) > 0)
|
||||
{
|
||||
WARN("(%p) Something's still holding the front buffer\n",This);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,8 +49,9 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
|
|||
UINT i;
|
||||
for(i = 0; i < This->presentParms.BackBufferCount; i++) {
|
||||
IWineD3DSurface_SetContainer(This->backBuffer[i], 0);
|
||||
if(D3DCB_DestroyRenderback(This->backBuffer[i]) > 0) {
|
||||
FIXME("(%p) Something's still holding the back buffer\n",This);
|
||||
if (IWineD3DSurface_Release(This->backBuffer[i]) > 0)
|
||||
{
|
||||
WARN("(%p) Something's still holding the back buffer\n",This);
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, This->backBuffer);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2002-2005 Raphael Junqueira
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -57,7 +58,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
|
|||
srgb_mode = This->baseTexture.is_srgb;
|
||||
break;
|
||||
}
|
||||
dirty = srgb_mode ? &This->baseTexture.srgbDirty : &This->baseTexture.dirty;
|
||||
dirty = srgb_mode ? &This->baseTexture.texture_srgb.dirty : &This->baseTexture.texture_rgb.dirty;
|
||||
|
||||
if (!device->isInDraw)
|
||||
{
|
||||
|
@ -66,8 +67,8 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
|
|||
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
|
||||
}
|
||||
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8
|
||||
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
|
||||
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|
||||
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
|
||||
{
|
||||
for (i = 0; i < This->baseTexture.levels; ++i)
|
||||
{
|
||||
|
@ -100,7 +101,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
|
|||
*dirty = FALSE;
|
||||
}
|
||||
|
||||
static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN surface_destroy_cb)
|
||||
static void texture_cleanup(IWineD3DTextureImpl *This)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -116,7 +117,7 @@ static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN su
|
|||
surface_set_texture_name(This->surfaces[i], 0, FALSE);
|
||||
surface_set_texture_target(This->surfaces[i], 0);
|
||||
IWineD3DSurface_SetContainer(This->surfaces[i], 0);
|
||||
surface_destroy_cb(This->surfaces[i]);
|
||||
IWineD3DSurface_Release(This->surfaces[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,164 +125,6 @@ static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN su
|
|||
basetexture_cleanup((IWineD3DBaseTexture *)This);
|
||||
}
|
||||
|
||||
HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT pow2_width, pow2_height;
|
||||
UINT tmp_w, tmp_h;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Non-power2 support. */
|
||||
if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO))
|
||||
{
|
||||
pow2_width = width;
|
||||
pow2_height = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Find the nearest pow2 match. */
|
||||
pow2_width = pow2_height = 1;
|
||||
while (pow2_width < width) pow2_width <<= 1;
|
||||
while (pow2_height < height) pow2_height <<= 1;
|
||||
|
||||
if (pow2_width != width || pow2_height != height)
|
||||
{
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("Attempted to create a mipmapped np2 texture without unconditional np2 support.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
levels = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping. */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))
|
||||
{
|
||||
WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(max(width, height)) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,
|
||||
WINED3DRTYPE_TEXTURE, device, 0, usage, format_desc, pool, parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords.
|
||||
* Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
|
||||
* is used in combination with texture uploads (RTL_READTEX). The reason is that EXT_PALETTED_TEXTURE
|
||||
* doesn't work in combination with ARB_TEXTURE_RECTANGLE. */
|
||||
if (GL_SUPPORT(WINE_NORMALIZED_TEXRECT) && (width != pow2_width || height != pow2_height))
|
||||
{
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
texture->cond_np2 = TRUE;
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
|
||||
}
|
||||
else if (GL_SUPPORT(ARB_TEXTURE_RECTANGLE) && (width != pow2_width || height != pow2_height)
|
||||
&& !((format_desc->format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE)
|
||||
&& (wined3d_settings.rendertargetlock_mode == RTL_READTEX)))
|
||||
{
|
||||
if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
|
||||
texture->baseTexture.pow2Matrix[0] = (float)width;
|
||||
texture->baseTexture.pow2Matrix[5] = (float)height;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
texture->cond_np2 = TRUE;
|
||||
|
||||
if(texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
|
||||
{
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noMip;
|
||||
}
|
||||
else
|
||||
{
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((width != pow2_width) || (height != pow2_height))
|
||||
{
|
||||
texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
texture->baseTexture.pow2Matrix[0] = (((float)width) / ((float)pow2_width));
|
||||
texture->baseTexture.pow2Matrix[5] = (((float)height) / ((float)pow2_height));
|
||||
}
|
||||
else
|
||||
{
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
}
|
||||
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
texture->cond_np2 = FALSE;
|
||||
}
|
||||
TRACE("xf(%f) yf(%f)\n", texture->baseTexture.pow2Matrix[0], texture->baseTexture.pow2Matrix[5]);
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = width;
|
||||
tmp_h = height;
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Use the callback to create the texture surface. */
|
||||
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format,
|
||||
usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]);
|
||||
if (FAILED(hr) || ((IWineD3DSurfaceImpl *)texture->surfaces[i])->Flags & SFLAG_OVERSIZE)
|
||||
{
|
||||
FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
|
||||
texture->surfaces[i] = NULL;
|
||||
texture_cleanup(texture, D3DCB_DefaultDestroySurface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
IWineD3DSurface_SetContainer(texture->surfaces[i], (IWineD3DBase *)texture);
|
||||
TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[i]);
|
||||
surface_set_texture_target(texture->surfaces[i], texture->target);
|
||||
/* Calculate the next mipmap level. */
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
tmp_h = max(1, tmp_h >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = texture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
#undef GLINFO_LOCATION
|
||||
|
||||
/* *******************************************
|
||||
|
@ -318,8 +161,11 @@ static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) {
|
|||
ULONG ref;
|
||||
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
|
||||
ref = InterlockedDecrement(&This->resource.ref);
|
||||
if (ref == 0) {
|
||||
IWineD3DTexture_Destroy(iface, D3DCB_DefaultDestroySurface);
|
||||
if (!ref)
|
||||
{
|
||||
texture_cleanup(This);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -429,12 +275,16 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
|
|||
hr = basetexture_bind((IWineD3DBaseTexture *)iface, srgb, &set_gl_texture_desc);
|
||||
if (set_gl_texture_desc && SUCCEEDED(hr)) {
|
||||
UINT i;
|
||||
struct gl_texture *gl_tex;
|
||||
|
||||
if(This->baseTexture.is_srgb) {
|
||||
gl_tex = &This->baseTexture.texture_srgb;
|
||||
} else {
|
||||
gl_tex = &This->baseTexture.texture_rgb;
|
||||
}
|
||||
|
||||
for (i = 0; i < This->baseTexture.levels; ++i) {
|
||||
if(This->baseTexture.is_srgb) {
|
||||
surface_set_texture_name(This->surfaces[i], This->baseTexture.srgbTextureName, TRUE);
|
||||
} else {
|
||||
surface_set_texture_name(This->surfaces[i], This->baseTexture.textureName, FALSE);
|
||||
}
|
||||
surface_set_texture_name(This->surfaces[i], gl_tex->name, This->baseTexture.is_srgb);
|
||||
}
|
||||
/* Conditinal non power of two textures use a different clamping default. If we're using the GL_WINE_normalized_texrect
|
||||
* partial driver emulation, we're dealing with a GL_TEXTURE_2D texture which has the address mode set to repeat - something
|
||||
|
@ -452,11 +302,11 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface, BO
|
|||
glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
checkGLcall("glTexParameteri(dimension, GL_TEXTURE_MAG_FILTER, GL_NEAREST)");
|
||||
LEAVE_GL();
|
||||
This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP;
|
||||
This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP;
|
||||
This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP;
|
||||
gl_tex->states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP;
|
||||
gl_tex->states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
|
||||
gl_tex->states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
|
||||
gl_tex->states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,14 +330,6 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
|
|||
/* *******************************************
|
||||
IWineD3DTexture IWineD3DTexture parts follow
|
||||
******************************************* */
|
||||
static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
|
||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||
|
||||
texture_cleanup(This, D3DCB_DestroySurface);
|
||||
/* free the object */
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_GetLevelDesc(IWineD3DTexture *iface, UINT Level, WINED3DSURFACE_DESC* pDesc) {
|
||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||
|
||||
|
@ -550,15 +392,15 @@ static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UIN
|
|||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, CONST RECT* pDirtyRect) {
|
||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||
This->baseTexture.dirty = TRUE;
|
||||
This->baseTexture.srgbDirty = TRUE;
|
||||
This->baseTexture.texture_rgb.dirty = TRUE;
|
||||
This->baseTexture.texture_srgb.dirty = TRUE;
|
||||
TRACE("(%p) : dirtyfication of surface Level (0)\n", This);
|
||||
surface_add_dirty_rect(This->surfaces[0], pDirtyRect);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
||||
static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DTextureImpl_QueryInterface,
|
||||
|
@ -588,10 +430,170 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
|||
IWineD3DTextureImpl_GetTextureDimensions,
|
||||
IWineD3DTextureImpl_IsCondNP2,
|
||||
/* IWineD3DTexture */
|
||||
IWineD3DTextureImpl_Destroy,
|
||||
IWineD3DTextureImpl_GetLevelDesc,
|
||||
IWineD3DTextureImpl_GetSurfaceLevel,
|
||||
IWineD3DTextureImpl_LockRect,
|
||||
IWineD3DTextureImpl_UnlockRect,
|
||||
IWineD3DTextureImpl_AddDirtyRect
|
||||
};
|
||||
|
||||
HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT pow2_width, pow2_height;
|
||||
UINT tmp_w, tmp_h;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Non-power2 support. */
|
||||
if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO])
|
||||
{
|
||||
pow2_width = width;
|
||||
pow2_height = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Find the nearest pow2 match. */
|
||||
pow2_width = pow2_height = 1;
|
||||
while (pow2_width < width) pow2_width <<= 1;
|
||||
while (pow2_height < height) pow2_height <<= 1;
|
||||
|
||||
if (pow2_width != width || pow2_height != height)
|
||||
{
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("Attempted to create a mipmapped np2 texture without unconditional np2 support.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
levels = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping. */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
|
||||
{
|
||||
WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(max(width, height)) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &IWineD3DTexture_Vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_TEXTURE,
|
||||
device, 0, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Precalculated scaling for 'faked' non power of two texture coords.
|
||||
* Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
|
||||
* is used in combination with texture uploads (RTL_READTEX). The reason is that EXT_PALETTED_TEXTURE
|
||||
* doesn't work in combination with ARB_TEXTURE_RECTANGLE. */
|
||||
if (gl_info->supported[WINE_NORMALIZED_TEXRECT] && (width != pow2_width || height != pow2_height))
|
||||
{
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
texture->cond_np2 = TRUE;
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
|
||||
}
|
||||
else if (gl_info->supported[ARB_TEXTURE_RECTANGLE] && (width != pow2_width || height != pow2_height)
|
||||
&& !(format_desc->format == WINED3DFMT_P8_UINT && gl_info->supported[EXT_PALETTED_TEXTURE]
|
||||
&& wined3d_settings.rendertargetlock_mode == RTL_READTEX))
|
||||
{
|
||||
if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
|
||||
texture->baseTexture.pow2Matrix[0] = (float)width;
|
||||
texture->baseTexture.pow2Matrix[5] = (float)height;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
texture->cond_np2 = TRUE;
|
||||
|
||||
if(texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
|
||||
{
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noMip;
|
||||
}
|
||||
else
|
||||
{
|
||||
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((width != pow2_width) || (height != pow2_height))
|
||||
{
|
||||
texture->baseTexture.pow2Matrix_identity = FALSE;
|
||||
texture->baseTexture.pow2Matrix[0] = (((float)width) / ((float)pow2_width));
|
||||
texture->baseTexture.pow2Matrix[5] = (((float)height) / ((float)pow2_height));
|
||||
}
|
||||
else
|
||||
{
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
}
|
||||
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
texture->cond_np2 = FALSE;
|
||||
}
|
||||
TRACE("xf(%f) yf(%f)\n", texture->baseTexture.pow2Matrix[0], texture->baseTexture.pow2Matrix[5]);
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = width;
|
||||
tmp_h = height;
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Use the callback to create the texture surface. */
|
||||
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format,
|
||||
usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]);
|
||||
if (FAILED(hr) || ((IWineD3DSurfaceImpl *)texture->surfaces[i])->Flags & SFLAG_OVERSIZE)
|
||||
{
|
||||
FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
|
||||
texture->surfaces[i] = NULL;
|
||||
texture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
IWineD3DSurface_SetContainer(texture->surfaces[i], (IWineD3DBase *)texture);
|
||||
TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[i]);
|
||||
surface_set_texture_target(texture->surfaces[i], texture->target);
|
||||
/* Calculate the next mipmap level. */
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
tmp_h = max(1, tmp_h >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = texture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2006-2008 Henri Verbeet
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -49,89 +50,88 @@ struct StaticPixelFormatDesc
|
|||
*/
|
||||
static const struct StaticPixelFormatDesc formats[] =
|
||||
{
|
||||
/* WINED3DFORMAT alphamask redmask greenmask bluemask bpp depth stencil isFourcc */
|
||||
{WINED3DFMT_UNKNOWN, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE},
|
||||
/* FourCC formats, kept here to have WINED3DFMT_R8G8B8(=20) at position 20 */
|
||||
{WINED3DFMT_UYVY, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_YUY2, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_YV12, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT1, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT2, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT3, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT4, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT5, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_MULTI2_ARGB8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
{WINED3DFMT_G8R8_G8B8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
{WINED3DFMT_R8G8_B8G8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
/* WINED3DFORMAT alphamask redmask greenmask bluemask bpp depth stencil isFourcc */
|
||||
{WINED3DFMT_UNKNOWN, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE},
|
||||
/* FourCC formats */
|
||||
{WINED3DFMT_UYVY, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_YUY2, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_YV12, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT1, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT2, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT3, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT4, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_DXT5, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_MULTI2_ARGB8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
{WINED3DFMT_G8R8_G8B8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
{WINED3DFMT_R8G8_B8G8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },
|
||||
/* IEEE formats */
|
||||
{WINED3DFMT_R32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32_FLOAT, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32B32_FLOAT, 0x0, 0x0, 0x0, 0x0, 12, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32B32A32_FLOAT, 0x1, 0x0, 0x0, 0x0, 16, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32_FLOAT, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32B32_FLOAT, 0x0, 0x0, 0x0, 0x0, 12, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32G32B32A32_FLOAT, 0x1, 0x0, 0x0, 0x0, 16, 0, 0, FALSE},
|
||||
/* Hmm? */
|
||||
{WINED3DFMT_CxV8U8, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8_SNORM_Cx, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
/* Float */
|
||||
{WINED3DFMT_R16_FLOAT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_SINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_FLOAT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_SINT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16_FLOAT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_SINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_FLOAT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_SINT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
/* Palettized formats */
|
||||
{WINED3DFMT_A8P8, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_P8, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_P8_UINT_A8_UNORM, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_P8_UINT, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
/* Standard ARGB formats. */
|
||||
{WINED3DFMT_R8G8B8, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 3, 0, 0, FALSE},
|
||||
{WINED3DFMT_A8R8G8B8, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_X8R8G8B8, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R5G6B5, 0x0, 0x0000f800, 0x000007e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_X1R5G5B5, 0x0, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_A1R5G5B5, 0x00008000, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_A4R4G4B4, 0x0000f000, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R3G3B2, 0x0, 0x000000e0, 0x0000001c, 0x00000003, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_A8_UNORM, 0x000000ff, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_A8R3G3B2, 0x0000ff00, 0x000000e0, 0x0000001c, 0x00000003, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_X4R4G4B4, 0x0, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_UNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_UINT, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_SNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_UNORM, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_UINT, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_X8B8G8R8, 0x0, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_UNORM, 0x0, 0x0000ffff, 0xffff0000, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_A2R10G10B10, 0xc0000000, 0x3ff00000, 0x000ffc00, 0x000003ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_UNORM, 0x1, 0x0000ffff, 0xffff0000, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_B8G8R8_UNORM, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 3, 0, 0, FALSE},
|
||||
{WINED3DFMT_B8G8R8A8_UNORM, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_B8G8R8X8_UNORM, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_B5G6R5_UNORM, 0x0, 0x0000f800, 0x000007e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_B5G5R5X1_UNORM, 0x0, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_B5G5R5A1_UNORM, 0x00008000, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_B4G4R4A4_UNORM, 0x0000f000, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_B2G3R3_UNORM, 0x0, 0x000000e0, 0x0000001c, 0x00000003, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_A8_UNORM, 0x000000ff, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_B2G3R3A8_UNORM, 0x0000ff00, 0x000000e0, 0x0000001c, 0x00000003, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_B4G4R4X4_UNORM, 0x0, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_UNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_UINT, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10A2_SNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_UNORM, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_UINT, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8X8_UNORM, 0x0, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_UNORM, 0x0, 0x0000ffff, 0xffff0000, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_B10G10R10A2_UNORM, 0xc0000000, 0x3ff00000, 0x000ffc00, 0x000003ff, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_UNORM, 0x1, 0x0000ffff, 0xffff0000, 0x0, 8, 0, 0, FALSE},
|
||||
/* Luminance */
|
||||
{WINED3DFMT_L8, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_A8L8, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_A4L4, 0x000000f0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_L8_UNORM, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_L8A8_UNORM, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_L4A4_UNORM, 0x000000f0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},
|
||||
{WINED3DFMT_L16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
/* Bump mapping stuff */
|
||||
{WINED3DFMT_R8G8_SNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_L6V5U5, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_X8L8V8U8, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_W11V11U10, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_A2W10V10U10, 0xb0000000, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8_SNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R5G5_SNORM_L6_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G11B11_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R10G10B10_SNORM_A2_UNORM,0xb0000000,0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
/* Depth stencil formats */
|
||||
{WINED3DFMT_D16_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
{WINED3DFMT_D32, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE},
|
||||
{WINED3DFMT_D15S1, 0x0, 0x0, 0x0, 0x0, 2, 15, 1, FALSE},
|
||||
{WINED3DFMT_D24S8, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
|
||||
{WINED3DFMT_D24X8, 0x0, 0x0, 0x0, 0x0, 4, 24, 0, FALSE},
|
||||
{WINED3DFMT_D24X4S4, 0x0, 0x0, 0x0, 0x0, 4, 24, 4, FALSE},
|
||||
{WINED3DFMT_D16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
{WINED3DFMT_L16, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
{WINED3DFMT_D32F_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE},
|
||||
{WINED3DFMT_D24FS8, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
|
||||
/* Is this a vertex buffer? */
|
||||
{WINED3DFMT_VERTEXDATA, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16_UINT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32_UINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_SNORM, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
{WINED3DFMT_D16_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
{WINED3DFMT_D32_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE},
|
||||
{WINED3DFMT_S1_UINT_D15_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 15, 1, FALSE},
|
||||
{WINED3DFMT_S8_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
|
||||
{WINED3DFMT_X8D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 0, FALSE},
|
||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 4, FALSE},
|
||||
{WINED3DFMT_D16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
|
||||
{WINED3DFMT_D32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE},
|
||||
{WINED3DFMT_S8_UINT_D24_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
|
||||
{WINED3DFMT_VERTEXDATA, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16_UINT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},
|
||||
{WINED3DFMT_R32_UINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},
|
||||
{WINED3DFMT_R16G16B16A16_SNORM, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},
|
||||
/* Vendor-specific formats */
|
||||
{WINED3DFMT_ATI2N, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_NVHS, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_ATI2N, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },
|
||||
{WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
{WINED3DFMT_NVHS, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },
|
||||
};
|
||||
|
||||
struct wined3d_format_compression_info
|
||||
|
@ -169,7 +169,7 @@ static const struct wined3d_format_vertex_info format_vertex_info[] =
|
|||
{WINED3DFMT_R32G32_FLOAT, WINED3D_FFP_EMIT_FLOAT2, 2, GL_FLOAT, 2, GL_FALSE, sizeof(float)},
|
||||
{WINED3DFMT_R32G32B32_FLOAT, WINED3D_FFP_EMIT_FLOAT3, 3, GL_FLOAT, 3, GL_FALSE, sizeof(float)},
|
||||
{WINED3DFMT_R32G32B32A32_FLOAT, WINED3D_FFP_EMIT_FLOAT4, 4, GL_FLOAT, 4, GL_FALSE, sizeof(float)},
|
||||
{WINED3DFMT_A8R8G8B8, WINED3D_FFP_EMIT_D3DCOLOR, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)},
|
||||
{WINED3DFMT_B8G8R8A8_UNORM, WINED3D_FFP_EMIT_D3DCOLOR, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)},
|
||||
{WINED3DFMT_R8G8B8A8_UINT, WINED3D_FFP_EMIT_UBYTE4, 4, GL_UNSIGNED_BYTE, 4, GL_FALSE, sizeof(BYTE)},
|
||||
{WINED3DFMT_R16G16_SINT, WINED3D_FFP_EMIT_SHORT2, 2, GL_SHORT, 2, GL_FALSE, sizeof(short int)},
|
||||
{WINED3DFMT_R16G16B16A16_SINT, WINED3D_FFP_EMIT_SHORT4, 4, GL_SHORT, 4, GL_FALSE, sizeof(short int)},
|
||||
|
@ -198,8 +198,8 @@ typedef struct {
|
|||
* table.
|
||||
*/
|
||||
static const GlPixelFormatDescTemplate gl_formats_template[] = {
|
||||
/* WINED3DFORMAT internal srgbInternal rtInternal
|
||||
format type
|
||||
/* WINED3DFORMAT internal srgbInternal rtInternal
|
||||
format type
|
||||
flags
|
||||
extension */
|
||||
/* FourCC formats */
|
||||
|
@ -209,276 +209,295 @@ static const GlPixelFormatDescTemplate gl_formats_template[] = {
|
|||
* Macs, so probably the endianess differs. This could be tested as soon as we have a Windows and MacOS on a big
|
||||
* endian machine
|
||||
*/
|
||||
{WINED3DFMT_UYVY, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_UYVY, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0,
|
||||
GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_APPLE,
|
||||
{WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0,
|
||||
GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_APPLE,
|
||||
WINED3DFMT_FLAG_FILTERING,
|
||||
APPLE_YCBCR_422},
|
||||
{WINED3DFMT_YUY2, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_YUY2, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0,
|
||||
GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_REV_APPLE,
|
||||
{WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0,
|
||||
GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_REV_APPLE,
|
||||
WINED3DFMT_FLAG_FILTERING,
|
||||
APPLE_YCBCR_422},
|
||||
{WINED3DFMT_YV12, GL_ALPHA, GL_ALPHA, 0,
|
||||
GL_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_YV12, GL_ALPHA, GL_ALPHA, 0,
|
||||
GL_ALPHA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
EXT_TEXTURE_COMPRESSION_S3TC},
|
||||
{WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
EXT_TEXTURE_COMPRESSION_S3TC},
|
||||
{WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
EXT_TEXTURE_COMPRESSION_S3TC},
|
||||
{WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
EXT_TEXTURE_COMPRESSION_S3TC},
|
||||
{WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
EXT_TEXTURE_COMPRESSION_S3TC},
|
||||
/* IEEE formats */
|
||||
{WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
|
||||
GL_RED, GL_FLOAT,
|
||||
{WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
|
||||
GL_RED, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
{WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0,
|
||||
GL_RED, GL_FLOAT,
|
||||
{WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0,
|
||||
GL_RED, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_RG},
|
||||
{WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
|
||||
GL_RGB, GL_FLOAT,
|
||||
{WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,
|
||||
GL_RGB, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
{WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0,
|
||||
GL_RG, GL_FLOAT,
|
||||
{WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0,
|
||||
GL_RG, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_RG},
|
||||
{WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0,
|
||||
GL_RGBA, GL_FLOAT,
|
||||
{WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0,
|
||||
GL_RGBA, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
/* Float */
|
||||
{WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
|
||||
GL_RED, GL_HALF_FLOAT_ARB,
|
||||
{WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
|
||||
GL_RED, GL_HALF_FLOAT_ARB,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
{WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0,
|
||||
GL_RED, GL_HALF_FLOAT_ARB,
|
||||
{WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0,
|
||||
GL_RED, GL_HALF_FLOAT_ARB,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_RG},
|
||||
{WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
|
||||
GL_RGB, GL_HALF_FLOAT_ARB,
|
||||
{WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,
|
||||
GL_RGB, GL_HALF_FLOAT_ARB,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
{WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0,
|
||||
GL_RG, GL_HALF_FLOAT_ARB,
|
||||
{WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0,
|
||||
GL_RG, GL_HALF_FLOAT_ARB,
|
||||
WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_RG},
|
||||
{WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0,
|
||||
GL_RGBA, GL_HALF_FLOAT_ARB,
|
||||
{WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0,
|
||||
GL_RGBA, GL_HALF_FLOAT_ARB,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
ARB_TEXTURE_FLOAT},
|
||||
/* Palettized formats */
|
||||
{WINED3DFMT_P8, GL_RGBA, GL_RGBA, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
0,
|
||||
{WINED3DFMT_P8_UINT, GL_RGBA, GL_RGBA, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
ARB_FRAGMENT_PROGRAM},
|
||||
{WINED3DFMT_P8, GL_COLOR_INDEX8_EXT, GL_COLOR_INDEX8_EXT, 0,
|
||||
GL_COLOR_INDEX, GL_UNSIGNED_BYTE,
|
||||
0,
|
||||
{WINED3DFMT_P8_UINT, GL_COLOR_INDEX8_EXT, GL_COLOR_INDEX8_EXT, 0,
|
||||
GL_COLOR_INDEX, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
EXT_PALETTED_TEXTURE},
|
||||
/* Standard ARGB formats */
|
||||
{WINED3DFMT_R8G8B8, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGR, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
{WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGR, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A8R8G8B8, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
{WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_X8R8G8B8, GL_RGB8, GL_SRGB8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
{WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R5G6B5, GL_RGB5, GL_RGB5, GL_RGB8,
|
||||
GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
{WINED3DFMT_B5G6R5_UNORM, GL_RGB5, GL_RGB5, GL_RGB8,
|
||||
GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_X1R5G5B5, GL_RGB5, GL_RGB5_A1, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
{WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5_A1, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A1R5G5B5, GL_RGB5_A1, GL_RGB5_A1, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
{WINED3DFMT_B5G5R5A1_UNORM, GL_RGB5_A1, GL_RGB5_A1, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A4R4G4B4, GL_RGBA4, GL_SRGB8_ALPHA8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
{WINED3DFMT_B4G4R4A4_UNORM, GL_RGBA4, GL_SRGB8_ALPHA8_EXT, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING |
|
||||
WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R3G3B2, GL_R3_G3_B2, GL_R3_G3_B2, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE_3_3_2,
|
||||
{WINED3DFMT_B2G3R3_UNORM, GL_R3_G3_B2, GL_R3_G3_B2, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE_3_3_2,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0,
|
||||
GL_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0,
|
||||
GL_ALPHA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_X4R4G4B4, GL_RGB4, GL_RGB4, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV,
|
||||
{WINED3DFMT_B4G4R4X4_UNORM, GL_RGB4, GL_RGB4, 0,
|
||||
GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||
{WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_RGBA8, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R16G16_UNORM, GL_RGB16_EXT, GL_RGB16_EXT, GL_RGBA16_EXT,
|
||||
GL_RGB, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_RGBA8, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
{WINED3DFMT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_X8B8G8R8, GL_RGB8, GL_RGB8, 0,
|
||||
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R16G16_UNORM, GL_RGB16_EXT, GL_RGB16_EXT, GL_RGBA16_EXT,
|
||||
GL_RGB, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A2R10G10B10, GL_RGB10_A2, GL_RGB10_A2, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16_EXT, GL_RGBA16_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16_EXT, GL_RGBA16_EXT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
/* Luminance */
|
||||
{WINED3DFMT_L8, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0,
|
||||
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0,
|
||||
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A8L8, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_A4L4, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
0,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
/* Bump mapping stuff */
|
||||
{WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGR, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGR, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0,
|
||||
GL_DSDT_NV, GL_BYTE,
|
||||
{WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0,
|
||||
GL_DSDT_NV, GL_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
NV_TEXTURE_SHADER},
|
||||
{WINED3DFMT_L6V5U5, GL_RGB5, GL_RGB5, 0,
|
||||
GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||
{WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0,
|
||||
GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_L6V5U5, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0,
|
||||
GL_DSDT_MAG_NV, GL_BYTE,
|
||||
{WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0,
|
||||
GL_DSDT_MAG_NV, GL_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
NV_TEXTURE_SHADER},
|
||||
{WINED3DFMT_X8L8V8U8, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
{WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0,
|
||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_X8L8V8U8, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0,
|
||||
GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV,
|
||||
{WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0,
|
||||
GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
NV_TEXTURE_SHADER},
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0,
|
||||
GL_BGRA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0,
|
||||
GL_BGRA, GL_UNSIGNED_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0,
|
||||
GL_RGBA, GL_BYTE,
|
||||
{WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0,
|
||||
GL_RGBA, GL_BYTE,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
NV_TEXTURE_SHADER},
|
||||
{WINED3DFMT_R16G16_SNORM, GL_RGB16_EXT, GL_RGB16_EXT, 0,
|
||||
GL_BGR, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_R16G16_SNORM, GL_RGB16_EXT, GL_RGB16_EXT, 0,
|
||||
GL_BGR, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0,
|
||||
GL_HILO_NV, GL_SHORT,
|
||||
{WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0,
|
||||
GL_HILO_NV, GL_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
NV_TEXTURE_SHADER},
|
||||
/* Depth stencil formats */
|
||||
{WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D32, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT32_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
{WINED3DFMT_D32_UNORM, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT32_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D15S1, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D15S1, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
{WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
EXT_PACKED_DEPTH_STENCIL},
|
||||
{WINED3DFMT_D24S8, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
{WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
|
||||
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
ARB_FRAMEBUFFER_OBJECT},
|
||||
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D24S8, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
EXT_PACKED_DEPTH_STENCIL},
|
||||
{WINED3DFMT_D24X8, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
|
||||
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
ARB_FRAMEBUFFER_OBJECT},
|
||||
{WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D24X4S4, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_D24X4S4, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
EXT_PACKED_DEPTH_STENCIL},
|
||||
{WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
|
||||
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
ARB_FRAMEBUFFER_OBJECT},
|
||||
{WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_TEXTURE},
|
||||
{WINED3DFMT_L16, GL_LUMINANCE16_EXT, GL_LUMINANCE16_EXT, 0,
|
||||
GL_LUMINANCE, GL_UNSIGNED_SHORT,
|
||||
{WINED3DFMT_L16_UNORM, GL_LUMINANCE16_EXT, GL_LUMINANCE16_EXT, 0,
|
||||
GL_LUMINANCE, GL_UNSIGNED_SHORT,
|
||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
|
||||
WINED3D_GL_EXT_NONE},
|
||||
{WINED3DFMT_D32F_LOCKABLE, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT,
|
||||
{WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
ARB_DEPTH_BUFFER_FLOAT},
|
||||
{WINED3DFMT_D24FS8, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0,
|
||||
GL_DEPTH_STENCIL_EXT, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
|
||||
{WINED3DFMT_S8_UINT_D24_FLOAT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0,
|
||||
GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||
ARB_DEPTH_BUFFER_FLOAT},
|
||||
/* Vendor-specific formats */
|
||||
{WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
0,
|
||||
ATI_TEXTURE_COMPRESSION_3DC},
|
||||
{WINED3DFMT_ATI2N, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
{WINED3DFMT_ATI2N, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, 0,
|
||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
|
||||
0,
|
||||
EXT_TEXTURE_COMPRESSION_RGTC},
|
||||
};
|
||||
|
@ -580,12 +599,12 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct GlPix
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
|
||||
|
||||
status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
|
||||
status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
checkGLcall("Framebuffer format check");
|
||||
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
TRACE("Format %s is supported as FBO color attachment\n", debug_d3dformat(format_desc->format));
|
||||
format_desc->Flags |= WINED3DFMT_FLAG_FBO_ATTACHABLE;
|
||||
|
@ -614,19 +633,19 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct GlPix
|
|||
|
||||
while(glGetError());
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, 0, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, format_desc->rtInternal, 16, 16, 0,
|
||||
format_desc->glFormat, format_desc->glType, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0));
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
|
||||
|
||||
status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
|
||||
status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
checkGLcall("Framebuffer format check");
|
||||
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
TRACE("Format %s rtInternal format is supported as FBO color attachment\n",
|
||||
debug_d3dformat(format_desc->format));
|
||||
|
@ -640,38 +659,36 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct GlPix
|
|||
}
|
||||
}
|
||||
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE_EXT && format_desc->Flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)
|
||||
if (status == GL_FRAMEBUFFER_COMPLETE && format_desc->Flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)
|
||||
{
|
||||
GLuint rb;
|
||||
|
||||
if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT)
|
||||
|| GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
{
|
||||
GL_EXTCALL(glGenRenderbuffersEXT(1, &rb));
|
||||
GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb));
|
||||
GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, 16, 16));
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, rb));
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, rb));
|
||||
gl_info->fbo_ops.glGenRenderbuffers(1, &rb);
|
||||
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, rb);
|
||||
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 16, 16);
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rb);
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb);
|
||||
checkGLcall("RB attachment");
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
if (glGetError() == GL_INVALID_FRAMEBUFFER_OPERATION_EXT)
|
||||
if (glGetError() == GL_INVALID_FRAMEBUFFER_OPERATION)
|
||||
{
|
||||
while(glGetError());
|
||||
TRACE("Format doesn't support post-pixelshader blending.\n");
|
||||
format_desc->Flags &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING;
|
||||
}
|
||||
|
||||
if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT)
|
||||
|| GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL))
|
||||
{
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, 0));
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, 0));
|
||||
GL_EXTCALL(glDeleteRenderbuffersEXT(1, &rb));
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
gl_info->fbo_ops.glDeleteRenderbuffers(1, &rb);
|
||||
checkGLcall("RB cleanup");
|
||||
}
|
||||
}
|
||||
|
@ -691,8 +708,8 @@ static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info)
|
|||
{
|
||||
ENTER_GL();
|
||||
|
||||
GL_EXTCALL(glGenFramebuffersEXT(1, &fbo));
|
||||
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo));
|
||||
gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
|
||||
gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
|
||||
LEAVE_GL();
|
||||
}
|
||||
|
@ -732,7 +749,7 @@ static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info)
|
|||
{
|
||||
ENTER_GL();
|
||||
|
||||
GL_EXTCALL(glDeleteFramebuffersEXT(1, &fbo));
|
||||
gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
|
||||
|
||||
LEAVE_GL();
|
||||
}
|
||||
|
@ -823,10 +840,10 @@ static BOOL check_filter(const struct wined3d_gl_info *gl_info, GLenum internal)
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
GL_EXTCALL(glGenFramebuffersEXT(1, &fbo));
|
||||
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo));
|
||||
GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, buffer, 0));
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
|
||||
gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, buffer, 0);
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||
|
||||
glViewport(0, 0, 16, 1);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
@ -866,8 +883,8 @@ static BOOL check_filter(const struct wined3d_gl_info *gl_info, GLenum internal)
|
|||
ret = TRUE;
|
||||
}
|
||||
|
||||
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
|
||||
GL_EXTCALL(glDeleteFramebuffersEXT(1, &fbo));
|
||||
gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
|
||||
glDeleteTextures(1, &tex);
|
||||
glDeleteTextures(1, &buffer);
|
||||
|
||||
|
@ -997,10 +1014,10 @@ static void apply_format_fixups(struct wined3d_gl_info *gl_info)
|
|||
/* If GL_NV_texture_shader is not supported, those formats are converted, incompatibly
|
||||
* with each other
|
||||
*/
|
||||
idx = getFmtIdx(WINED3DFMT_L6V5U5);
|
||||
idx = getFmtIdx(WINED3DFMT_R5G5_SNORM_L6_UNORM);
|
||||
gl_info->gl_formats[idx].color_fixup = create_color_fixup_desc(
|
||||
1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE);
|
||||
idx = getFmtIdx(WINED3DFMT_X8L8V8U8);
|
||||
idx = getFmtIdx(WINED3DFMT_R8G8_SNORM_L8X8_UNORM);
|
||||
gl_info->gl_formats[idx].color_fixup = create_color_fixup_desc(
|
||||
1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W);
|
||||
idx = getFmtIdx(WINED3DFMT_R8G8B8A8_SNORM);
|
||||
|
@ -1044,7 +1061,7 @@ static void apply_format_fixups(struct wined3d_gl_info *gl_info)
|
|||
|
||||
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
|
||||
{
|
||||
idx = getFmtIdx(WINED3DFMT_A8R8G8B8);
|
||||
idx = getFmtIdx(WINED3DFMT_B8G8R8A8_UNORM);
|
||||
gl_info->gl_formats[idx].gl_vtx_format = GL_BGRA;
|
||||
}
|
||||
|
||||
|
@ -1145,27 +1162,23 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
|
|||
switch (fmt) {
|
||||
#define FMT_TO_STR(fmt) case fmt: return #fmt
|
||||
FMT_TO_STR(WINED3DFMT_UNKNOWN);
|
||||
FMT_TO_STR(WINED3DFMT_R8G8B8);
|
||||
FMT_TO_STR(WINED3DFMT_A8R8G8B8);
|
||||
FMT_TO_STR(WINED3DFMT_X8R8G8B8);
|
||||
FMT_TO_STR(WINED3DFMT_R5G6B5);
|
||||
FMT_TO_STR(WINED3DFMT_X1R5G5B5);
|
||||
FMT_TO_STR(WINED3DFMT_A1R5G5B5);
|
||||
FMT_TO_STR(WINED3DFMT_A4R4G4B4);
|
||||
FMT_TO_STR(WINED3DFMT_R3G3B2);
|
||||
FMT_TO_STR(WINED3DFMT_A8R3G3B2);
|
||||
FMT_TO_STR(WINED3DFMT_X4R4G4B4);
|
||||
FMT_TO_STR(WINED3DFMT_X8B8G8R8);
|
||||
FMT_TO_STR(WINED3DFMT_A2R10G10B10);
|
||||
FMT_TO_STR(WINED3DFMT_A8P8);
|
||||
FMT_TO_STR(WINED3DFMT_P8);
|
||||
FMT_TO_STR(WINED3DFMT_L8);
|
||||
FMT_TO_STR(WINED3DFMT_A8L8);
|
||||
FMT_TO_STR(WINED3DFMT_A4L4);
|
||||
FMT_TO_STR(WINED3DFMT_L6V5U5);
|
||||
FMT_TO_STR(WINED3DFMT_X8L8V8U8);
|
||||
FMT_TO_STR(WINED3DFMT_W11V11U10);
|
||||
FMT_TO_STR(WINED3DFMT_A2W10V10U10);
|
||||
FMT_TO_STR(WINED3DFMT_B8G8R8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B5G5R5X1_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B4G4R4A4_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B2G3R3_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B2G3R3A8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B4G4R4X4_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_R8G8B8X8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_B10G10R10A2_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_P8_UINT_A8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_P8_UINT);
|
||||
FMT_TO_STR(WINED3DFMT_L8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_L8A8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_L4A4_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_R5G5_SNORM_L6_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_R8G8_SNORM_L8X8_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_R10G11B11_SNORM);
|
||||
FMT_TO_STR(WINED3DFMT_R10G10B10_SNORM_A2_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_UYVY);
|
||||
FMT_TO_STR(WINED3DFMT_YUY2);
|
||||
FMT_TO_STR(WINED3DFMT_YV12);
|
||||
|
@ -1178,16 +1191,15 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
|
|||
FMT_TO_STR(WINED3DFMT_G8R8_G8B8);
|
||||
FMT_TO_STR(WINED3DFMT_R8G8_B8G8);
|
||||
FMT_TO_STR(WINED3DFMT_D16_LOCKABLE);
|
||||
FMT_TO_STR(WINED3DFMT_D32);
|
||||
FMT_TO_STR(WINED3DFMT_D15S1);
|
||||
FMT_TO_STR(WINED3DFMT_D24S8);
|
||||
FMT_TO_STR(WINED3DFMT_D24X8);
|
||||
FMT_TO_STR(WINED3DFMT_D24X4S4);
|
||||
FMT_TO_STR(WINED3DFMT_L16);
|
||||
FMT_TO_STR(WINED3DFMT_D32F_LOCKABLE);
|
||||
FMT_TO_STR(WINED3DFMT_D24FS8);
|
||||
FMT_TO_STR(WINED3DFMT_D32_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_S1_UINT_D15_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_S8_UINT_D24_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_X8D24_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_S4X4_UINT_D24_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_L16_UNORM);
|
||||
FMT_TO_STR(WINED3DFMT_S8_UINT_D24_FLOAT);
|
||||
FMT_TO_STR(WINED3DFMT_VERTEXDATA);
|
||||
FMT_TO_STR(WINED3DFMT_CxV8U8);
|
||||
FMT_TO_STR(WINED3DFMT_R8G8_SNORM_Cx);
|
||||
FMT_TO_STR(WINED3DFMT_ATI2N);
|
||||
FMT_TO_STR(WINED3DFMT_NVHU);
|
||||
FMT_TO_STR(WINED3DFMT_NVHS);
|
||||
|
@ -1755,15 +1767,16 @@ const char* debug_d3dpool(WINED3DPOOL Pool) {
|
|||
const char *debug_fbostatus(GLenum status) {
|
||||
switch(status) {
|
||||
#define FBOSTATUS_TO_STR(u) case u: return #u
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_COMPLETE);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED_EXT);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED);
|
||||
FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNDEFINED);
|
||||
#undef FBOSTATUS_TO_STR
|
||||
default:
|
||||
FIXME("Unrecognied FBO status 0x%08x\n", status);
|
||||
|
@ -1781,7 +1794,7 @@ const char *debug_glerror(GLenum error) {
|
|||
GLERROR_TO_STR(GL_STACK_OVERFLOW);
|
||||
GLERROR_TO_STR(GL_STACK_UNDERFLOW);
|
||||
GLERROR_TO_STR(GL_OUT_OF_MEMORY);
|
||||
GLERROR_TO_STR(GL_INVALID_FRAMEBUFFER_OPERATION_EXT);
|
||||
GLERROR_TO_STR(GL_INVALID_FRAMEBUFFER_OPERATION);
|
||||
#undef GLERROR_TO_STR
|
||||
default:
|
||||
FIXME("Unrecognied GL error 0x%08x\n", error);
|
||||
|
@ -2034,19 +2047,19 @@ BOOL getColorBits(const struct GlPixelFormatDesc *format_desc,
|
|||
TRACE("fmt: %s\n", debug_d3dformat(format_desc->format));
|
||||
switch(format_desc->format)
|
||||
{
|
||||
case WINED3DFMT_X8R8G8B8:
|
||||
case WINED3DFMT_R8G8B8:
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8X8_UNORM:
|
||||
case WINED3DFMT_B8G8R8_UNORM:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
case WINED3DFMT_A2R10G10B10:
|
||||
case WINED3DFMT_X1R5G5B5:
|
||||
case WINED3DFMT_A1R5G5B5:
|
||||
case WINED3DFMT_R5G6B5:
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
case WINED3DFMT_R3G3B2:
|
||||
case WINED3DFMT_A8P8:
|
||||
case WINED3DFMT_P8:
|
||||
case WINED3DFMT_B10G10R10A2_UNORM:
|
||||
case WINED3DFMT_B5G5R5X1_UNORM:
|
||||
case WINED3DFMT_B5G5R5A1_UNORM:
|
||||
case WINED3DFMT_B5G6R5_UNORM:
|
||||
case WINED3DFMT_B4G4R4X4_UNORM:
|
||||
case WINED3DFMT_B4G4R4A4_UNORM:
|
||||
case WINED3DFMT_B2G3R3_UNORM:
|
||||
case WINED3DFMT_P8_UINT_A8_UNORM:
|
||||
case WINED3DFMT_P8_UINT:
|
||||
break;
|
||||
default:
|
||||
ERR("Unsupported format: %s\n", debug_d3dformat(format_desc->format));
|
||||
|
@ -2072,13 +2085,13 @@ BOOL getDepthStencilBits(const struct GlPixelFormatDesc *format_desc, short *dep
|
|||
{
|
||||
case WINED3DFMT_D16_LOCKABLE:
|
||||
case WINED3DFMT_D16_UNORM:
|
||||
case WINED3DFMT_D15S1:
|
||||
case WINED3DFMT_D24X8:
|
||||
case WINED3DFMT_D24X4S4:
|
||||
case WINED3DFMT_D24S8:
|
||||
case WINED3DFMT_D24FS8:
|
||||
case WINED3DFMT_D32:
|
||||
case WINED3DFMT_D32F_LOCKABLE:
|
||||
case WINED3DFMT_S1_UINT_D15_UNORM:
|
||||
case WINED3DFMT_X8D24_UNORM:
|
||||
case WINED3DFMT_S4X4_UINT_D24_UNORM:
|
||||
case WINED3DFMT_S8_UINT_D24_UNORM:
|
||||
case WINED3DFMT_S8_UINT_D24_FLOAT:
|
||||
case WINED3DFMT_D32_UNORM:
|
||||
case WINED3DFMT_D32_FLOAT:
|
||||
break;
|
||||
default:
|
||||
FIXME("Unsupported stencil format: %s\n", debug_d3dformat(format_desc->format));
|
||||
|
@ -2096,11 +2109,11 @@ BOOL getDepthStencilBits(const struct GlPixelFormatDesc *format_desc, short *dep
|
|||
/* DirectDraw stuff */
|
||||
WINED3DFORMAT pixelformat_for_depth(DWORD depth) {
|
||||
switch(depth) {
|
||||
case 8: return WINED3DFMT_P8;
|
||||
case 15: return WINED3DFMT_X1R5G5B5;
|
||||
case 16: return WINED3DFMT_R5G6B5;
|
||||
case 24: return WINED3DFMT_X8R8G8B8; /* Robots needs 24bit to be X8R8G8B8 */
|
||||
case 32: return WINED3DFMT_X8R8G8B8; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return X8R8G8B8 */
|
||||
case 8: return WINED3DFMT_P8_UINT;
|
||||
case 15: return WINED3DFMT_B5G5R5X1_UNORM;
|
||||
case 16: return WINED3DFMT_B5G6R5_UNORM;
|
||||
case 24: return WINED3DFMT_B8G8R8X8_UNORM; /* Robots needs 24bit to be WINED3DFMT_B8G8R8X8_UNORM */
|
||||
case 32: return WINED3DFMT_B8G8R8X8_UNORM; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return WINED3DFMT_B8G8R8X8_UNORM */
|
||||
default: return WINED3DFMT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
@ -2531,9 +2544,11 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
|
|||
} else {
|
||||
settings->sRGB_write = 0;
|
||||
}
|
||||
if(device->vs_clipping || !use_vs(stateblock)) {
|
||||
if(device->vs_clipping || !use_vs(stateblock) || !stateblock->renderState[WINED3DRS_CLIPPING] ||
|
||||
!stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]) {
|
||||
/* No need to emulate clipplanes if GL supports native vertex shader clipping or if
|
||||
* the fixed function vertex pipeline is used(which always supports clipplanes)
|
||||
* the fixed function vertex pipeline is used(which always supports clipplanes), or
|
||||
* if no clipplane is enabled
|
||||
*/
|
||||
settings->emul_clipplanes = 0;
|
||||
} else {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2004 Jason Edmeades
|
||||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -74,6 +75,7 @@ static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclarat
|
|||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->elements);
|
||||
This->parent_ops->wined3d_object_destroyed(This->parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
|
@ -129,7 +131,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
|
|||
case WINED3DFMT_R32G32_FLOAT:
|
||||
case WINED3DFMT_R32G32B32_FLOAT:
|
||||
case WINED3DFMT_R32G32B32A32_FLOAT:
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UINT:
|
||||
case WINED3DFMT_R16G16_SINT:
|
||||
case WINED3DFMT_R16G16B16A16_SINT:
|
||||
|
@ -173,7 +175,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
|
|||
{
|
||||
case WINED3DFMT_R32G32B32_FLOAT:
|
||||
case WINED3DFMT_R32G32B32A32_FLOAT:
|
||||
case WINED3DFMT_A8R8G8B8:
|
||||
case WINED3DFMT_B8G8R8A8_UNORM:
|
||||
case WINED3DFMT_R8G8B8A8_UINT:
|
||||
case WINED3DFMT_R16G16B16A16_SINT:
|
||||
case WINED3DFMT_R8G8B8A8_UNORM:
|
||||
|
@ -190,86 +192,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
|
|||
}
|
||||
}
|
||||
|
||||
HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count)
|
||||
{
|
||||
HRESULT hr = WINED3D_OK;
|
||||
unsigned int i;
|
||||
char isPreLoaded[MAX_STREAMS];
|
||||
|
||||
TRACE("(%p) : d3d version %d\n", This, ((IWineD3DImpl *)This->wineD3DDevice->wineD3D)->dxVersion);
|
||||
memset(isPreLoaded, 0, sizeof(isPreLoaded));
|
||||
|
||||
if (TRACE_ON(d3d_decl)) {
|
||||
for (i = 0; i < element_count; ++i) {
|
||||
dump_wined3dvertexelement(elements+i);
|
||||
}
|
||||
}
|
||||
|
||||
This->element_count = element_count;
|
||||
This->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->elements) * element_count);
|
||||
if (!This->elements)
|
||||
{
|
||||
ERR("Memory allocation failed\n");
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
/* Do some static analysis on the elements to make reading the declaration more comfortable
|
||||
* for the drawing code
|
||||
*/
|
||||
This->num_streams = 0;
|
||||
This->position_transformed = FALSE;
|
||||
for (i = 0; i < element_count; ++i) {
|
||||
struct wined3d_vertex_declaration_element *e = &This->elements[i];
|
||||
|
||||
e->format_desc = getFormatDescEntry(elements[i].format, &This->wineD3DDevice->adapter->gl_info);
|
||||
e->ffp_valid = declaration_element_valid_ffp(&elements[i]);
|
||||
e->input_slot = elements[i].input_slot;
|
||||
e->offset = elements[i].offset;
|
||||
e->output_slot = elements[i].output_slot;
|
||||
e->method = elements[i].method;
|
||||
e->usage = elements[i].usage;
|
||||
e->usage_idx = elements[i].usage_idx;
|
||||
|
||||
if (e->usage == WINED3DDECLUSAGE_POSITIONT) This->position_transformed = TRUE;
|
||||
|
||||
/* Find the Streams used in the declaration. The vertex buffers have to be loaded
|
||||
* when drawing, but filter tesselation pseudo streams
|
||||
*/
|
||||
if (e->input_slot >= MAX_STREAMS) continue;
|
||||
|
||||
if (!e->format_desc->gl_vtx_format)
|
||||
{
|
||||
FIXME("The application tries to use an unsupported format (%s), returning E_FAIL\n",
|
||||
debug_d3dformat(elements[i].format));
|
||||
/* The caller will release the vdecl, which will free This->elements */
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (e->offset & 0x3)
|
||||
{
|
||||
WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL\n", i, e->offset);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!isPreLoaded[e->input_slot])
|
||||
{
|
||||
This->streams[This->num_streams] = e->input_slot;
|
||||
This->num_streams++;
|
||||
isPreLoaded[e->input_slot] = 1;
|
||||
}
|
||||
|
||||
if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT)
|
||||
{
|
||||
if (!GL_SUPPORT(ARB_HALF_FLOAT_VERTEX)) This->half_float_conv_needed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("Returning\n");
|
||||
return hr;
|
||||
}
|
||||
|
||||
const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl =
|
||||
static const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DVertexDeclarationImpl_QueryInterface,
|
||||
|
@ -279,3 +202,84 @@ const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl =
|
|||
IWineD3DVertexDeclarationImpl_GetParent,
|
||||
IWineD3DVertexDeclarationImpl_GetDevice,
|
||||
};
|
||||
|
||||
HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
WORD preloaded = 0; /* MAX_STREAMS, 16 */
|
||||
unsigned int i;
|
||||
|
||||
if (TRACE_ON(d3d_decl))
|
||||
{
|
||||
for (i = 0; i < element_count; ++i)
|
||||
{
|
||||
dump_wined3dvertexelement(elements + i);
|
||||
}
|
||||
}
|
||||
|
||||
declaration->lpVtbl = &IWineD3DVertexDeclaration_Vtbl;
|
||||
declaration->ref = 1;
|
||||
declaration->parent = parent;
|
||||
declaration->parent_ops = parent_ops;
|
||||
declaration->wineD3DDevice = device;
|
||||
declaration->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*declaration->elements) * element_count);
|
||||
if (!declaration->elements)
|
||||
{
|
||||
ERR("Failed to allocate elements memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
declaration->element_count = element_count;
|
||||
|
||||
/* Do some static analysis on the elements to make reading the
|
||||
* declaration more comfortable for the drawing code. */
|
||||
for (i = 0; i < element_count; ++i)
|
||||
{
|
||||
struct wined3d_vertex_declaration_element *e = &declaration->elements[i];
|
||||
|
||||
e->format_desc = getFormatDescEntry(elements[i].format, gl_info);
|
||||
e->ffp_valid = declaration_element_valid_ffp(&elements[i]);
|
||||
e->input_slot = elements[i].input_slot;
|
||||
e->offset = elements[i].offset;
|
||||
e->output_slot = elements[i].output_slot;
|
||||
e->method = elements[i].method;
|
||||
e->usage = elements[i].usage;
|
||||
e->usage_idx = elements[i].usage_idx;
|
||||
|
||||
if (e->usage == WINED3DDECLUSAGE_POSITIONT) declaration->position_transformed = TRUE;
|
||||
|
||||
/* Find the streams used in the declaration. The vertex buffers have
|
||||
* to be loaded when drawing, but filter tesselation pseudo streams. */
|
||||
if (e->input_slot >= MAX_STREAMS) continue;
|
||||
|
||||
if (!e->format_desc->gl_vtx_format)
|
||||
{
|
||||
FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n",
|
||||
debug_d3dformat(elements[i].format));
|
||||
HeapFree(GetProcessHeap(), 0, declaration->elements);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (e->offset & 0x3)
|
||||
{
|
||||
WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL.\n", i, e->offset);
|
||||
HeapFree(GetProcessHeap(), 0, declaration->elements);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!(preloaded & (1 << e->input_slot)))
|
||||
{
|
||||
declaration->streams[declaration->num_streams] = e->input_slot;
|
||||
++declaration->num_streams;
|
||||
preloaded |= 1 << e->input_slot;
|
||||
}
|
||||
|
||||
if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT)
|
||||
{
|
||||
if (!gl_info->supported[ARB_HALF_FLOAT_VERTEX]) declaration->half_float_conv_needed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2006 Ivan Gyurdiev
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -174,6 +175,7 @@ static ULONG WINAPI IWineD3DVertexShaderImpl_Release(IWineD3DVertexShader *iface
|
|||
if (!refcount)
|
||||
{
|
||||
shader_cleanup((IWineD3DBaseShader *)iface);
|
||||
This->baseShader.parent_ops->wined3d_object_destroyed(This->baseShader.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
|
@ -187,7 +189,7 @@ static ULONG WINAPI IWineD3DVertexShaderImpl_Release(IWineD3DVertexShader *iface
|
|||
static HRESULT WINAPI IWineD3DVertexShaderImpl_GetParent(IWineD3DVertexShader *iface, IUnknown** parent){
|
||||
IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface;
|
||||
|
||||
*parent = This->parent;
|
||||
*parent = This->baseShader.parent;
|
||||
IUnknown_AddRef(*parent);
|
||||
TRACE("(%p) : returning %p\n", This, *parent);
|
||||
return WINED3D_OK;
|
||||
|
@ -222,50 +224,46 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader*
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
/* Note that for vertex shaders CompileShader isn't called until the
|
||||
* shader is first used. The reason for this is that we need the vertex
|
||||
* declaration the shader will be used with in order to determine if
|
||||
* the data in a register is of type D3DCOLOR, and needs swizzling. */
|
||||
static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature)
|
||||
static HRESULT vertexshader_set_function(IWineD3DVertexShaderImpl *shader,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature)
|
||||
{
|
||||
IWineD3DVertexShaderImpl *This =(IWineD3DVertexShaderImpl *)iface;
|
||||
IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *) This->baseShader.device;
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct wined3d_shader_frontend *fe;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
|
||||
shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
|
||||
|
||||
TRACE("(%p) : pFunction %p\n", iface, pFunction);
|
||||
TRACE("shader %p, byte_code %p, output_signature %p.\n", shader, byte_code, output_signature);
|
||||
|
||||
fe = shader_select_frontend(*pFunction);
|
||||
fe = shader_select_frontend(*byte_code);
|
||||
if (!fe)
|
||||
{
|
||||
FIXME("Unable to find frontend for shader.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
This->baseShader.frontend = fe;
|
||||
This->baseShader.frontend_data = fe->shader_init(pFunction, output_signature);
|
||||
if (!This->baseShader.frontend_data)
|
||||
shader->baseShader.frontend = fe;
|
||||
shader->baseShader.frontend_data = fe->shader_init(byte_code, output_signature);
|
||||
if (!shader->baseShader.frontend_data)
|
||||
{
|
||||
FIXME("Failed to initialize frontend.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* First pass: trace shader */
|
||||
if (TRACE_ON(d3d_shader)) shader_trace_init(fe, This->baseShader.frontend_data, pFunction);
|
||||
if (TRACE_ON(d3d_shader)) shader_trace_init(fe, shader->baseShader.frontend_data, byte_code);
|
||||
|
||||
/* Initialize immediate constant lists */
|
||||
list_init(&This->baseShader.constantsF);
|
||||
list_init(&This->baseShader.constantsB);
|
||||
list_init(&This->baseShader.constantsI);
|
||||
list_init(&shader->baseShader.constantsF);
|
||||
list_init(&shader->baseShader.constantsB);
|
||||
list_init(&shader->baseShader.constantsI);
|
||||
|
||||
/* Second pass: figure out registers used, semantics, etc.. */
|
||||
This->min_rel_offset = GL_LIMITS(vshader_constantsF);
|
||||
This->max_rel_offset = 0;
|
||||
hr = shader_get_registers_used((IWineD3DBaseShader*) This, fe,
|
||||
reg_maps, This->attributes, NULL, This->output_signature,
|
||||
pFunction, GL_LIMITS(vshader_constantsF));
|
||||
shader->min_rel_offset = gl_info->max_vshader_constantsF;
|
||||
shader->max_rel_offset = 0;
|
||||
hr = shader_get_registers_used((IWineD3DBaseShader *)shader, fe,
|
||||
reg_maps, shader->attributes, NULL, shader->output_signature,
|
||||
byte_code, gl_info->max_vshader_constantsF);
|
||||
if (hr != WINED3D_OK) return hr;
|
||||
|
||||
if (output_signature)
|
||||
|
@ -274,34 +272,42 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader
|
|||
{
|
||||
struct wined3d_shader_signature_element *e = &output_signature->elements[i];
|
||||
reg_maps->output_registers |= 1 << e->register_idx;
|
||||
This->output_signature[e->register_idx] = *e;
|
||||
shader->output_signature[e->register_idx] = *e;
|
||||
}
|
||||
}
|
||||
|
||||
vshader_set_limits(This);
|
||||
vshader_set_limits(shader);
|
||||
|
||||
if (deviceImpl->vs_selected_mode == SHADER_ARB
|
||||
&& ((GLINFO_LOCATION).quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT)
|
||||
&& This->min_rel_offset <= This->max_rel_offset)
|
||||
if (device->vs_selected_mode == SHADER_ARB
|
||||
&& (gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT)
|
||||
&& shader->min_rel_offset <= shader->max_rel_offset)
|
||||
{
|
||||
if(This->max_rel_offset - This->min_rel_offset > 127) {
|
||||
if (shader->max_rel_offset - shader->min_rel_offset > 127)
|
||||
{
|
||||
FIXME("The difference between the minimum and maximum relative offset is > 127\n");
|
||||
FIXME("Which this OpenGL implementation does not support. Try using GLSL\n");
|
||||
FIXME("Min: %d, Max: %d\n", This->min_rel_offset, This->max_rel_offset);
|
||||
} else if(This->max_rel_offset - This->min_rel_offset > 63) {
|
||||
This->rel_offset = This->min_rel_offset + 63;
|
||||
} else if(This->max_rel_offset > 63) {
|
||||
This->rel_offset = This->min_rel_offset;
|
||||
} else {
|
||||
This->rel_offset = 0;
|
||||
FIXME("Min: %d, Max: %d\n", shader->min_rel_offset, shader->max_rel_offset);
|
||||
}
|
||||
else if (shader->max_rel_offset - shader->min_rel_offset > 63)
|
||||
{
|
||||
shader->rel_offset = shader->min_rel_offset + 63;
|
||||
}
|
||||
else if (shader->max_rel_offset > 63)
|
||||
{
|
||||
shader->rel_offset = shader->min_rel_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
shader->rel_offset = 0;
|
||||
}
|
||||
}
|
||||
This->baseShader.load_local_constsF = This->baseShader.reg_maps.usesrelconstF && !list_empty(&This->baseShader.constantsF);
|
||||
shader->baseShader.load_local_constsF = shader->baseShader.reg_maps.usesrelconstF
|
||||
&& !list_empty(&shader->baseShader.constantsF);
|
||||
|
||||
/* copy the function ... because it will certainly be released by application */
|
||||
This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength);
|
||||
if (!This->baseShader.function) return E_OUTOFMEMORY;
|
||||
memcpy(This->baseShader.function, pFunction, This->baseShader.functionLength);
|
||||
shader->baseShader.function = HeapAlloc(GetProcessHeap(), 0, shader->baseShader.functionLength);
|
||||
if (!shader->baseShader.function) return E_OUTOFMEMORY;
|
||||
memcpy(shader->baseShader.function, byte_code, shader->baseShader.functionLength);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -332,7 +338,7 @@ static HRESULT WINAPI IWIneD3DVertexShaderImpl_SetLocalConstantsF(IWineD3DVertex
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =
|
||||
static const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
IWineD3DVertexShaderImpl_QueryInterface,
|
||||
|
@ -341,10 +347,9 @@ const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =
|
|||
/*** IWineD3DBase methods ***/
|
||||
IWineD3DVertexShaderImpl_GetParent,
|
||||
/*** IWineD3DBaseShader methods ***/
|
||||
IWineD3DVertexShaderImpl_SetFunction,
|
||||
/*** IWineD3DVertexShader methods ***/
|
||||
IWineD3DVertexShaderImpl_GetDevice,
|
||||
IWineD3DVertexShaderImpl_GetFunction,
|
||||
/*** IWineD3DVertexShader methods ***/
|
||||
IWIneD3DVertexShaderImpl_SetLocalConstantsF
|
||||
};
|
||||
|
||||
|
@ -352,3 +357,25 @@ void find_vs_compile_args(IWineD3DVertexShaderImpl *shader, IWineD3DStateBlockIm
|
|||
args->fog_src = stateblock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE ? VS_FOG_COORD : VS_FOG_Z;
|
||||
args->swizzle_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.swizzle_map;
|
||||
}
|
||||
|
||||
HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (!byte_code) return WINED3DERR_INVALIDCALL;
|
||||
|
||||
shader->lpVtbl = &IWineD3DVertexShader_Vtbl;
|
||||
shader_init(&shader->baseShader, device, parent, parent_ops);
|
||||
|
||||
hr = vertexshader_set_function(shader, byte_code, output_signature);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to set function, hr %#x.\n", hr);
|
||||
shader_cleanup((IWineD3DBaseShader *)shader);
|
||||
return hr;
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright 2002-2005 Jason Edmeades
|
||||
* Copyright 2002-2005 Raphael Junqueira
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -122,6 +123,7 @@ static ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) {
|
|||
ref = InterlockedDecrement(&This->resource.ref);
|
||||
if (ref == 0) {
|
||||
resource_cleanup((IWineD3DResource *)iface);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
|
@ -264,7 +266,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
|
|||
|
||||
if (containerType == WINED3DRTYPE_VOLUMETEXTURE) {
|
||||
IWineD3DBaseTextureImpl* pTexture = (IWineD3DBaseTextureImpl*) cont;
|
||||
pTexture->baseTexture.dirty = TRUE;
|
||||
pTexture->baseTexture.texture_rgb.dirty = TRUE;
|
||||
pTexture->baseTexture.texture_srgb.dirty = TRUE;
|
||||
} else {
|
||||
FIXME("Set dirty on container type %d\n", containerType);
|
||||
}
|
||||
|
@ -346,7 +349,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
|
|||
|
||||
}
|
||||
|
||||
const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
|
||||
static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DVolumeImpl_QueryInterface,
|
||||
|
@ -372,3 +375,40 @@ const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
|
|||
IWineD3DVolumeImpl_LoadTexture,
|
||||
IWineD3DVolumeImpl_SetContainer
|
||||
};
|
||||
|
||||
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
|
||||
UINT height, UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool,
|
||||
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
HRESULT hr;
|
||||
|
||||
if (!gl_info->supported[EXT_TEXTURE3D])
|
||||
{
|
||||
WARN("Volume cannot be created - no volume texture support.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
volume->lpVtbl = &IWineD3DVolume_Vtbl;
|
||||
|
||||
hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device,
|
||||
width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize resource, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
volume->currentDesc.Width = width;
|
||||
volume->currentDesc.Height = height;
|
||||
volume->currentDesc.Depth = depth;
|
||||
volume->lockable = TRUE;
|
||||
volume->locked = FALSE;
|
||||
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
|
||||
volume->dirty = TRUE;
|
||||
|
||||
volume_add_dirty_box((IWineD3DVolume *)volume, NULL);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright 2002-2005 Jason Edmeades
|
||||
* Copyright 2002-2005 Raphael Junqueira
|
||||
* Copyright 2005 Oliver Stieber
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -52,7 +53,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
|
|||
|
||||
/* If the texture is marked dirty or the srgb sampler setting has changed
|
||||
* since the last load then reload the volumes. */
|
||||
if (This->baseTexture.dirty)
|
||||
if (This->baseTexture.texture_rgb.dirty)
|
||||
{
|
||||
for (i = 0; i < This->baseTexture.levels; ++i)
|
||||
{
|
||||
|
@ -73,10 +74,10 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
|
|||
}
|
||||
|
||||
/* No longer dirty */
|
||||
This->baseTexture.dirty = FALSE;
|
||||
This->baseTexture.texture_rgb.dirty = FALSE;
|
||||
}
|
||||
|
||||
static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This, D3DCB_DESTROYVOLUMEFN volume_destroy_cb)
|
||||
static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -90,103 +91,12 @@ static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This, D3DCB_DESTROY
|
|||
{
|
||||
/* Cleanup the container. */
|
||||
IWineD3DVolume_SetContainer(volume, NULL);
|
||||
volume_destroy_cb(volume);
|
||||
IWineD3DVolume_Release(volume);
|
||||
}
|
||||
}
|
||||
basetexture_cleanup((IWineD3DBaseTexture *)This);
|
||||
}
|
||||
|
||||
HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, UINT depth, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT tmp_w, tmp_h, tmp_d;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (!GL_SUPPORT(EXT_TEXTURE3D))
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping. */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))
|
||||
{
|
||||
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(max(max(width, height), depth)) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,
|
||||
WINED3DRTYPE_VOLUMETEXTURE, device, 0, usage, format_desc, pool, parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Is NP2 support for volumes needed? */
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = width;
|
||||
tmp_h = height;
|
||||
tmp_d = depth;
|
||||
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Create the volume. */
|
||||
hr = IWineD3DDeviceParent_CreateVolume(device->device_parent, parent,
|
||||
tmp_w, tmp_h, tmp_d, format, pool, usage, &texture->volumes[i]);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Creating a volume for the volume texture failed, hr %#x.\n", hr);
|
||||
texture->volumes[i] = NULL;
|
||||
volumetexture_cleanup(texture, D3DCB_DefaultDestroyVolume);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Set its container to this texture. */
|
||||
IWineD3DVolume_SetContainer(texture->volumes[i], (IWineD3DBase *)texture);
|
||||
|
||||
/* Calculate the next mipmap level. */
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
tmp_h = max(1, tmp_h >> 1);
|
||||
tmp_d = max(1, tmp_d >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = volumetexture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
#undef GLINFO_LOCATION
|
||||
|
||||
/* *******************************************
|
||||
|
@ -223,8 +133,11 @@ static ULONG WINAPI IWineD3DVolumeTextureImpl_Release(IWineD3DVolumeTexture *ifa
|
|||
ULONG ref;
|
||||
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
|
||||
ref = InterlockedDecrement(&This->resource.ref);
|
||||
if (ref == 0) {
|
||||
IWineD3DVolumeTexture_Destroy(iface, D3DCB_DefaultDestroyVolume);
|
||||
if (!ref)
|
||||
{
|
||||
volumetexture_cleanup(This);
|
||||
This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
@ -344,14 +257,6 @@ static BOOL WINAPI IWineD3DVolumeTextureImpl_IsCondNP2(IWineD3DVolumeTexture *if
|
|||
/* *******************************************
|
||||
IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow
|
||||
******************************************* */
|
||||
static void WINAPI IWineD3DVolumeTextureImpl_Destroy(IWineD3DVolumeTexture *iface, D3DCB_DESTROYVOLUMEFN D3DCB_DestroyVolume) {
|
||||
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
|
||||
|
||||
volumetexture_cleanup(This, D3DCB_DestroyVolume);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetLevelDesc(IWineD3DVolumeTexture *iface, UINT Level,WINED3DVOLUME_DESC *pDesc) {
|
||||
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
|
||||
if (Level < This->baseTexture.levels) {
|
||||
|
@ -407,14 +312,15 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture
|
|||
|
||||
static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, CONST WINED3DBOX* pDirtyBox) {
|
||||
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
|
||||
This->baseTexture.dirty = TRUE;
|
||||
This->baseTexture.texture_rgb.dirty = TRUE;
|
||||
This->baseTexture.texture_srgb.dirty = TRUE;
|
||||
TRACE("(%p) : dirtyfication of volume Level (0)\n", This);
|
||||
volume_add_dirty_box(This->volumes[0], pDirtyBox);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
|
||||
static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DVolumeTextureImpl_QueryInterface,
|
||||
|
@ -445,10 +351,103 @@ const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
|
|||
IWineD3DVolumeTextureImpl_GetTextureDimensions,
|
||||
IWineD3DVolumeTextureImpl_IsCondNP2,
|
||||
/* volume texture */
|
||||
IWineD3DVolumeTextureImpl_Destroy,
|
||||
IWineD3DVolumeTextureImpl_GetLevelDesc,
|
||||
IWineD3DVolumeTextureImpl_GetVolumeLevel,
|
||||
IWineD3DVolumeTextureImpl_LockBox,
|
||||
IWineD3DVolumeTextureImpl_UnlockBox,
|
||||
IWineD3DVolumeTextureImpl_AddDirtyBox
|
||||
};
|
||||
|
||||
HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height,
|
||||
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format,
|
||||
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
UINT tmp_w, tmp_h, tmp_d;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
/* TODO: It should only be possible to create textures for formats
|
||||
* that are reported as supported. */
|
||||
if (WINED3DFMT_UNKNOWN >= format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (!gl_info->supported[EXT_TEXTURE3D])
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping. */
|
||||
if (usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
{
|
||||
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
|
||||
{
|
||||
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (levels > 1)
|
||||
{
|
||||
WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
levels = 1;
|
||||
}
|
||||
else if (!levels)
|
||||
{
|
||||
levels = wined3d_log2i(max(max(width, height), depth)) + 1;
|
||||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &IWineD3DVolumeTexture_Vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_VOLUMETEXTURE,
|
||||
device, 0, usage, format_desc, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Is NP2 support for volumes needed? */
|
||||
texture->baseTexture.pow2Matrix[0] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[5] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[10] = 1.0f;
|
||||
texture->baseTexture.pow2Matrix[15] = 1.0f;
|
||||
|
||||
/* Generate all the surfaces. */
|
||||
tmp_w = width;
|
||||
tmp_h = height;
|
||||
tmp_d = depth;
|
||||
|
||||
for (i = 0; i < texture->baseTexture.levels; ++i)
|
||||
{
|
||||
/* Create the volume. */
|
||||
hr = IWineD3DDeviceParent_CreateVolume(device->device_parent, parent,
|
||||
tmp_w, tmp_h, tmp_d, format, pool, usage, &texture->volumes[i]);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Creating a volume for the volume texture failed, hr %#x.\n", hr);
|
||||
texture->volumes[i] = NULL;
|
||||
volumetexture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Set its container to this texture. */
|
||||
IWineD3DVolume_SetContainer(texture->volumes[i], (IWineD3DBase *)texture);
|
||||
|
||||
/* Calculate the next mipmap level. */
|
||||
tmp_w = max(1, tmp_w >> 1);
|
||||
tmp_h = max(1, tmp_h >> 1);
|
||||
tmp_d = max(1, tmp_d >> 1);
|
||||
}
|
||||
texture->baseTexture.internal_preload = volumetexture_internal_preload;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -802,343 +802,361 @@ typedef void GLvoid;
|
|||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
#define GL_MULTISAMPLE_BIT 0x20000000
|
||||
|
||||
void (WINE_GLAPI *glAccum) (GLenum op, GLfloat value);
|
||||
void (WINE_GLAPI *glAlphaFunc) (GLenum func, GLclampf ref);
|
||||
GLboolean (WINE_GLAPI *glAreTexturesResident) (GLsizei n, const GLuint* textures, GLboolean* residences);
|
||||
void (WINE_GLAPI *glArrayElement) (GLint i);
|
||||
void (WINE_GLAPI *glBegin) (GLenum mode);
|
||||
void (WINE_GLAPI *glBindTexture) (GLenum target, GLuint texture);
|
||||
void (WINE_GLAPI *glBitmap) (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte* bitmap);
|
||||
void (WINE_GLAPI *glBlendFunc) (GLenum sfactor, GLenum dfactor);
|
||||
void (WINE_GLAPI *glCallList) (GLuint list);
|
||||
void (WINE_GLAPI *glCallLists) (GLsizei n, GLenum type, const GLvoid* lists);
|
||||
void (WINE_GLAPI *glClear) (GLbitfield mask);
|
||||
void (WINE_GLAPI *glClearAccum) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void (WINE_GLAPI *glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void (WINE_GLAPI *glClearDepth) (GLclampd depth);
|
||||
void (WINE_GLAPI *glClearIndex) (GLfloat c);
|
||||
void (WINE_GLAPI *glClearStencil) (GLint s);
|
||||
void (WINE_GLAPI *glClipPlane) (GLenum plane, const GLdouble* equation);
|
||||
void (WINE_GLAPI *glColor3b) (GLbyte red, GLbyte green, GLbyte blue);
|
||||
void (WINE_GLAPI *glColor3bv) (const GLbyte* v);
|
||||
void (WINE_GLAPI *glColor3d) (GLdouble red, GLdouble green, GLdouble blue);
|
||||
void (WINE_GLAPI *glColor3dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glColor3f) (GLfloat red, GLfloat green, GLfloat blue);
|
||||
void (WINE_GLAPI *glColor3fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glColor3i) (GLint red, GLint green, GLint blue);
|
||||
void (WINE_GLAPI *glColor3iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glColor3s) (GLshort red, GLshort green, GLshort blue);
|
||||
void (WINE_GLAPI *glColor3sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glColor3ub) (GLubyte red, GLubyte green, GLubyte blue);
|
||||
void (WINE_GLAPI *glColor3ubv) (const GLubyte* v);
|
||||
void (WINE_GLAPI *glColor3ui) (GLuint red, GLuint green, GLuint blue);
|
||||
void (WINE_GLAPI *glColor3uiv) (const GLuint* v);
|
||||
void (WINE_GLAPI *glColor3us) (GLushort red, GLushort green, GLushort blue);
|
||||
void (WINE_GLAPI *glColor3usv) (const GLushort* v);
|
||||
void (WINE_GLAPI *glColor4b) (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
|
||||
void (WINE_GLAPI *glColor4bv) (const GLbyte* v);
|
||||
void (WINE_GLAPI *glColor4d) (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
|
||||
void (WINE_GLAPI *glColor4dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glColor4f) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void (WINE_GLAPI *glColor4fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glColor4i) (GLint red, GLint green, GLint blue, GLint alpha);
|
||||
void (WINE_GLAPI *glColor4iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glColor4s) (GLshort red, GLshort green, GLshort blue, GLshort alpha);
|
||||
void (WINE_GLAPI *glColor4sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glColor4ub) (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
void (WINE_GLAPI *glColor4ubv) (const GLubyte* v);
|
||||
void (WINE_GLAPI *glColor4ui) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
void (WINE_GLAPI *glColor4uiv) (const GLuint* v);
|
||||
void (WINE_GLAPI *glColor4us) (GLushort red, GLushort green, GLushort blue, GLushort alpha);
|
||||
void (WINE_GLAPI *glColor4usv) (const GLushort* v);
|
||||
void (WINE_GLAPI *glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void (WINE_GLAPI *glColorMaterial) (GLenum face, GLenum mode);
|
||||
void (WINE_GLAPI *glColorPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glCopyPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
void (WINE_GLAPI *glCopyTexImage1D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void (WINE_GLAPI *glCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void (WINE_GLAPI *glCopyTexSubImage1D) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void (WINE_GLAPI *glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (WINE_GLAPI *glCullFace) (GLenum mode);
|
||||
void (WINE_GLAPI *glDeleteLists) (GLuint list, GLsizei range);
|
||||
void (WINE_GLAPI *glDeleteTextures) (GLsizei n, const GLuint* textures);
|
||||
void (WINE_GLAPI *glDepthFunc) (GLenum func);
|
||||
void (WINE_GLAPI *glDepthMask) (GLboolean flag);
|
||||
void (WINE_GLAPI *glDepthRange) (GLclampd nearParam, GLclampd farParam);
|
||||
void (WINE_GLAPI *glDisable) (GLenum cap);
|
||||
void (WINE_GLAPI *glDisableWINE) (GLenum cap);
|
||||
void (WINE_GLAPI *glDisableClientState) (GLenum array);
|
||||
void (WINE_GLAPI *glDrawArrays) (GLenum mode, GLint first, GLsizei count);
|
||||
void (WINE_GLAPI *glDrawBuffer) (GLenum mode);
|
||||
void (WINE_GLAPI *glDrawElements) (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
void (WINE_GLAPI *glDrawPixels) (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void (WINE_GLAPI *glEdgeFlag) (GLboolean flag);
|
||||
void (WINE_GLAPI *glEdgeFlagPointer) (GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glEdgeFlagv) (const GLboolean* flag);
|
||||
void (WINE_GLAPI *glEnable) (GLenum cap);
|
||||
void (WINE_GLAPI *glEnableWINE) (GLenum cap);
|
||||
void (WINE_GLAPI *glEnableClientState) (GLenum array);
|
||||
void (WINE_GLAPI *glEnd) ();
|
||||
void (WINE_GLAPI *glEndList) ();
|
||||
void (WINE_GLAPI *glEvalCoord1d) (GLdouble u);
|
||||
void (WINE_GLAPI *glEvalCoord1dv) (const GLdouble* u);
|
||||
void (WINE_GLAPI *glEvalCoord1f) (GLfloat u);
|
||||
void (WINE_GLAPI *glEvalCoord1fv) (const GLfloat* u);
|
||||
void (WINE_GLAPI *glEvalCoord2d) (GLdouble u, GLdouble v);
|
||||
void (WINE_GLAPI *glEvalCoord2dv) (const GLdouble* u);
|
||||
void (WINE_GLAPI *glEvalCoord2f) (GLfloat u, GLfloat v);
|
||||
void (WINE_GLAPI *glEvalCoord2fv) (const GLfloat* u);
|
||||
void (WINE_GLAPI *glEvalMesh1) (GLenum mode, GLint i1, GLint i2);
|
||||
void (WINE_GLAPI *glEvalMesh2) (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
void (WINE_GLAPI *glEvalPoint1) (GLint i);
|
||||
void (WINE_GLAPI *glEvalPoint2) (GLint i, GLint j);
|
||||
void (WINE_GLAPI *glFeedbackBuffer) (GLsizei size, GLenum type, GLfloat* buffer);
|
||||
void (WINE_GLAPI *glFogf) (GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glFogfv) (GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glFogi) (GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glFogiv) (GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glFrontFace) (GLenum mode);
|
||||
void (WINE_GLAPI *glFrustum) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
GLuint (WINE_GLAPI *glGenLists) (GLsizei range);
|
||||
void (WINE_GLAPI *glGenTextures) (GLsizei n, GLuint* textures);
|
||||
void (WINE_GLAPI *glGetBooleanv) (GLenum pname, GLboolean* params);
|
||||
void (WINE_GLAPI *glGetClipPlane) (GLenum plane, GLdouble* equation);
|
||||
void (WINE_GLAPI *glGetDoublev) (GLenum pname, GLdouble* params);
|
||||
GLenum (WINE_GLAPI *glGetError) ();
|
||||
void (WINE_GLAPI *glGetFloatv) (GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetIntegerv) (GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetLightfv) (GLenum light, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetLightiv) (GLenum light, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetMapdv) (GLenum target, GLenum query, GLdouble* v);
|
||||
void (WINE_GLAPI *glGetMapfv) (GLenum target, GLenum query, GLfloat* v);
|
||||
void (WINE_GLAPI *glGetMapiv) (GLenum target, GLenum query, GLint* v);
|
||||
void (WINE_GLAPI *glGetMaterialfv) (GLenum face, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetMaterialiv) (GLenum face, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetPixelMapfv) (GLenum map, GLfloat* values);
|
||||
void (WINE_GLAPI *glGetPixelMapuiv) (GLenum map, GLuint* values);
|
||||
void (WINE_GLAPI *glGetPixelMapusv) (GLenum map, GLushort* values);
|
||||
void (WINE_GLAPI *glGetPointerv) (GLenum pname, GLvoid** params);
|
||||
void (WINE_GLAPI *glGetPolygonStipple) (GLubyte* mask);
|
||||
const GLubyte * (WINE_GLAPI *glGetString) (GLenum name);
|
||||
void (WINE_GLAPI *glGetTexEnvfv) (GLenum target, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetTexEnviv) (GLenum target, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetTexGendv) (GLenum coord, GLenum pname, GLdouble* params);
|
||||
void (WINE_GLAPI *glGetTexGenfv) (GLenum coord, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetTexGeniv) (GLenum coord, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetTexImage) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid* pixels);
|
||||
void (WINE_GLAPI *glGetTexLevelParameterfv) (GLenum target, GLint level, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetTexLevelParameteriv) (GLenum target, GLint level, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat* params);
|
||||
void (WINE_GLAPI *glGetTexParameteriv) (GLenum target, GLenum pname, GLint* params);
|
||||
void (WINE_GLAPI *glHint) (GLenum target, GLenum mode);
|
||||
void (WINE_GLAPI *glIndexMask) (GLuint mask);
|
||||
void (WINE_GLAPI *glIndexPointer) (GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glIndexd) (GLdouble c);
|
||||
void (WINE_GLAPI *glIndexdv) (const GLdouble* c);
|
||||
void (WINE_GLAPI *glIndexf) (GLfloat c);
|
||||
void (WINE_GLAPI *glIndexfv) (const GLfloat* c);
|
||||
void (WINE_GLAPI *glIndexi) (GLint c);
|
||||
void (WINE_GLAPI *glIndexiv) (const GLint* c);
|
||||
void (WINE_GLAPI *glIndexs) (GLshort c);
|
||||
void (WINE_GLAPI *glIndexsv) (const GLshort* c);
|
||||
void (WINE_GLAPI *glIndexub) (GLubyte c);
|
||||
void (WINE_GLAPI *glIndexubv) (const GLubyte* c);
|
||||
void (WINE_GLAPI *glInitNames) ();
|
||||
void (WINE_GLAPI *glInterleavedArrays) (GLenum format, GLsizei stride, const GLvoid* pointer);
|
||||
GLboolean (WINE_GLAPI *glIsEnabled) (GLenum cap);
|
||||
GLboolean (WINE_GLAPI *glIsList) (GLuint list);
|
||||
GLboolean (WINE_GLAPI *glIsTexture) (GLuint texture);
|
||||
void (WINE_GLAPI *glLightModelf) (GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glLightModelfv) (GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glLightModeli) (GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glLightModeliv) (GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glLightf) (GLenum light, GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glLightfv) (GLenum light, GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glLighti) (GLenum light, GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glLightiv) (GLenum light, GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glLineStipple) (GLint factor, GLushort pattern);
|
||||
void (WINE_GLAPI *glLineWidth) (GLfloat width);
|
||||
void (WINE_GLAPI *glListBase) (GLuint base);
|
||||
void (WINE_GLAPI *glLoadIdentity) ();
|
||||
void (WINE_GLAPI *glLoadMatrixd) (const GLdouble* m);
|
||||
void (WINE_GLAPI *glLoadMatrixf) (const GLfloat* m);
|
||||
void (WINE_GLAPI *glLoadName) (GLuint name);
|
||||
void (WINE_GLAPI *glLogicOp) (GLenum opcode);
|
||||
void (WINE_GLAPI *glMap1d) (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points);
|
||||
void (WINE_GLAPI *glMap1f) (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points);
|
||||
void (WINE_GLAPI *glMap2d) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points);
|
||||
void (WINE_GLAPI *glMap2f) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points);
|
||||
void (WINE_GLAPI *glMapGrid1d) (GLint un, GLdouble u1, GLdouble u2);
|
||||
void (WINE_GLAPI *glMapGrid1f) (GLint un, GLfloat u1, GLfloat u2);
|
||||
void (WINE_GLAPI *glMapGrid2d) (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void (WINE_GLAPI *glMapGrid2f) (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
void (WINE_GLAPI *glMaterialf) (GLenum face, GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glMaterialfv) (GLenum face, GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glMateriali) (GLenum face, GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glMaterialiv) (GLenum face, GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glMatrixMode) (GLenum mode);
|
||||
void (WINE_GLAPI *glMultMatrixd) (const GLdouble* m);
|
||||
void (WINE_GLAPI *glMultMatrixf) (const GLfloat* m);
|
||||
void (WINE_GLAPI *glNewList) (GLuint list, GLenum mode);
|
||||
void (WINE_GLAPI *glNormal3b) (GLbyte nx, GLbyte ny, GLbyte nz);
|
||||
void (WINE_GLAPI *glNormal3bv) (const GLbyte* v);
|
||||
void (WINE_GLAPI *glNormal3d) (GLdouble nx, GLdouble ny, GLdouble nz);
|
||||
void (WINE_GLAPI *glNormal3dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glNormal3f) (GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
void (WINE_GLAPI *glNormal3fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glNormal3i) (GLint nx, GLint ny, GLint nz);
|
||||
void (WINE_GLAPI *glNormal3iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glNormal3s) (GLshort nx, GLshort ny, GLshort nz);
|
||||
void (WINE_GLAPI *glNormal3sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glNormalPointer) (GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glOrtho) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
void (WINE_GLAPI *glPassThrough) (GLfloat token);
|
||||
void (WINE_GLAPI *glPixelMapfv) (GLenum map, GLint mapsize, const GLfloat* values);
|
||||
void (WINE_GLAPI *glPixelMapuiv) (GLenum map, GLint mapsize, const GLuint* values);
|
||||
void (WINE_GLAPI *glPixelMapusv) (GLenum map, GLint mapsize, const GLushort* values);
|
||||
void (WINE_GLAPI *glPixelStoref) (GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glPixelStorei) (GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glPixelTransferf) (GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glPixelTransferi) (GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glPixelZoom) (GLfloat xfactor, GLfloat yfactor);
|
||||
void (WINE_GLAPI *glPointSize) (GLfloat size);
|
||||
void (WINE_GLAPI *glPolygonMode) (GLenum face, GLenum mode);
|
||||
void (WINE_GLAPI *glPolygonOffset) (GLfloat factor, GLfloat units);
|
||||
void (WINE_GLAPI *glPolygonStipple) (const GLubyte* mask);
|
||||
void (WINE_GLAPI *glPopAttrib) ();
|
||||
void (WINE_GLAPI *glPopClientAttrib) ();
|
||||
void (WINE_GLAPI *glPopMatrix) ();
|
||||
void (WINE_GLAPI *glPopName) ();
|
||||
void (WINE_GLAPI *glPrioritizeTextures) (GLsizei n, const GLuint* textures, const GLclampf* priorities);
|
||||
void (WINE_GLAPI *glPushAttrib) (GLbitfield mask);
|
||||
void (WINE_GLAPI *glPushClientAttrib) (GLbitfield mask);
|
||||
void (WINE_GLAPI *glPushMatrix) ();
|
||||
void (WINE_GLAPI *glPushName) (GLuint name);
|
||||
void (WINE_GLAPI *glRasterPos2d) (GLdouble x, GLdouble y);
|
||||
void (WINE_GLAPI *glRasterPos2dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glRasterPos2f) (GLfloat x, GLfloat y);
|
||||
void (WINE_GLAPI *glRasterPos2fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glRasterPos2i) (GLint x, GLint y);
|
||||
void (WINE_GLAPI *glRasterPos2iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glRasterPos2s) (GLshort x, GLshort y);
|
||||
void (WINE_GLAPI *glRasterPos2sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glRasterPos3d) (GLdouble x, GLdouble y, GLdouble z);
|
||||
void (WINE_GLAPI *glRasterPos3dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glRasterPos3f) (GLfloat x, GLfloat y, GLfloat z);
|
||||
void (WINE_GLAPI *glRasterPos3fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glRasterPos3i) (GLint x, GLint y, GLint z);
|
||||
void (WINE_GLAPI *glRasterPos3iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glRasterPos3s) (GLshort x, GLshort y, GLshort z);
|
||||
void (WINE_GLAPI *glRasterPos3sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glRasterPos4d) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
void (WINE_GLAPI *glRasterPos4dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glRasterPos4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void (WINE_GLAPI *glRasterPos4fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glRasterPos4i) (GLint x, GLint y, GLint z, GLint w);
|
||||
void (WINE_GLAPI *glRasterPos4iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glRasterPos4s) (GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
void (WINE_GLAPI *glRasterPos4sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glReadBuffer) (GLenum mode);
|
||||
void (WINE_GLAPI *glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
void (WINE_GLAPI *glRectd) (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
void (WINE_GLAPI *glRectdv) (const GLdouble* v1, const GLdouble* v2);
|
||||
void (WINE_GLAPI *glRectf) (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
void (WINE_GLAPI *glRectfv) (const GLfloat* v1, const GLfloat* v2);
|
||||
void (WINE_GLAPI *glRecti) (GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
void (WINE_GLAPI *glRectiv) (const GLint* v1, const GLint* v2);
|
||||
void (WINE_GLAPI *glRects) (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
void (WINE_GLAPI *glRectsv) (const GLshort* v1, const GLshort* v2);
|
||||
GLint (WINE_GLAPI *glRenderMode) (GLenum mode);
|
||||
void (WINE_GLAPI *glRotated) (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void (WINE_GLAPI *glRotatef) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void (WINE_GLAPI *glScaled) (GLdouble x, GLdouble y, GLdouble z);
|
||||
void (WINE_GLAPI *glScalef) (GLfloat x, GLfloat y, GLfloat z);
|
||||
void (WINE_GLAPI *glScissor) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (WINE_GLAPI *glSelectBuffer) (GLsizei size, GLuint* buffer);
|
||||
void (WINE_GLAPI *glShadeModel) (GLenum mode);
|
||||
void (WINE_GLAPI *glStencilFunc) (GLenum func, GLint ref, GLuint mask);
|
||||
void (WINE_GLAPI *glStencilMask) (GLuint mask);
|
||||
void (WINE_GLAPI *glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void (WINE_GLAPI *glTexCoord1d) (GLdouble s);
|
||||
void (WINE_GLAPI *glTexCoord1dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glTexCoord1f) (GLfloat s);
|
||||
void (WINE_GLAPI *glTexCoord1fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glTexCoord1i) (GLint s);
|
||||
void (WINE_GLAPI *glTexCoord1iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glTexCoord1s) (GLshort s);
|
||||
void (WINE_GLAPI *glTexCoord1sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glTexCoord2d) (GLdouble s, GLdouble t);
|
||||
void (WINE_GLAPI *glTexCoord2dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glTexCoord2f) (GLfloat s, GLfloat t);
|
||||
void (WINE_GLAPI *glTexCoord2fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glTexCoord2i) (GLint s, GLint t);
|
||||
void (WINE_GLAPI *glTexCoord2iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glTexCoord2s) (GLshort s, GLshort t);
|
||||
void (WINE_GLAPI *glTexCoord2sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glTexCoord3d) (GLdouble s, GLdouble t, GLdouble r);
|
||||
void (WINE_GLAPI *glTexCoord3dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glTexCoord3f) (GLfloat s, GLfloat t, GLfloat r);
|
||||
void (WINE_GLAPI *glTexCoord3fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glTexCoord3i) (GLint s, GLint t, GLint r);
|
||||
void (WINE_GLAPI *glTexCoord3iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glTexCoord3s) (GLshort s, GLshort t, GLshort r);
|
||||
void (WINE_GLAPI *glTexCoord3sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glTexCoord4d) (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
void (WINE_GLAPI *glTexCoord4dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glTexCoord4f) (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void (WINE_GLAPI *glTexCoord4fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glTexCoord4i) (GLint s, GLint t, GLint r, GLint q);
|
||||
void (WINE_GLAPI *glTexCoord4iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glTexCoord4s) (GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
void (WINE_GLAPI *glTexCoord4sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glTexCoordPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glTexEnvf) (GLenum target, GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glTexEnvfv) (GLenum target, GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glTexEnvi) (GLenum target, GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glTexEnviv) (GLenum target, GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glTexGend) (GLenum coord, GLenum pname, GLdouble param);
|
||||
void (WINE_GLAPI *glTexGendv) (GLenum coord, GLenum pname, const GLdouble* params);
|
||||
void (WINE_GLAPI *glTexGenf) (GLenum coord, GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glTexGenfv) (GLenum coord, GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glTexGeni) (GLenum coord, GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glTexGeniv) (GLenum coord, GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glTexImage1D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void (WINE_GLAPI *glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void (WINE_GLAPI *glTexParameterf) (GLenum target, GLenum pname, GLfloat param);
|
||||
void (WINE_GLAPI *glTexParameterfv) (GLenum target, GLenum pname, const GLfloat* params);
|
||||
void (WINE_GLAPI *glTexParameteri) (GLenum target, GLenum pname, GLint param);
|
||||
void (WINE_GLAPI *glTexParameteriv) (GLenum target, GLenum pname, const GLint* params);
|
||||
void (WINE_GLAPI *glTexSubImage1D) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void (WINE_GLAPI *glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void (WINE_GLAPI *glTranslated) (GLdouble x, GLdouble y, GLdouble z);
|
||||
void (WINE_GLAPI *glTranslatef) (GLfloat x, GLfloat y, GLfloat z);
|
||||
void (WINE_GLAPI *glVertex2d) (GLdouble x, GLdouble y);
|
||||
void (WINE_GLAPI *glVertex2dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glVertex2f) (GLfloat x, GLfloat y);
|
||||
void (WINE_GLAPI *glVertex2fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glVertex2i) (GLint x, GLint y);
|
||||
void (WINE_GLAPI *glVertex2iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glVertex2s) (GLshort x, GLshort y);
|
||||
void (WINE_GLAPI *glVertex2sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glVertex3d) (GLdouble x, GLdouble y, GLdouble z);
|
||||
void (WINE_GLAPI *glVertex3dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glVertex3f) (GLfloat x, GLfloat y, GLfloat z);
|
||||
void (WINE_GLAPI *glVertex3fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glVertex3i) (GLint x, GLint y, GLint z);
|
||||
void (WINE_GLAPI *glVertex3iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glVertex3s) (GLshort x, GLshort y, GLshort z);
|
||||
void (WINE_GLAPI *glVertex3sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glVertex4d) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
void (WINE_GLAPI *glVertex4dv) (const GLdouble* v);
|
||||
void (WINE_GLAPI *glVertex4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void (WINE_GLAPI *glVertex4fv) (const GLfloat* v);
|
||||
void (WINE_GLAPI *glVertex4i) (GLint x, GLint y, GLint z, GLint w);
|
||||
void (WINE_GLAPI *glVertex4iv) (const GLint* v);
|
||||
void (WINE_GLAPI *glVertex4s) (GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
void (WINE_GLAPI *glVertex4sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glVertexPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glViewport) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (WINE_GLAPI *glPointParameterfv) (GLenum pname, const GLfloat *params);
|
||||
void (WINE_GLAPI *glAccum)(GLenum op, GLfloat value) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glAlphaFunc)(GLenum func, GLclampf ref) DECLSPEC_HIDDEN;
|
||||
GLboolean (WINE_GLAPI *glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glArrayElement)(GLint i) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glBegin)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glBindTexture)(GLenum target, GLuint texture) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glBitmap)(GLsizei width, GLsizei height, GLfloat xorig,
|
||||
GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glBlendFunc)(GLenum sfactor, GLenum dfactor) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCallList)(GLuint list) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCallLists)(GLsizei n, GLenum type, const GLvoid *lists) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClear)(GLbitfield mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClearDepth)(GLclampd depth) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClearIndex)(GLfloat c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClearStencil)(GLint s) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glClipPlane)(GLenum plane, const GLdouble *equation) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3b)(GLbyte red, GLbyte green, GLbyte blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3bv)(const GLbyte *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3d)(GLdouble red, GLdouble green, GLdouble blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3f)(GLfloat red, GLfloat green, GLfloat blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3i)(GLint red, GLint green, GLint blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3s)(GLshort red, GLshort green, GLshort blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3ub)(GLubyte red, GLubyte green, GLubyte blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3ubv)(const GLubyte *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3ui)(GLuint red, GLuint green, GLuint blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3uiv)(const GLuint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3us)(GLushort red, GLushort green, GLushort blue) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor3usv)(const GLushort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4bv)(const GLbyte *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4i)(GLint red, GLint green, GLint blue, GLint alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4ubv)(const GLubyte *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4uiv)(const GLuint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColor4usv)(const GLushort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColorMaterial)(GLenum face, GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCopyTexImage1D)(GLenum target, GLint level,
|
||||
GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCopyTexImage2D)(GLenum target, GLint level,
|
||||
GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCopyTexSubImage1D)(GLenum target, GLint level,
|
||||
GLint xoffset, GLint x, GLint y, GLsizei width) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCopyTexSubImage2D)(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glCullFace)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDeleteLists)(GLuint list, GLsizei range) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDeleteTextures)(GLsizei n, const GLuint *textures) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDepthFunc)(GLenum func) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDepthMask)(GLboolean flag) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDepthRange)(GLclampd nearParam, GLclampd farParam) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDisable)(GLenum cap) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDisableClientState)(GLenum array) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDrawArrays)(GLenum mode, GLint first, GLsizei count) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDrawBuffer)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glDrawPixels)(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEdgeFlag)(GLboolean flag) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEdgeFlagv)(const GLboolean *flag) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEnable)(GLenum cap) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEnableClientState)(GLenum array) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEnd)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEndList)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord1d)(GLdouble u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord1dv)(const GLdouble *u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord1f)(GLfloat u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord1fv)(const GLfloat *u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord2d)(GLdouble u, GLdouble v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord2dv)(const GLdouble *u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord2f)(GLfloat u, GLfloat v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalCoord2fv)(const GLfloat *u) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalMesh1)(GLenum mode, GLint i1, GLint i2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalPoint1)(GLint i) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glEvalPoint2)(GLint i, GLint j) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFogf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFogfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFogi)(GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFogiv)(GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFrontFace)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glFrustum)(GLdouble left, GLdouble right, GLdouble bottom,
|
||||
GLdouble top, GLdouble zNear, GLdouble zFar) DECLSPEC_HIDDEN;
|
||||
GLuint (WINE_GLAPI *glGenLists)(GLsizei range) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGenTextures)(GLsizei n, GLuint *textures) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetBooleanv)(GLenum pname, GLboolean *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetClipPlane)(GLenum plane, GLdouble *equation) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetDoublev)(GLenum pname, GLdouble *params) DECLSPEC_HIDDEN;
|
||||
GLenum (WINE_GLAPI *glGetError)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetFloatv)(GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetIntegerv)(GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetLightfv)(GLenum light, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetLightiv)(GLenum light, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetMapdv)(GLenum target, GLenum query, GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetMapfv)(GLenum target, GLenum query, GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetMapiv)(GLenum target, GLenum query, GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetMaterialiv)(GLenum face, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetPixelMapfv)(GLenum map, GLfloat *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetPixelMapuiv)(GLenum map, GLuint *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetPixelMapusv)(GLenum map, GLushort *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetPointerv)(GLenum pname, GLvoid **params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetPolygonStipple)(GLubyte *mask) DECLSPEC_HIDDEN;
|
||||
const GLubyte * (WINE_GLAPI *glGetString)(GLenum name) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexEnviv)(GLenum target, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexImage)(GLenum target, GLint level, GLenum format,
|
||||
GLenum type, GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glHint)(GLenum target, GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexMask)(GLuint mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexd)(GLdouble c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexdv)(const GLdouble *c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexf)(GLfloat c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexfv)(const GLfloat *c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexi)(GLint c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexiv)(const GLint *c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexs)(GLshort c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexsv)(const GLshort *c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexub)(GLubyte c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glIndexubv)(const GLubyte *c) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glInitNames)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
GLboolean (WINE_GLAPI *glIsEnabled)(GLenum cap) DECLSPEC_HIDDEN;
|
||||
GLboolean (WINE_GLAPI *glIsList)(GLuint list) DECLSPEC_HIDDEN;
|
||||
GLboolean (WINE_GLAPI *glIsTexture)(GLuint texture) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightModelf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightModelfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightModeli)(GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightModeliv)(GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightf)(GLenum light, GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightfv)(GLenum light, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLighti)(GLenum light, GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLightiv)(GLenum light, GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLineStipple)(GLint factor, GLushort pattern) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLineWidth)(GLfloat width) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glListBase)(GLuint base) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLoadIdentity)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLoadMatrixd)(const GLdouble *m) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLoadMatrixf)(const GLfloat *m) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLoadName)(GLuint name) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glLogicOp)(GLenum opcode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMap1d)(GLenum target, GLdouble u1, GLdouble u2,
|
||||
GLint stride, GLint order, const GLdouble *points) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
|
||||
GLint order, const GLfloat *points) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
|
||||
GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
|
||||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMaterialf)(GLenum face, GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMateriali)(GLenum face, GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMaterialiv)(GLenum face, GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMatrixMode)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMultMatrixd)(const GLdouble *m) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glMultMatrixf)(const GLfloat *m) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNewList)(GLuint list, GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3bv)(const GLbyte *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3i)(GLint nx, GLint ny, GLint nz) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3s)(GLshort nx, GLshort ny, GLshort nz) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormal3sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glOrtho)(GLdouble left, GLdouble right, GLdouble bottom,
|
||||
GLdouble top, GLdouble zNear, GLdouble zFar) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPassThrough)(GLfloat token) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelMapfv)(GLenum map, GLint mapsize, const GLfloat *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelMapuiv)(GLenum map, GLint mapsize, const GLuint *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelMapusv)(GLenum map, GLint mapsize, const GLushort *values) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelStoref)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelStorei)(GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelTransferf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelTransferi)(GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPixelZoom)(GLfloat xfactor, GLfloat yfactor) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPointSize)(GLfloat size) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPolygonMode)(GLenum face, GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPolygonOffset)(GLfloat factor, GLfloat units) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPolygonStipple)(const GLubyte *mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPopAttrib)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPopClientAttrib)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPopMatrix)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPopName)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPushAttrib)(GLbitfield mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPushClientAttrib)(GLbitfield mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPushMatrix)(void) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPushName)(GLuint name) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2d)(GLdouble x, GLdouble y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2f)(GLfloat x, GLfloat y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2i)(GLint x, GLint y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2s)(GLshort x, GLshort y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos2sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3i)(GLint x, GLint y, GLint z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3s)(GLshort x, GLshort y, GLshort z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos3sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4i)(GLint x, GLint y, GLint z, GLint w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRasterPos4sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glReadBuffer)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectdv)(const GLdouble *v1, const GLdouble *v2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectfv)(const GLfloat *v1, const GLfloat *v2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRecti)(GLint x1, GLint y1, GLint x2, GLint y2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectiv)(const GLint *v1, const GLint *v2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRectsv)(const GLshort *v1, const GLshort *v2) DECLSPEC_HIDDEN;
|
||||
GLint (WINE_GLAPI *glRenderMode)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glScaled)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glScalef)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glSelectBuffer)(GLsizei size, GLuint *buffer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glShadeModel)(GLenum mode) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glStencilFunc)(GLenum func, GLint ref, GLuint mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glStencilMask)(GLuint mask) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1d)(GLdouble s) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1f)(GLfloat s) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1i)(GLint s) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1s)(GLshort s) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord1sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2d)(GLdouble s, GLdouble t) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2f)(GLfloat s, GLfloat t) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2i)(GLint s, GLint t) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2s)(GLshort s, GLshort t) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord2sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3i)(GLint s, GLint t, GLint r) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3s)(GLshort s, GLshort t, GLshort r) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord3sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4i)(GLint s, GLint t, GLint r, GLint q) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoord4sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexEnvf)(GLenum target, GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexEnvi)(GLenum target, GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexEnviv)(GLenum target, GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGend)(GLenum coord, GLenum pname, GLdouble param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGenf)(GLenum coord, GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGeni)(GLenum coord, GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexGeniv)(GLenum coord, GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width,
|
||||
GLint border, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width,
|
||||
GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexParameterf)(GLenum target, GLenum pname, GLfloat param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexParameteri)(GLenum target, GLenum pname, GLint param) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexSubImage1D)(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTranslated)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glTranslatef)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2d)(GLdouble x, GLdouble y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2f)(GLfloat x, GLfloat y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2i)(GLint x, GLint y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2s)(GLshort x, GLshort y) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex2sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3d)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3f)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3i)(GLint x, GLint y, GLint z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3s)(GLshort x, GLshort y, GLshort z) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex3sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4dv)(const GLdouble *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4fv)(const GLfloat *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4i)(GLint x, GLint y, GLint z, GLint w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4iv)(const GLint *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertex4sv)(const GLshort *v) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN;
|
||||
void (WINE_GLAPI *glPointParameterfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN;
|
||||
|
||||
/* glFinish and glFlush are always loaded from opengl32.dll, thus they always have
|
||||
* __stdcall calling convention.
|
||||
|
@ -1146,17 +1164,17 @@ void (WINE_GLAPI *glPointParameterfv) (GLenum pname, const GLfloat *params);
|
|||
* They are wgl functions and must not be called inside the gl lock, give them a
|
||||
* name that makes this clear
|
||||
*/
|
||||
void (__stdcall *wglFinish) ();
|
||||
void (__stdcall *wglFlush) ();
|
||||
void (__stdcall *wglFinish)(void) DECLSPEC_HIDDEN;
|
||||
void (__stdcall *wglFlush)(void) DECLSPEC_HIDDEN;
|
||||
|
||||
/* WGL functions */
|
||||
HGLRC (WINAPI *pwglCreateContext)(HDC);
|
||||
BOOL (WINAPI *pwglDeleteContext)(HGLRC);
|
||||
HGLRC (WINAPI *pwglGetCurrentContext)(void);
|
||||
HDC (WINAPI *pwglGetCurrentDC)(void);
|
||||
PROC (WINAPI *pwglGetProcAddress)(LPCSTR);
|
||||
BOOL (WINAPI *pwglMakeCurrent)(HDC,HGLRC);
|
||||
BOOL (WINAPI *pwglShareLists)(HGLRC,HGLRC);
|
||||
HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN;
|
||||
BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN;
|
||||
HGLRC (WINAPI *pwglGetCurrentContext)(void) DECLSPEC_HIDDEN;
|
||||
HDC (WINAPI *pwglGetCurrentDC)(void) DECLSPEC_HIDDEN;
|
||||
PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN;
|
||||
BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN;
|
||||
BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
|
||||
|
||||
#define GL_FUNCS_GEN \
|
||||
USE_GL_FUNC(glAccum) \
|
||||
|
@ -1567,6 +1585,114 @@ typedef void (WINE_GLAPI *PGLFNCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
|||
#endif
|
||||
typedef void (WINE_GLAPI *PGLFNDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
|
||||
|
||||
/* GL_ARB_framebuffer_object */
|
||||
#ifndef GL_ARB_framebuffer_object
|
||||
#define GL_ARB_framebuffer_object 1
|
||||
#define GL_FRAMEBUFFER 0x8d40
|
||||
#define GL_READ_FRAMEBUFFER 0x8ca8
|
||||
#define GL_DRAW_FRAMEBUFFER 0x8ca9
|
||||
#define GL_RENDERBUFFER 0x8d41
|
||||
#define GL_STENCIL_INDEX1 0x8d46
|
||||
#define GL_STENCIL_INDEX4 0x8d47
|
||||
#define GL_STENCIL_INDEX8 0x8d48
|
||||
#define GL_STENCIL_INDEX16 0x8d49
|
||||
#define GL_RENDERBUFFER_WIDTH 0x8d42
|
||||
#define GL_RENDERBUFFER_HEIGHT 0x8d43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8d44
|
||||
#define GL_RENDERBUFFER_RED_SIZE 0x8d50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8d51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8d52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8d53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8d54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8d55
|
||||
#define GL_RENDERBUFFER_SAMPLES 0x8cab
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8cd0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8cd1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8cd2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8cd3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8cd4
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
|
||||
#define GL_SRGB 0x8c40
|
||||
#define GL_UNSIGNED_NORMALIZED 0x8c17
|
||||
#define GL_FRAMEBUFFER_DEFAULT 0x8218
|
||||
#define GL_INDEX 0x8222
|
||||
#define GL_COLOR_ATTACHMENT0 0x8ce0
|
||||
#define GL_COLOR_ATTACHMENT1 0x8ce1
|
||||
#define GL_COLOR_ATTACHMENT2 0x8ce2
|
||||
#define GL_COLOR_ATTACHMENT3 0x8ce3
|
||||
#define GL_COLOR_ATTACHMENT4 0x8ce4
|
||||
#define GL_COLOR_ATTACHMENT5 0x8ce5
|
||||
#define GL_COLOR_ATTACHMENT6 0x8ce6
|
||||
#define GL_COLOR_ATTACHMENT7 0x8ce7
|
||||
#define GL_COLOR_ATTACHMENT8 0x8ce8
|
||||
#define GL_COLOR_ATTACHMENT9 0x8ce9
|
||||
#define GL_COLOR_ATTACHMENT10 0x8cea
|
||||
#define GL_COLOR_ATTACHMENT11 0x8ceb
|
||||
#define GL_COLOR_ATTACHMENT12 0x8cec
|
||||
#define GL_COLOR_ATTACHMENT13 0x8ced
|
||||
#define GL_COLOR_ATTACHMENT14 0x8cee
|
||||
#define GL_COLOR_ATTACHMENT15 0x8cef
|
||||
#define GL_DEPTH_ATTACHMENT 0x8d00
|
||||
#define GL_STENCIL_ATTACHMENT 0x8d20
|
||||
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821a
|
||||
#define GL_MAX_SAMPLES 0x8d57
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8cd5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8cd6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8cd7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8cdb
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8cdc
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8cdd
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8d56
|
||||
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8ca6
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING 0x8ca6
|
||||
#define GL_READ_FRAMEBUFFER_BINDING 0x8caa
|
||||
#define GL_RENDERBUFFER_BINDING 0x8ca7
|
||||
#define GL_MAX_COLOR_ATTACHMENTS 0x8cdf
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84e8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
#define GL_DEPTH_STENCIL 0x84f9
|
||||
#define GL_UNSIGNED_INT_24_8 0x84fa
|
||||
#define GL_DEPTH24_STENCIL8 0x88f0
|
||||
#define GL_TEXTURE_STENCIL_SIZE 0x88f1
|
||||
#endif
|
||||
typedef GLboolean (WINE_GLAPI * PGLFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (WINE_GLAPI * PGLFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (WINE_GLAPI * PGLFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
typedef void (WINE_GLAPI * PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (WINE_GLAPI * PGLFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (WINE_GLAPI * PGLFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (WINE_GLAPI * PGLFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (WINE_GLAPI * PGLFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
|
||||
typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment,
|
||||
GLuint texture, GLint level, GLint layer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment,
|
||||
GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (WINE_GLAPI * PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment,
|
||||
GLenum pname, GLint *params);
|
||||
typedef void (WINE_GLAPI * PGLFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
|
||||
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
typedef void (WINE_GLAPI * PGLFNGLGENERATEMIPMAPPROC)(GLenum target);
|
||||
|
||||
/* GL_ARB_geometry_shader4 */
|
||||
#ifndef GL_ARB_geometry_shader4
|
||||
#define GL_GEOMETRY_SHADER_ARB 0x8dd9
|
||||
|
@ -1758,6 +1884,17 @@ typedef void (WINE_GLAPI *WINED3D_PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target,
|
|||
#endif
|
||||
typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
|
||||
typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
|
||||
|
||||
/* GL_ARB_provoking_vertex */
|
||||
#ifndef GL_ARB_provoking_vertex
|
||||
#define GL_ARB_provoking_vertex 1
|
||||
#define GL_FIRST_VERTEX_CONVENTION 0x8e4d
|
||||
#define GL_LAST_VERTEX_CONVENTION 0x8e4e
|
||||
#define GL_PROVOKING_VERTEX 0x8e4f
|
||||
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8e4c
|
||||
#endif
|
||||
typedef void (WINE_GLAPI * PGLFNGLPROVOKINGVERTEXPROC)(GLenum mode);
|
||||
|
||||
/* GL_ARB_vertex_blend */
|
||||
#ifndef GL_ARB_vertex_blend
|
||||
#define GL_ARB_vertex_blend 1
|
||||
|
@ -1968,7 +2105,7 @@ typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const
|
|||
#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8e4d
|
||||
#define GL_LAST_VERTEX_CONVENTION_EXT 0x8e4e
|
||||
#define GL_PROVOKING_VERTEX_EXT 0x8e4f
|
||||
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTIONS_EXT 0x8e4c
|
||||
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8e4c
|
||||
#endif
|
||||
typedef void (WINE_GLAPI * PGLFNGLPROVOKINGVERTEXEXTPROC)(GLenum mode);
|
||||
|
||||
|
@ -3031,8 +3168,8 @@ typedef void (WINE_GLAPI * PGLFNPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target
|
|||
typedef GLuint (WINE_GLAPI *PGLFNGENFRAGMENTSHADERSATI) (GLuint range);
|
||||
typedef void (WINE_GLAPI *PGLFNBINDFRAGMENTSHADERATI) (GLuint id);
|
||||
typedef void (WINE_GLAPI *PGLFNDELETEFRAGMENTSHADERATI) (GLuint id);
|
||||
typedef void (WINE_GLAPI *PGLFNBEGINFRAGMENTSHADERATI) ();
|
||||
typedef void (WINE_GLAPI *PGLFNENDFRAGMENTSHADERATI) ();
|
||||
typedef void (WINE_GLAPI *PGLFNBEGINFRAGMENTSHADERATI) (void);
|
||||
typedef void (WINE_GLAPI *PGLFNENDFRAGMENTSHADERATI) (void);
|
||||
typedef void (WINE_GLAPI *PGLFNPASSTEXCOORDATI) (GLuint dst, GLuint coord, GLenum swizzle);
|
||||
typedef void (WINE_GLAPI *PGLFNSAMPLEMAPATI) (GLuint dst, GLuint interp, GLenum swizzle);
|
||||
typedef void (WINE_GLAPI *PGLFNCOLORFRAGMENTOP1ATI) (GLenum op, GLuint dst, GLuint dstMask,
|
||||
|
@ -3416,12 +3553,14 @@ typedef enum _GL_SupportedExt {
|
|||
ARB_DRAW_BUFFERS,
|
||||
ARB_FRAGMENT_PROGRAM,
|
||||
ARB_FRAGMENT_SHADER,
|
||||
ARB_FRAMEBUFFER_OBJECT,
|
||||
ARB_GEOMETRY_SHADER4,
|
||||
ARB_IMAGING,
|
||||
ARB_MULTISAMPLE,
|
||||
ARB_MULTITEXTURE,
|
||||
ARB_OCCLUSION_QUERY,
|
||||
ARB_POINT_PARAMETERS,
|
||||
ARB_PROVOKING_VERTEX,
|
||||
ARB_PIXEL_BUFFER_OBJECT,
|
||||
ARB_POINT_SPRITE,
|
||||
ARB_TEXTURE_COMPRESSION,
|
||||
|
@ -3533,6 +3672,27 @@ typedef enum _GL_SupportedExt {
|
|||
USE_GL_FUNC(PGLFNCLAMPCOLORARBPROC, glClampColorARB, ARB_COLOR_BUFFER_FLOAT, NULL )\
|
||||
/* GL_ARB_draw_buffers */ \
|
||||
USE_GL_FUNC(PGLFNDRAWBUFFERSARBPROC, glDrawBuffersARB, ARB_DRAW_BUFFERS, NULL )\
|
||||
/* GL_ARB_framebuffer_object */ \
|
||||
USE_GL_FUNC(PGLFNGLISRENDERBUFFERPROC, glIsRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLBINDRENDERBUFFERPROC, glBindRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLDELETERENDERBUFFERSPROC, glDeleteRenderbuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLGENRENDERBUFFERSPROC, glGenRenderbuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLRENDERBUFFERSTORAGEPROC, glRenderbufferStorage, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLGETRENDERBUFFERPARAMETERIVPROC, glGetRenderbufferParameteriv, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLISFRAMEBUFFERPROC, glIsFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE1DPROC, glFramebufferTexture1D, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE3DPROC, glFramebufferTexture3D, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURELAYERPROC, glFramebufferTextureLayer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLFRAMEBUFFERRENDERBUFFERPROC, glFramebufferRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC, glGetFramebufferAttachmentParameteriv, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLGENERATEMIPMAPPROC, glGenerateMipmap, ARB_FRAMEBUFFER_OBJECT, NULL )\
|
||||
/* GL_ARB_geometry_shader4 */ \
|
||||
USE_GL_FUNC(PGLFNPROGRAMPARAMETERIARBPROC, glProgramParameteriARB, ARB_GEOMETRY_SHADER4, NULL ) \
|
||||
USE_GL_FUNC(PGLFNFRAMEBUFFERTEXTUREARBPROC, glFramebufferTextureARB, ARB_GEOMETRY_SHADER4, NULL ) \
|
||||
|
@ -3566,6 +3726,8 @@ typedef enum _GL_SupportedExt {
|
|||
/* GL_ARB_point_parameters */ \
|
||||
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFARBPROC, glPointParameterfARB, ARB_POINT_PARAMETERS, NULL )\
|
||||
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVARBPROC, glPointParameterfvARB, ARB_POINT_PARAMETERS, NULL )\
|
||||
/* GL_ARB_provoking_vertex */ \
|
||||
USE_GL_FUNC(PGLFNGLPROVOKINGVERTEXPROC, glProvokingVertex, ARB_PROVOKING_VERTEX, NULL)\
|
||||
/* GL_ARB_texture_compression */ \
|
||||
USE_GL_FUNC(PGLFNCOMPRESSEDTEXIMAGE2DPROC, glCompressedTexImage2DARB, ARB_TEXTURE_COMPRESSION,NULL )\
|
||||
USE_GL_FUNC(PGLFNCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3DARB, ARB_TEXTURE_COMPRESSION,NULL )\
|
||||
|
@ -3949,6 +4111,29 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor
|
|||
* Structures
|
||||
****************************************************/
|
||||
|
||||
struct wined3d_fbo_ops
|
||||
{
|
||||
PGLFNGLISRENDERBUFFERPROC glIsRenderbuffer;
|
||||
PGLFNGLBINDRENDERBUFFERPROC glBindRenderbuffer;
|
||||
PGLFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers;
|
||||
PGLFNGLGENRENDERBUFFERSPROC glGenRenderbuffers;
|
||||
PGLFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage;
|
||||
PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
|
||||
PGLFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv;
|
||||
PGLFNGLISFRAMEBUFFERPROC glIsFramebuffer;
|
||||
PGLFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
|
||||
PGLFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
|
||||
PGLFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
|
||||
PGLFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
|
||||
PGLFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
|
||||
PGLFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
|
||||
PGLFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
|
||||
PGLFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
|
||||
PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv;
|
||||
PGLFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
|
||||
PGLFNGLGENERATEMIPMAPPROC glGenerateMipmap;
|
||||
};
|
||||
|
||||
#define USE_GL_FUNC(type, pfn, ext, replace) type pfn;
|
||||
|
||||
struct wined3d_gl_info
|
||||
|
@ -3997,6 +4182,7 @@ struct wined3d_gl_info
|
|||
|
||||
BOOL supported[WINED3D_GL_EXT_COUNT];
|
||||
|
||||
struct wined3d_fbo_ops fbo_ops;
|
||||
/* GL function pointers */
|
||||
GL_EXT_FUNCS_GEN
|
||||
/* WGL function pointers */
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2002-2003 Raphael Junqueira
|
||||
* Copyright 2004 Jason Edmeades
|
||||
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
||||
* Copyright 2009 Henri Verbeet for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -32,7 +33,7 @@ int num_lock = 0;
|
|||
void (*CDECL wine_tsx11_lock_ptr)(void) = NULL;
|
||||
void (*CDECL wine_tsx11_unlock_ptr)(void) = NULL;
|
||||
|
||||
CRITICAL_SECTION wined3d_cs;
|
||||
static CRITICAL_SECTION wined3d_cs;
|
||||
static CRITICAL_SECTION_DEBUG wined3d_cs_debug =
|
||||
{
|
||||
0, 0, &wined3d_cs,
|
||||
|
@ -40,7 +41,7 @@ static CRITICAL_SECTION_DEBUG wined3d_cs_debug =
|
|||
&wined3d_cs_debug.ProcessLocksList},
|
||||
0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs")}
|
||||
};
|
||||
CRITICAL_SECTION wined3d_cs = {&wined3d_cs_debug, -1, 0, 0, 0, 0};
|
||||
static CRITICAL_SECTION wined3d_cs = {&wined3d_cs_debug, -1, 0, 0, 0, 0};
|
||||
|
||||
/* When updating default value here, make sure to update winecfg as well,
|
||||
* where appropriate. */
|
||||
|
@ -293,8 +294,11 @@ static BOOL wined3d_init(HINSTANCE hInstDLL)
|
|||
}
|
||||
if ( !get_config_key( hkey, appkey, "WineLogo", buffer, size) )
|
||||
{
|
||||
wined3d_settings.logo = HeapAlloc(GetProcessHeap(), 0, strlen(buffer) + 1);
|
||||
if(wined3d_settings.logo) strcpy(wined3d_settings.logo, buffer);
|
||||
size_t len = strlen(buffer) + 1;
|
||||
|
||||
wined3d_settings.logo = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if (!wined3d_settings.logo) ERR("Failed to allocate logo path memory.\n");
|
||||
else memcpy(wined3d_settings.logo, buffer, len);
|
||||
}
|
||||
if ( !get_config_key( hkey, appkey, "Multisampling", buffer, size) )
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -132,39 +132,33 @@ typedef enum _WINED3DDEGREETYPE
|
|||
typedef enum _WINED3DFORMAT
|
||||
{
|
||||
WINED3DFMT_UNKNOWN,
|
||||
WINED3DFMT_R8G8B8,
|
||||
WINED3DFMT_A8R8G8B8,
|
||||
WINED3DFMT_X8R8G8B8,
|
||||
WINED3DFMT_R5G6B5,
|
||||
WINED3DFMT_X1R5G5B5,
|
||||
WINED3DFMT_A1R5G5B5,
|
||||
WINED3DFMT_A4R4G4B4,
|
||||
WINED3DFMT_R3G3B2,
|
||||
WINED3DFMT_A8R3G3B2,
|
||||
WINED3DFMT_X4R4G4B4,
|
||||
WINED3DFMT_X8B8G8R8,
|
||||
WINED3DFMT_A2R10G10B10,
|
||||
WINED3DFMT_A8P8,
|
||||
WINED3DFMT_P8,
|
||||
WINED3DFMT_L8,
|
||||
WINED3DFMT_A8L8,
|
||||
WINED3DFMT_A4L4,
|
||||
WINED3DFMT_L6V5U5,
|
||||
WINED3DFMT_X8L8V8U8,
|
||||
WINED3DFMT_W11V11U10,
|
||||
WINED3DFMT_A2W10V10U10,
|
||||
WINED3DFMT_B8G8R8_UNORM,
|
||||
WINED3DFMT_B5G5R5X1_UNORM,
|
||||
WINED3DFMT_B4G4R4A4_UNORM,
|
||||
WINED3DFMT_B2G3R3_UNORM,
|
||||
WINED3DFMT_B2G3R3A8_UNORM,
|
||||
WINED3DFMT_B4G4R4X4_UNORM,
|
||||
WINED3DFMT_R8G8B8X8_UNORM,
|
||||
WINED3DFMT_B10G10R10A2_UNORM,
|
||||
WINED3DFMT_P8_UINT_A8_UNORM,
|
||||
WINED3DFMT_P8_UINT,
|
||||
WINED3DFMT_L8_UNORM,
|
||||
WINED3DFMT_L8A8_UNORM,
|
||||
WINED3DFMT_L4A4_UNORM,
|
||||
WINED3DFMT_R5G5_SNORM_L6_UNORM,
|
||||
WINED3DFMT_R8G8_SNORM_L8X8_UNORM,
|
||||
WINED3DFMT_R10G11B11_SNORM,
|
||||
WINED3DFMT_R10G10B10_SNORM_A2_UNORM,
|
||||
WINED3DFMT_D16_LOCKABLE,
|
||||
WINED3DFMT_D32,
|
||||
WINED3DFMT_D15S1,
|
||||
WINED3DFMT_D24S8,
|
||||
WINED3DFMT_D24X8,
|
||||
WINED3DFMT_D24X4S4,
|
||||
WINED3DFMT_L16,
|
||||
WINED3DFMT_D32F_LOCKABLE,
|
||||
WINED3DFMT_D24FS8,
|
||||
WINED3DFMT_D32_UNORM,
|
||||
WINED3DFMT_S1_UINT_D15_UNORM,
|
||||
WINED3DFMT_S8_UINT_D24_UNORM,
|
||||
WINED3DFMT_X8D24_UNORM,
|
||||
WINED3DFMT_S4X4_UINT_D24_UNORM,
|
||||
WINED3DFMT_L16_UNORM,
|
||||
WINED3DFMT_S8_UINT_D24_FLOAT,
|
||||
WINED3DFMT_VERTEXDATA,
|
||||
WINED3DFMT_CxV8U8,
|
||||
/* DXGI formats */
|
||||
WINED3DFMT_R8G8_SNORM_Cx,
|
||||
WINED3DFMT_R32G32B32A32_TYPELESS,
|
||||
WINED3DFMT_R32G32B32A32_FLOAT,
|
||||
WINED3DFMT_R32G32B32A32_UINT,
|
||||
|
@ -2143,6 +2137,11 @@ struct wined3d_shader_signature
|
|||
char *string_data;
|
||||
};
|
||||
|
||||
struct wined3d_parent_ops
|
||||
{
|
||||
void (*wined3d_object_destroyed)(void *parent);
|
||||
};
|
||||
|
||||
interface IWineD3DResource;
|
||||
interface IWineD3DSurface;
|
||||
interface IWineD3DVolume;
|
||||
|
@ -2210,8 +2209,6 @@ interface IWineD3DDeviceParent : IUnknown
|
|||
[out] IWineD3DSwapChain **swapchain
|
||||
);
|
||||
}
|
||||
typedef ULONG (*D3DCB_DESTROYSURFACEFN)(IWineD3DSurface *pSurface);
|
||||
typedef ULONG (*D3DCB_DESTROYVOLUMEFN)(IWineD3DVolume *pVolume);
|
||||
typedef ULONG (*D3DCB_DESTROYSWAPCHAINFN)(IWineD3DSwapChain *pSwapChain);
|
||||
typedef HRESULT (*D3DCB_ENUMRESOURCES)(IWineD3DResource *resource, void *pData);
|
||||
|
||||
|
@ -2618,9 +2615,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
|
|||
]
|
||||
interface IWineD3DTexture : IWineD3DBaseTexture
|
||||
{
|
||||
void Destroy(
|
||||
[in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
|
||||
);
|
||||
HRESULT GetLevelDesc(
|
||||
[in] UINT level,
|
||||
[out] WINED3DSURFACE_DESC *desc
|
||||
|
@ -2650,9 +2644,6 @@ interface IWineD3DTexture : IWineD3DBaseTexture
|
|||
]
|
||||
interface IWineD3DCubeTexture : IWineD3DBaseTexture
|
||||
{
|
||||
void Destroy(
|
||||
[in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
|
||||
);
|
||||
HRESULT GetLevelDesc(
|
||||
[in] UINT level,
|
||||
[out] WINED3DSURFACE_DESC *desc
|
||||
|
@ -2686,9 +2677,6 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture
|
|||
]
|
||||
interface IWineD3DVolumeTexture : IWineD3DBaseTexture
|
||||
{
|
||||
void Destroy(
|
||||
[in] D3DCB_DESTROYVOLUMEFN destroy_volume_callback
|
||||
);
|
||||
HRESULT GetLevelDesc(
|
||||
[in] UINT level,
|
||||
[out] WINED3DVOLUME_DESC *desc
|
||||
|
@ -2773,7 +2761,6 @@ interface IWineD3DQuery : IWineD3DBase
|
|||
interface IWineD3DSwapChain : IWineD3DBase
|
||||
{
|
||||
void Destroy(
|
||||
[in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
|
||||
);
|
||||
HRESULT GetDevice(
|
||||
[out] IWineD3DDevice **device
|
||||
|
@ -2841,9 +2828,12 @@ interface IWineD3DBuffer : IWineD3DResource
|
|||
]
|
||||
interface IWineD3DBaseShader : IWineD3DBase
|
||||
{
|
||||
HRESULT SetFunction(
|
||||
[in] const DWORD *function,
|
||||
[in] const struct wined3d_shader_signature *output_signature
|
||||
HRESULT GetDevice(
|
||||
[out] IWineD3DDevice **device
|
||||
);
|
||||
HRESULT GetFunction(
|
||||
[out] void *data,
|
||||
[in, out] UINT *data_size
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2854,13 +2844,6 @@ interface IWineD3DBaseShader : IWineD3DBase
|
|||
]
|
||||
interface IWineD3DVertexShader : IWineD3DBaseShader
|
||||
{
|
||||
HRESULT GetDevice(
|
||||
[out] IWineD3DDevice **device
|
||||
);
|
||||
HRESULT GetFunction(
|
||||
[out] void *data,
|
||||
[in, out] UINT *data_size
|
||||
);
|
||||
HRESULT SetLocalConstantsF(
|
||||
[in] UINT start_idx,
|
||||
[in] const float *src_data,
|
||||
|
@ -2875,13 +2858,6 @@ interface IWineD3DVertexShader : IWineD3DBaseShader
|
|||
]
|
||||
interface IWineD3DPixelShader : IWineD3DBaseShader
|
||||
{
|
||||
HRESULT GetDevice(
|
||||
[out] IWineD3DDevice **device
|
||||
);
|
||||
HRESULT GetFunction(
|
||||
[out] void *data,
|
||||
[in, out] UINT *data_size
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
|
@ -2895,6 +2871,7 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] struct wined3d_buffer_desc *desc,
|
||||
[in] const void *data,
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] IWineD3DBuffer **buffer
|
||||
);
|
||||
HRESULT CreateVertexBuffer(
|
||||
|
@ -2903,14 +2880,16 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] DWORD fvf,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DBuffer **vertex_buffer,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateIndexBuffer(
|
||||
[in] UINT length,
|
||||
[in] DWORD usage,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DBuffer **index_buffer,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateStateBlock(
|
||||
[in] WINED3DSTATEBLOCKTYPE type,
|
||||
|
@ -2930,7 +2909,8 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DMULTISAMPLE_TYPE multisample_type,
|
||||
[in] DWORD multisample_quality,
|
||||
[in] WINED3DSURFTYPE surface_type,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateRendertargetView(
|
||||
[in] IWineD3DResource *resource,
|
||||
|
@ -2945,7 +2925,8 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DFORMAT format,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DTexture **texture,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateVolumeTexture(
|
||||
[in] UINT width,
|
||||
|
@ -2956,7 +2937,8 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DFORMAT format,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DVolumeTexture **texture,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateVolume(
|
||||
[in] UINT width,
|
||||
|
@ -2966,7 +2948,8 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DFORMAT format,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DVolume **volume,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateCubeTexture(
|
||||
[in] UINT edge_length,
|
||||
|
@ -2975,7 +2958,8 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DFORMAT format,
|
||||
[in] WINED3DPOOL pool,
|
||||
[out] IWineD3DCubeTexture **texture,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreateQuery(
|
||||
[in] WINED3DQUERYTYPE type,
|
||||
|
@ -2991,25 +2975,29 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
HRESULT CreateVertexDeclaration(
|
||||
[out] IWineD3DVertexDeclaration **declaration,
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[in] const WINED3DVERTEXELEMENT *elements,
|
||||
[in] UINT element_count
|
||||
);
|
||||
HRESULT CreateVertexDeclarationFromFVF(
|
||||
[out] IWineD3DVertexDeclaration **declaration,
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[in] DWORD fvf
|
||||
);
|
||||
HRESULT CreateVertexShader(
|
||||
[in] const DWORD *function,
|
||||
[in] const struct wined3d_shader_signature *output_signature,
|
||||
[out] IWineD3DVertexShader **shader,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreatePixelShader(
|
||||
[in] const DWORD *function,
|
||||
[in] const struct wined3d_shader_signature *output_signature,
|
||||
[out] IWineD3DPixelShader **shader,
|
||||
[in] IUnknown *parent
|
||||
[in] IUnknown *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops
|
||||
);
|
||||
HRESULT CreatePalette(
|
||||
[in] DWORD flags,
|
||||
|
@ -3024,7 +3012,6 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] WINED3DPRESENT_PARAMETERS *present_parameters
|
||||
);
|
||||
HRESULT Uninit3D(
|
||||
[in] D3DCB_DESTROYSURFACEFN destroy_surface_callback,
|
||||
[in] D3DCB_DESTROYSWAPCHAINFN destroy_swapchain_callback
|
||||
);
|
||||
HRESULT UninitGDI(
|
||||
|
@ -3125,11 +3112,11 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] UINT swapchain_idx,
|
||||
[out] WINED3DGAMMARAMP *ramp
|
||||
);
|
||||
HRESULT SetIndices(
|
||||
HRESULT SetIndexBuffer(
|
||||
[in] IWineD3DBuffer *index_buffer,
|
||||
[in] WINED3DFORMAT format
|
||||
);
|
||||
HRESULT GetIndices(
|
||||
HRESULT GetIndexBuffer(
|
||||
[out] IWineD3DBuffer **index_buffer
|
||||
);
|
||||
HRESULT SetBaseVertexIndex(
|
||||
|
@ -3398,8 +3385,6 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] UINT vertex_count
|
||||
);
|
||||
HRESULT DrawIndexedPrimitive(
|
||||
[in] UINT min_vertex_idx,
|
||||
[in] UINT vertex_count,
|
||||
[in] UINT start_idx,
|
||||
[in] UINT index_count
|
||||
);
|
||||
|
@ -3409,8 +3394,6 @@ interface IWineD3DDevice : IWineD3DBase
|
|||
[in] UINT stream_stride
|
||||
);
|
||||
HRESULT DrawIndexedPrimitiveUP(
|
||||
[in] UINT min_vertex_idx,
|
||||
[in] UINT vertex_count,
|
||||
[in] UINT index_count,
|
||||
[in] const void *index_data,
|
||||
[in] WINED3DFORMAT index_data_format,
|
||||
|
|
Loading…
Reference in a new issue