ReactOS 0.4.17-dev-966-gf06eace
device.c File Reference
#include "ddraw_private.h"
Include dependency graph for device.c:

Go to the source code of this file.

Classes

struct  tss_lookup
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
static void set_fpu_control_word (WORD fpucw)
 
static WORD d3d_fpu_setup (void)
 
static enum wined3d_render_state wined3d_render_state_from_ddraw (D3DRENDERSTATETYPE state)
 
static enum wined3d_transform_state wined3d_transform_state_from_ddraw (D3DTRANSFORMSTATETYPE state)
 
static enum wined3d_primitive_type wined3d_primitive_type_from_ddraw (D3DPRIMITIVETYPE type)
 
static enum wined3d_stateblock_type wined3d_stateblock_type_from_ddraw (D3DSTATEBLOCKTYPE type)
 
static struct d3d_device * impl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI d3d_device_inner_QueryInterface (IUnknown *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device7_QueryInterface (IDirect3DDevice7 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device3_QueryInterface (IDirect3DDevice3 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device2_QueryInterface (IDirect3DDevice2 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device1_QueryInterface (IDirect3DDevice *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d_device_inner_AddRef (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_AddRef (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_AddRef (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_AddRef (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_AddRef (IDirect3DDevice *iface)
 
static ULONG WINAPI d3d_device_inner_Release (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_Release (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_Release (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_Release (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_Release (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device1_Initialize (IDirect3DDevice *iface, IDirect3D *d3d, GUID *guid, D3DDEVICEDESC *device_desc)
 
static HRESULT d3d_device7_GetCaps (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *device_desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUSetup (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUPreserve (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static BOOL check_d3ddevicedesc_size (DWORD size)
 
static HRESULT WINAPI d3d_device3_GetCaps (IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
 
static HRESULT WINAPI d3d_device2_GetCaps (IDirect3DDevice2 *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device1_GetCaps (IDirect3DDevice *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device2_SwapTextureHandles (IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
 
static HRESULT WINAPI d3d_device1_SwapTextureHandles (IDirect3DDevice *iface, IDirect3DTexture *tex1, IDirect3DTexture *tex2)
 
static HRESULT WINAPI d3d_device3_GetStats (IDirect3DDevice3 *iface, D3DSTATS *Stats)
 
static HRESULT WINAPI d3d_device2_GetStats (IDirect3DDevice2 *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_GetStats (IDirect3DDevice *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_CreateExecuteBuffer (IDirect3DDevice *iface, D3DEXECUTEBUFFERDESC *buffer_desc, IDirect3DExecuteBuffer **ExecuteBuffer, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d_device1_Execute (IDirect3DDevice *iface, IDirect3DExecuteBuffer *ExecuteBuffer, IDirect3DViewport *viewport, DWORD flags)
 
static HRESULT WINAPI d3d_device3_AddViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_AddViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_AddViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_DeleteViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_DeleteViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_DeleteViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_NextViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
 
static HRESULT WINAPI d3d_device2_NextViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport, IDirect3DViewport2 **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_NextViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport, IDirect3DViewport **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_Pick (IDirect3DDevice *iface, IDirect3DExecuteBuffer *buffer, IDirect3DViewport *viewport, DWORD flags, D3DRECT *rect)
 
static HRESULT WINAPI d3d_device1_GetPickRecords (IDirect3DDevice *iface, DWORD *count, D3DPICKRECORD *records)
 
static HRESULT d3d_device7_EnumTextureFormats (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUSetup (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUPreserve (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device3_EnumTextureFormats (IDirect3DDevice3 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device2_EnumTextureFormats (IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_EnumTextureFormats (IDirect3DDevice *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_CreateMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
 
static HRESULT WINAPI d3d_device1_SetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE matrix_handle, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device1_GetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
 
static HRESULT WINAPI d3d_device1_DeleteMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
 
static HRESULT d3d_device7_BeginScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device3_BeginScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI d3d_device2_BeginScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI d3d_device1_BeginScene (IDirect3DDevice *iface)
 
static HRESULT d3d_device7_EndScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device7_GetDirect3D (IDirect3DDevice7 *iface, IDirect3D7 **d3d)
 
static HRESULT WINAPI d3d_device3_GetDirect3D (IDirect3DDevice3 *iface, IDirect3D3 **d3d)
 
static HRESULT WINAPI d3d_device2_GetDirect3D (IDirect3DDevice2 *iface, IDirect3D2 **d3d)
 
static HRESULT WINAPI d3d_device1_GetDirect3D (IDirect3DDevice *iface, IDirect3D **d3d)
 
static HRESULT WINAPI d3d_device3_SetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_SetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device3_GetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
 
static HRESULT WINAPI d3d_device2_GetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 **viewport)
 
static BOOL validate_surface_palette (struct ddraw_surface *surface)
 
static HRESULT d3d_device_set_render_target (struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
 
static HRESULT d3d_device7_SetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device3_SetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device2_SetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_GetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
 
static HRESULT WINAPI d3d_device3_GetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 **RenderTarget)
 
static HRESULT WINAPI d3d_device2_GetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface **RenderTarget)
 
static HRESULT WINAPI d3d_device3_Begin (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device2_Begin (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, DWORD flags)
 
static HRESULT WINAPI d3d_device3_BeginIndexed (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_BeginIndexed (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_Vertex (IDirect3DDevice3 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device2_Vertex (IDirect3DDevice2 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device3_Index (IDirect3DDevice3 *iface, WORD index)
 
static HRESULT WINAPI d3d_device2_Index (IDirect3DDevice2 *iface, WORD index)
 
static HRESULT d3d_device7_GetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static void fixup_texture_alpha_op (struct d3d_device *device)
 
static HRESULT WINAPI d3d_device3_SetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_GetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_SetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_SetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_GetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_GetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_GetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_MultiplyTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_MultiplyTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_MultiplyTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static void d3d_device_sync_rendertarget (struct d3d_device *device)
 
void d3d_device_sync_surfaces (struct d3d_device *device)
 
void d3d_device_apply_state (struct d3d_device *device, BOOL clear_state)
 
static HRESULT d3d_device7_DrawPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static void setup_lighting (const struct d3d_device *device, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_End (IDirect3DDevice3 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device2_End (IDirect3DDevice2 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_SetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_SetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device7_GetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_GetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_GetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static void pack_strided_data (BYTE *dst, DWORD count, const D3DDRAWPRIMITIVESTRIDEDDATA *src, DWORD fvf)
 
static HRESULT d3d_device7_DrawPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer *vertex_buffer, WORD *indices, DWORD index_count, DWORD flags)
 
static DWORD in_plane (UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
 
static void prepare_clip_space_planes (struct d3d_device *device, struct wined3d_vec4 *plane)
 
static void compute_sphere_visibility (const struct wined3d_vec4 *planes, DWORD enabled_planes, BOOL equality, const D3DVECTOR *centres, const D3DVALUE *radii, unsigned int sphere_count, DWORD *return_values)
 
static HRESULT WINAPI d3d_device7_ComputeSphereVisibility (IDirect3DDevice7 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT WINAPI d3d_device3_ComputeSphereVisibility (IDirect3DDevice3 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT d3d_device7_GetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device3_GetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 **Texture2)
 
static HRESULT d3d_device7_SetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device3_SetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 *texture)
 
static HRESULT d3d_device7_GetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT d3d_device7_ValidateDevice (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUSetup (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUPreserve (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device3_ValidateDevice (IDirect3DDevice3 *iface, DWORD *pass_count)
 
static HRESULT d3d_device7_Clear (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUSetup (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUPreserve (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT d3d_device7_SetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_GetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_SetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_GetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_SetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_GetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_BeginStateBlock (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT d3d_device7_EndStateBlock (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT d3d_device7_PreLoad (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT d3d_device7_ApplyStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CaptureStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_DeleteStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CreateStateBlock (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUSetup (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUPreserve (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static BOOL is_mip_level_subset (struct ddraw_surface *dest, struct ddraw_surface *src)
 
static void copy_mipmap_chain (struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
 
static HRESULT d3d_device7_Load (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT d3d_device7_LightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT d3d_device7_GetLightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT d3d_device7_SetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT d3d_device7_GetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetInfo (IDirect3DDevice7 *iface, DWORD info_id, void *info, DWORD info_size)
 
struct d3d_device * unsafe_impl_from_IDirect3DDevice7 (IDirect3DDevice7 *iface)
 
struct d3d_device * unsafe_impl_from_IDirect3DDevice3 (IDirect3DDevice3 *iface)
 
struct d3d_device * unsafe_impl_from_IDirect3DDevice2 (IDirect3DDevice2 *iface)
 
struct d3d_device * unsafe_impl_from_IDirect3DDevice (IDirect3DDevice *iface)
 
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil (struct d3d_device *device)
 
static void device_reset_viewport_state (struct d3d_device *device)
 
static HRESULT d3d_device_init (struct d3d_device *device, struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
 
HRESULT d3d_device_create (struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown)
 

Variables

const GUID IID_D3DDEVICE_WineD3D
 
static const struct tss_lookup tss_lookup []
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
 
static const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
 
static const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
 
static const struct IDirect3DDeviceVtbl d3d_device1_vtbl
 
static const struct IUnknownVtbl d3d_device_inner_vtbl
 

Function Documentation

◆ check_d3ddevicedesc_size()

static BOOL check_d3ddevicedesc_size ( DWORD  size)
inlinestatic

Definition at line 484 of file device.c.

485{
486 if (size == FIELD_OFFSET(D3DDEVICEDESC, dwMinTextureWidth) /* 172 */
487 || size == FIELD_OFFSET(D3DDEVICEDESC, dwMaxTextureRepeat) /* 204 */
488 || size == sizeof(D3DDEVICEDESC) /* 252 */) return TRUE;
489 return FALSE;
490}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by d3d_device3_GetCaps().

◆ compute_sphere_visibility()

static void compute_sphere_visibility ( const struct wined3d_vec4 *  planes,
DWORD  enabled_planes,
BOOL  equality,
const D3DVECTOR *  centres,
const D3DVALUE *  radii,
unsigned int  sphere_count,
DWORD *  return_values 
)
static

Definition at line 4486 of file device.c.

4488{
4489 unsigned int mask, i, j;
4490
4491 memset(return_values, 0, sphere_count * sizeof(*return_values));
4492 for (i = 0; i < sphere_count; ++i)
4493 {
4494 mask = enabled_planes;
4495 while (mask)
4496 {
4498 return_values[i] |= in_plane(j, planes[j], centres[i], radii[i], equality);
4499 }
4500 }
4501}
static DWORD in_plane(UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
Definition: device.c:4412
GLenum GLint GLuint mask
Definition: glext.h:6028
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define memset(x, y, z)
Definition: compat.h:39
static int wined3d_bit_scan(unsigned int *x)
Definition: wined3d.h:2982

Referenced by d3d_device3_ComputeSphereVisibility(), and d3d_device7_ComputeSphereVisibility().

◆ copy_mipmap_chain()

static void copy_mipmap_chain ( struct d3d_device *  device,
struct ddraw_surface *  dst,
struct ddraw_surface *  src,
const POINT *  DestPoint,
const RECT *  SrcRect 
)
static

Definition at line 5997 of file device.c.

5999{
6000 struct ddraw_surface *dst_level, *src_level;
6002 DDSURFACEDESC2 ddsd;
6003 POINT point;
6004 RECT src_rect;
6005 HRESULT hr;
6006 IDirectDrawPalette *pal = NULL, *pal_src = NULL;
6007 DWORD ckeyflag;
6008 DDCOLORKEY ddckey;
6009
6010 /* Copy palette, if possible. */
6011 IDirectDrawSurface7_GetPalette(&src->IDirectDrawSurface7_iface, &pal_src);
6012 IDirectDrawSurface7_GetPalette(&dst->IDirectDrawSurface7_iface, &pal);
6013
6014 if (pal_src != NULL && pal != NULL)
6015 {
6016 PALETTEENTRY palent[256];
6017
6018 IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
6019 IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
6020 }
6021
6022 if (pal) IDirectDrawPalette_Release(pal);
6023 if (pal_src) IDirectDrawPalette_Release(pal_src);
6024
6025 /* Copy colorkeys, if present. */
6026 for (ckeyflag = DDCKEY_DESTBLT; ckeyflag <= DDCKEY_SRCOVERLAY; ckeyflag <<= 1)
6027 {
6028 hr = IDirectDrawSurface7_GetColorKey(&src->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6029
6030 if (SUCCEEDED(hr))
6031 {
6032 IDirectDrawSurface7_SetColorKey(&dst->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6033 }
6034 }
6035
6036 src_level = src;
6037 dst_level = dst;
6038
6039 point = *DestPoint;
6040 src_rect = *SrcRect;
6041
6042 for (;src_level && dst_level;)
6043 {
6044 if (src_level->surface_desc.dwWidth == dst_level->surface_desc.dwWidth
6045 && src_level->surface_desc.dwHeight == dst_level->surface_desc.dwHeight)
6046 {
6047 UINT src_w = src_rect.right - src_rect.left;
6048 UINT src_h = src_rect.bottom - src_rect.top;
6049 RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
6050
6051 if (FAILED(hr = wined3d_device_context_blt(device->immediate_context,
6052 ddraw_surface_get_any_texture(dst_level, DDRAW_SURFACE_RW), dst_level->sub_resource_idx, &dst_rect,
6054 src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
6055 ERR("Blit failed, hr %#lx.\n", hr);
6056
6059 IDirectDrawSurface7_GetAttachedSurface(&dst_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6060
6061 if (dst_level != dst)
6062 IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6063
6065 }
6066
6069 IDirectDrawSurface7_GetAttachedSurface(&src_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6070
6071 if (src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6072
6074
6075 point.x /= 2;
6076 point.y /= 2;
6077
6078 src_rect.top /= 2;
6079 src_rect.left /= 2;
6080 src_rect.right = (src_rect.right + 1) / 2;
6081 src_rect.bottom = (src_rect.bottom + 1) / 2;
6082 }
6083
6084 if (src_level && src_level != src)
6085 IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6086 if (dst_level && dst_level != dst)
6087 IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6088}
#define ERR(fmt,...)
Definition: precomp.h:57
static struct wined3d_texture * ddraw_surface_get_any_texture(struct ddraw_surface *surface, unsigned int flags)
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
Definition: surface.c:5950
#define DDRAW_SURFACE_RW
#define DDRAW_SURFACE_READ
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
HRESULT CDECL wined3d_device_context_blt(struct wined3d_device_context *context, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: texture.c:3854
POINTL point
Definition: edittest.c:50
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: sysinfo.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
static calc_node_t temp
Definition: rpn_ieee.c:38
#define DDSCAPS2_MIPMAPSUBLEVEL
Definition: ddraw.h:306
#define DDCKEY_SRCOVERLAY
Definition: ddraw.h:481
#define DDCKEY_DESTBLT
Definition: ddraw.h:478
#define DDSCAPS_TEXTURE
Definition: ddraw.h:264
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
DWORD dwCaps2
Definition: ddraw.h:735
DWORD dwCaps
Definition: ddraw.h:734
DWORD dwWidth
Definition: ddraw.h:1157
DWORD dwHeight
Definition: ddraw.h:1156
DDSCAPS2 ddsCaps
Definition: ddraw.h:1190
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
DDSURFACEDESC2 surface_desc
unsigned int sub_resource_idx
IDirectDrawSurface7 IDirectDrawSurface7_iface
Definition: devices.h:37
@ WINED3D_TEXF_POINT
Definition: wined3d.h:706

Referenced by d3d_device7_Load().

◆ d3d_device1_AddRef()

static ULONG WINAPI d3d_device1_AddRef ( IDirect3DDevice *  iface)
static

Definition at line 251 of file device.c.

252{
254
255 TRACE("iface %p.\n", iface);
256
257 return IUnknown_AddRef(device->outer_unknown);
258}
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_AddViewport()

static HRESULT WINAPI d3d_device1_AddViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 808 of file device.c.

809{
812
813 TRACE("iface %p, viewport %p.\n", iface, viewport);
814
815 return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
816}
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface)
Definition: viewport.c:1224
static HRESULT WINAPI d3d_device3_AddViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:776
IDirect3DViewport3 IDirect3DViewport3_iface

◆ d3d_device1_BeginScene()

static HRESULT WINAPI d3d_device1_BeginScene ( IDirect3DDevice *  iface)
static

Definition at line 1554 of file device.c.

1555{
1557
1558 TRACE("iface %p.\n", iface);
1559
1560 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1561}
#define IDirect3DDevice7_BeginScene(p)
Definition: d3d.h:1348

◆ d3d_device1_CreateExecuteBuffer()

static HRESULT WINAPI d3d_device1_CreateExecuteBuffer ( IDirect3DDevice *  iface,
D3DEXECUTEBUFFERDESC *  buffer_desc,
IDirect3DExecuteBuffer **  ExecuteBuffer,
IUnknown *  outer_unknown 
)
static

Definition at line 684 of file device.c.

686{
689 HRESULT hr;
690
691 TRACE("iface %p, buffer_desc %p, buffer %p, outer_unknown %p.\n",
692 iface, buffer_desc, ExecuteBuffer, outer_unknown);
693
694 if (outer_unknown)
696
697 /* Allocate the new Execute Buffer */
698 if (!(object = calloc(1, sizeof(*object))))
699 {
700 ERR("Failed to allocate execute buffer memory.\n");
701 return DDERR_OUTOFMEMORY;
702 }
703
704 hr = d3d_execute_buffer_init(object, device, buffer_desc);
705 if (FAILED(hr))
706 {
707 WARN("Failed to initialize execute buffer, hr %#lx.\n", hr);
708 free(object);
709 return hr;
710 }
711
712 *ExecuteBuffer = &object->IDirect3DExecuteBuffer_iface;
713
714 TRACE(" Returning IDirect3DExecuteBuffer at %p, implementation is at %p\n", *ExecuteBuffer, object);
715
716 return D3D_OK;
717}
#define WARN(fmt,...)
Definition: precomp.h:61
#define D3D_OK
Definition: d3d.h:106
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc)
#define free
Definition: debug_ros.c:5
#define calloc
Definition: rosglue.h:14
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:113
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ d3d_device1_CreateMatrix()

static HRESULT WINAPI d3d_device1_CreateMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE *  D3DMatHandle 
)
static

Definition at line 1313 of file device.c.

1314{
1316 DWORD h;
1317
1318 TRACE("iface %p, matrix_handle %p.\n", iface, D3DMatHandle);
1319
1320 if(!D3DMatHandle)
1321 return DDERR_INVALIDPARAMS;
1322
1323 if (!(matrix = calloc(1, sizeof(*matrix))))
1324 {
1325 ERR("Out of memory when allocating a D3DMATRIX\n");
1326 return DDERR_OUTOFMEMORY;
1327 }
1328
1330
1332 if (h == DDRAW_INVALID_HANDLE)
1333 {
1334 ERR("Failed to allocate a matrix handle.\n");
1335 free(matrix);
1337 return DDERR_OUTOFMEMORY;
1338 }
1339
1340 *D3DMatHandle = h + 1;
1341
1342 TRACE(" returning matrix handle %#lx\n", *D3DMatHandle);
1343
1345
1346 return D3D_OK;
1347}
#define DDRAW_INVALID_HANDLE
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type)
Definition: main.c:138
@ DDRAW_HANDLE_MATRIX
GLuint GLenum matrix
Definition: glext.h:9407
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:81
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539

◆ d3d_device1_DeleteMatrix()

static HRESULT WINAPI d3d_device1_DeleteMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle 
)
static

Definition at line 1467 of file device.c.

1468{
1469 D3DMATRIX *m;
1470
1471 TRACE("iface %p, matrix_handle %#lx.\n", iface, D3DMatHandle);
1472
1474
1475 m = ddraw_free_handle(NULL, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1476 if (!m)
1477 {
1478 WARN("Invalid matrix handle.\n");
1480 return DDERR_INVALIDPARAMS;
1481 }
1482
1484
1485 free(m);
1486
1487 return D3D_OK;
1488}
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type)
Definition: main.c:184
const GLfloat * m
Definition: glext.h:10848

◆ d3d_device1_DeleteViewport()

static HRESULT WINAPI d3d_device1_DeleteViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 886 of file device.c.

887{
890
891 TRACE("iface %p, viewport %p.\n", iface, viewport);
892
893 return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
894 vp ? &vp->IDirect3DViewport3_iface : NULL);
895}
static HRESULT WINAPI d3d_device3_DeleteViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:834

◆ d3d_device1_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene ( IDirect3DDevice *  iface)
static

Definition at line 1627 of file device.c.

1628{
1630
1631 TRACE("iface %p.\n", iface);
1632
1633 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1634}
#define IDirect3DDevice7_EndScene(p)
Definition: d3d.h:1349

◆ d3d_device1_EnumTextureFormats()

static HRESULT WINAPI d3d_device1_EnumTextureFormats ( IDirect3DDevice *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1287 of file device.c.

1289{
1291
1292 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1293
1294 return d3d_device2_EnumTextureFormats(&device->IDirect3DDevice2_iface, callback, context);
1295}
static HRESULT WINAPI d3d_device2_EnumTextureFormats(IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
Definition: device.c:1217
static IPrintDialogCallback callback
Definition: printdlg.c:325
Definition: http.c:7252

◆ d3d_device1_Execute()

static HRESULT WINAPI d3d_device1_Execute ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  ExecuteBuffer,
IDirect3DViewport *  viewport,
DWORD  flags 
)
static

Definition at line 734 of file device.c.

736{
739 struct d3d_viewport *viewport_impl = unsafe_impl_from_IDirect3DViewport(viewport);
740 HRESULT hr;
741
742 TRACE("iface %p, buffer %p, viewport %p, flags %#lx.\n", iface, ExecuteBuffer, viewport, flags);
743
744 if(!buffer)
745 return DDERR_INVALIDPARAMS;
746
748 (&device->IDirect3DDevice3_iface, &viewport_impl->IDirect3DViewport3_iface)))
749 return hr;
750
751 /* Execute... */
755
756 return hr;
757}
#define IDirect3DDevice3_SetCurrentViewport(p, a)
Definition: d3d.h:1203
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device)
Definition: executebuffer.c:48
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161

◆ d3d_device1_GetCaps()

static HRESULT WINAPI d3d_device1_GetCaps ( IDirect3DDevice *  iface,
D3DDEVICEDESC *  hw_desc,
D3DDEVICEDESC *  hel_desc 
)
static

Definition at line 542 of file device.c.

544{
546
547 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
548
549 return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
550}
static HRESULT WINAPI d3d_device3_GetCaps(IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
Definition: device.c:492

◆ d3d_device1_GetDirect3D()

static HRESULT WINAPI d3d_device1_GetDirect3D ( IDirect3DDevice *  iface,
IDirect3D **  d3d 
)
static

Definition at line 1698 of file device.c.

1699{
1701
1702 TRACE("iface %p, d3d %p.\n", iface, d3d);
1703
1704 if (!d3d)
1705 return DDERR_INVALIDPARAMS;
1706
1707 *d3d = &device->ddraw->IDirect3D_iface;
1708 IDirect3D_AddRef(*d3d);
1709
1710 TRACE("Returning interface %p.\n", *d3d);
1711 return D3D_OK;
1712}
#define IDirect3D_AddRef(p)
Definition: d3d.h:232

◆ d3d_device1_GetMatrix()

static HRESULT WINAPI d3d_device1_GetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle,
D3DMATRIX *  D3DMatrix 
)
static

Definition at line 1426 of file device.c.

1428{
1429 D3DMATRIX *m;
1430
1431 TRACE("iface %p, matrix_handle %#lx, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
1432
1433 if (!D3DMatrix) return DDERR_INVALIDPARAMS;
1434
1436
1437 m = ddraw_get_object(NULL, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1438 if (!m)
1439 {
1440 WARN("Invalid matrix handle.\n");
1442 return DDERR_INVALIDPARAMS;
1443 }
1444
1445 *D3DMatrix = *m;
1446
1448
1449 return D3D_OK;
1450}
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type)
Definition: main.c:213

◆ d3d_device1_GetPickRecords()

static HRESULT WINAPI d3d_device1_GetPickRecords ( IDirect3DDevice *  iface,
DWORD *  count,
D3DPICKRECORD *  records 
)
static

Definition at line 1048 of file device.c.

1050{
1051 FIXME("iface %p, count %p, records %p stub!\n", iface, count, records);
1052
1053 return D3D_OK;
1054}
#define FIXME(fmt,...)
Definition: precomp.h:53
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ d3d_device1_GetStats()

static HRESULT WINAPI d3d_device1_GetStats ( IDirect3DDevice *  iface,
D3DSTATS *  stats 
)
static

Definition at line 655 of file device.c.

656{
658
659 TRACE("iface %p, stats %p.\n", iface, stats);
660
661 return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
662}
static HRESULT WINAPI d3d_device3_GetStats(IDirect3DDevice3 *iface, D3DSTATS *Stats)
Definition: device.c:629

◆ d3d_device1_Initialize()

static HRESULT WINAPI d3d_device1_Initialize ( IDirect3DDevice *  iface,
IDirect3D *  d3d,
GUID *  guid,
D3DDEVICEDESC *  device_desc 
)
static

Definition at line 410 of file device.c.

412{
413 /* It shouldn't be crucial, but print a FIXME, I'm interested if
414 * any game calls it and when. */
415 FIXME("iface %p, d3d %p, guid %s, device_desc %p nop!\n",
416 iface, d3d, debugstr_guid(guid), device_desc);
417
418 return D3D_OK;
419}
GUID guid
Definition: version.c:147
#define debugstr_guid
Definition: kernel32.h:35

◆ d3d_device1_NextViewport()

static HRESULT WINAPI d3d_device1_NextViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport,
IDirect3DViewport **  next,
DWORD  flags 
)
static

Definition at line 985 of file device.c.

987{
990 IDirect3DViewport3 *res;
991 HRESULT hr;
992
993 TRACE("iface %p, viewport %p, next %p, flags %#lx.\n",
994 iface, viewport, next, flags);
995
996 hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
998 *next = (IDirect3DViewport *)res;
999 return hr;
1000}
static HRESULT WINAPI d3d_device3_NextViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
Definition: device.c:915
GLuint res
Definition: glext.h:9613
static unsigned __int64 next
Definition: rand_nt.c:6

◆ d3d_device1_Pick()

static HRESULT WINAPI d3d_device1_Pick ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  buffer,
IDirect3DViewport *  viewport,
DWORD  flags,
D3DRECT *  rect 
)
static

Definition at line 1023 of file device.c.

1025{
1026 FIXME("iface %p, buffer %p, viewport %p, flags %#lx, rect %s stub!\n",
1027 iface, buffer, viewport, flags, wine_dbgstr_rect((RECT *)rect));
1028
1029 return D3D_OK;
1030}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
RECT rect
Definition: combotst.c:67

◆ d3d_device1_QueryInterface()

static HRESULT WINAPI d3d_device1_QueryInterface ( IDirect3DDevice *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 205 of file device.c.

206{
208
209 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
210
211 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
212}
REFIID riid
Definition: atlbase.h:39
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

◆ d3d_device1_Release()

static ULONG WINAPI d3d_device1_Release ( IDirect3DDevice *  iface)
static

Definition at line 383 of file device.c.

384{
386
387 TRACE("iface %p.\n", iface);
388
389 return IUnknown_Release(device->outer_unknown);
390}

◆ d3d_device1_SetMatrix()

static HRESULT WINAPI d3d_device1_SetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  matrix_handle,
D3DMATRIX *  matrix 
)
static

Definition at line 1367 of file device.c.

1369{
1371 D3DMATRIX *m;
1372
1373 TRACE("iface %p, matrix_handle %#lx, matrix %p.\n", iface, matrix_handle, matrix);
1374
1375 if (!matrix)
1376 return DDERR_INVALIDPARAMS;
1377
1379
1380 m = ddraw_get_object(NULL, matrix_handle - 1, DDRAW_HANDLE_MATRIX);
1381 if (!m)
1382 {
1383 WARN("Invalid matrix handle.\n");
1385 return DDERR_INVALIDPARAMS;
1386 }
1387
1388 if (TRACE_ON(ddraw))
1390
1391 *m = *matrix;
1392
1393 if (matrix_handle == device->world)
1396
1397 if (matrix_handle == device->view)
1400
1401 if (matrix_handle == device->proj)
1404
1406
1407 return D3D_OK;
1408}
void dump_D3DMATRIX(const D3DMATRIX *mat)
Definition: utils.c:906
#define TRACE_ON(x)
Definition: compat.h:75
void CDECL wined3d_stateblock_set_transform(struct wined3d_stateblock *stateblock, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: stateblock.c:1840
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:683
@ WINED3D_TS_PROJECTION
Definition: wined3d.h:668
@ WINED3D_TS_VIEW
Definition: wined3d.h:667

◆ d3d_device1_SwapTextureHandles()

static HRESULT WINAPI d3d_device1_SwapTextureHandles ( IDirect3DDevice *  iface,
IDirect3DTexture *  tex1,
IDirect3DTexture *  tex2 
)
static

Definition at line 597 of file device.c.

599{
603 IDirect3DTexture2 *t1 = surf1 ? &surf1->IDirect3DTexture2_iface : NULL;
604 IDirect3DTexture2 *t2 = surf2 ? &surf2->IDirect3DTexture2_iface : NULL;
605
606 TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
607
608 return d3d_device2_SwapTextureHandles(&device->IDirect3DDevice2_iface, t1, t2);
609}
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface)
Definition: surface.c:6037
static HRESULT WINAPI d3d_device2_SwapTextureHandles(IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
Definition: device.c:564
IDirect3DTexture2 IDirect3DTexture2_iface

◆ d3d_device2_AddRef()

static ULONG WINAPI d3d_device2_AddRef ( IDirect3DDevice2 *  iface)
static

Definition at line 242 of file device.c.

243{
245
246 TRACE("iface %p.\n", iface);
247
248 return IUnknown_AddRef(device->outer_unknown);
249}
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_AddViewport()

static HRESULT WINAPI d3d_device2_AddViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 797 of file device.c.

799{
802
803 TRACE("iface %p, viewport %p.\n", iface, viewport);
804
805 return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
806}
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface)
Definition: viewport.c:1216

◆ d3d_device2_Begin()

static HRESULT WINAPI d3d_device2_Begin ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
DWORD  flags 
)
static

Definition at line 2154 of file device.c.

2156{
2158 DWORD fvf;
2159
2160 TRACE("iface %p, primitive_type %#x, vertex_type %#x, flags %#lx.\n",
2162
2163 switch (vertex_type)
2164 {
2165 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2166 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2167 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2168 default:
2169 ERR("Unexpected vertex type %#x.\n", vertex_type);
2170 return DDERR_INVALIDPARAMS; /* Should never happen */
2171 };
2172
2173 return d3d_device3_Begin(&device->IDirect3DDevice3_iface, primitive_type, fvf, flags);
2174}
@ D3DVT_TLVERTEX
Definition: d3dtypes.h:816
@ D3DVT_LVERTEX
Definition: d3dtypes.h:815
@ D3DVT_VERTEX
Definition: d3dtypes.h:814
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
static HRESULT WINAPI d3d_device3_Begin(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
Definition: device.c:2135
D3DPRIMITIVETYPE primitive_type
DWORD vertex_type

◆ d3d_device2_BeginIndexed()

static HRESULT WINAPI d3d_device2_BeginIndexed ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2206 of file device.c.

2209{
2211 DWORD fvf;
2212
2213 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %lu, flags %#lx.\n",
2214 iface, primitive_type, vertex_type, vertices, vertex_count, flags);
2215
2216 switch (vertex_type)
2217 {
2218 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2219 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2220 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2221 default:
2222 ERR("Unexpected vertex type %#x.\n", vertex_type);
2223 return DDERR_INVALIDPARAMS; /* Should never happen */
2224 };
2225
2226 return d3d_device3_BeginIndexed(&device->IDirect3DDevice3_iface,
2227 primitive_type, fvf, vertices, vertex_count, flags);
2228}
static HRESULT WINAPI d3d_device3_BeginIndexed(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:2195
int vertex_count
Definition: d3drm.c:3528

◆ d3d_device2_BeginScene()

static HRESULT WINAPI d3d_device2_BeginScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1545 of file device.c.

1546{
1548
1549 TRACE("iface %p.\n", iface);
1550
1551 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1552}

◆ d3d_device2_DeleteViewport()

static HRESULT WINAPI d3d_device2_DeleteViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 875 of file device.c.

876{
879
880 TRACE("iface %p, viewport %p.\n", iface, viewport);
881
882 return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
883 vp ? &vp->IDirect3DViewport3_iface : NULL);
884}

◆ d3d_device2_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void *  vertices,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3702 of file device.c.

3705{
3707 DWORD fvf;
3708
3709 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %lu, "
3710 "indices %p, index_count %lu, flags %#lx.\n",
3711 iface, primitive_type, vertex_type, vertices, vertex_count, indices, index_count, flags);
3712
3713 switch (vertex_type)
3714 {
3715 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3716 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3717 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3718 default:
3719 ERR("Unhandled vertex type %#x.\n", vertex_type);
3720 return DDERR_INVALIDPARAMS; /* Should never happen */
3721 }
3722
3723 return d3d_device3_DrawIndexedPrimitive(&device->IDirect3DDevice3_iface,
3724 primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3725}
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:3686
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545

◆ d3d_device2_DrawPrimitive()

static HRESULT WINAPI d3d_device2_DrawPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3558 of file device.c.

3561{
3563 DWORD fvf;
3564
3565 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %lu, flags %#lx.\n",
3566 iface, primitive_type, vertex_type, vertices, vertex_count, flags);
3567
3568 switch (vertex_type)
3569 {
3570 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3571 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3572 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3573 default:
3574 FIXME("Unhandled vertex type %#x.\n", vertex_type);
3575 return DDERR_INVALIDPARAMS; /* Should never happen */
3576 }
3577
3578 return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface,
3579 primitive_type, fvf, vertices, vertex_count, flags);
3580}
static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3543

◆ d3d_device2_End()

static HRESULT WINAPI d3d_device2_End ( IDirect3DDevice2 *  iface,
DWORD  flags 
)
static

Definition at line 3755 of file device.c.

3756{
3758
3759 TRACE("iface %p, flags %#lx.\n", iface, flags);
3760
3761 return d3d_device3_End(&device->IDirect3DDevice3_iface, flags);
3762}
static HRESULT WINAPI d3d_device3_End(IDirect3DDevice3 *iface, DWORD flags)
Definition: device.c:3745

◆ d3d_device2_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1618 of file device.c.

1619{
1621
1622 TRACE("iface %p.\n", iface);
1623
1624 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1625}

◆ d3d_device2_EnumTextureFormats()

static HRESULT WINAPI d3d_device2_EnumTextureFormats ( IDirect3DDevice2 *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1217 of file device.c.

1219{
1222 HRESULT hr;
1223 unsigned int i;
1224
1225 static const enum wined3d_format_id FormatList[] =
1226 {
1227 /* 16 bit */
1232 /* 32 bit */
1235 /* 8 bit */
1238 /* FOURCC codes - Not in this version*/
1239 };
1240
1241 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1242
1243 if (!callback)
1244 return DDERR_INVALIDPARAMS;
1245
1247
1248 memset(&mode, 0, sizeof(mode));
1249 if (FAILED(hr = wined3d_output_get_display_mode(device->ddraw->wined3d_output, &mode, NULL)))
1250 {
1252 WARN("Failed to get output display mode, hr %#lx.\n", hr);
1253 return hr;
1254 }
1255
1256 for (i = 0; i < ARRAY_SIZE(FormatList); ++i)
1257 {
1258 if (wined3d_check_device_format(device->ddraw->wined3d, device->ddraw->wined3d_adapter,
1260 WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK)
1261 {
1262 DDSURFACEDESC sdesc;
1263
1264 memset(&sdesc, 0, sizeof(sdesc));
1265 sdesc.dwSize = sizeof(sdesc);
1266 sdesc.dwFlags = DDSD_PIXELFORMAT | DDSD_CAPS;
1267 sdesc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
1268 sdesc.ddpfPixelFormat.dwSize = sizeof(sdesc.ddpfPixelFormat);
1269 ddrawformat_from_wined3dformat(&sdesc.ddpfPixelFormat, FormatList[i]);
1270
1271 TRACE("Enumerating WineD3DFormat %d\n", FormatList[i]);
1272 hr = callback(&sdesc, context);
1273 if(hr != DDENUMRET_OK)
1274 {
1275 TRACE("Format enumeration cancelled by application\n");
1277 return D3D_OK;
1278 }
1279 }
1280 }
1281 TRACE("End of enumeration\n");
1283
1284 return D3D_OK;
1285}
#define ARRAY_SIZE(A)
Definition: main.h:20
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format)
Definition: utils.c:30
GLenum mode
Definition: glext.h:6217
#define DDSD_PIXELFORMAT
Definition: ddraw.h:218
#define DDENUMRET_OK
Definition: ddraw.h:191
#define DDSD_CAPS
Definition: ddraw.h:210
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, const struct wined3d_adapter *adapter, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, uint32_t usage, unsigned int bind_flags, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
Definition: directx.c:1972
HRESULT CDECL wined3d_output_get_display_mode(const struct wined3d_output *output, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:1515
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:720
#define WINED3D_BIND_SHADER_RESOURCE
Definition: wined3d.h:912
wined3d_format_id
Definition: wined3d.h:126
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:244
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:245
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:243
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:242
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:137
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:91

Referenced by d3d_device1_EnumTextureFormats().

◆ d3d_device2_GetCaps()

static HRESULT WINAPI d3d_device2_GetCaps ( IDirect3DDevice2 *  iface,
D3DDEVICEDESC *  hw_desc,
D3DDEVICEDESC *  hel_desc 
)
static

Definition at line 532 of file device.c.

534{
536
537 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
538
539 return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
540}

◆ d3d_device2_GetClipStatus()

static HRESULT WINAPI d3d_device2_GetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3846 of file device.c.

3847{
3849
3850 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3851
3852 return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3853}
#define IDirect3DDevice7_GetClipStatus(p, a)
Definition: d3d.h:1371

◆ d3d_device2_GetCurrentViewport()

static HRESULT WINAPI d3d_device2_GetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 **  viewport 
)
static

Definition at line 1820 of file device.c.

1821{
1823
1824 TRACE("iface %p, viewport %p.\n", iface, viewport);
1825
1826 return d3d_device3_GetCurrentViewport(&device->IDirect3DDevice3_iface,
1827 (IDirect3DViewport3 **)viewport);
1828}
static HRESULT WINAPI d3d_device3_GetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
Definition: device.c:1798

◆ d3d_device2_GetDirect3D()

static HRESULT WINAPI d3d_device2_GetDirect3D ( IDirect3DDevice2 *  iface,
IDirect3D2 **  d3d 
)
static

Definition at line 1682 of file device.c.

1683{
1685
1686 TRACE("iface %p, d3d %p.\n", iface, d3d);
1687
1688 if (!d3d)
1689 return DDERR_INVALIDPARAMS;
1690
1691 *d3d = &device->ddraw->IDirect3D2_iface;
1692 IDirect3D2_AddRef(*d3d);
1693
1694 TRACE("Returning interface %p.\n", *d3d);
1695 return D3D_OK;
1696}
#define IDirect3D2_AddRef(p)
Definition: d3d.h:279

◆ d3d_device2_GetLightState()

static HRESULT WINAPI d3d_device2_GetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 3098 of file device.c.

3100{
3102
3103 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3104
3105 return d3d_device3_GetLightState(&device->IDirect3DDevice3_iface, state, value);
3106}
static int state
Definition: maze.c:121
static HRESULT WINAPI d3d_device3_GetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
Definition: device.c:3034
Definition: pdh_main.c:64

◆ d3d_device2_GetRenderState()

static HRESULT WINAPI d3d_device2_GetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 2520 of file device.c.

2522{
2524
2525 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2526
2527 return IDirect3DDevice3_GetRenderState(&device->IDirect3DDevice3_iface, state, value);
2528}
#define IDirect3DDevice3_GetRenderState(p, a, b)
Definition: d3d.h:1212

◆ d3d_device2_GetRenderTarget()

static HRESULT WINAPI d3d_device2_GetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface **  RenderTarget 
)
static

Definition at line 2096 of file device.c.

2097{
2099 IDirectDrawSurface7 *RenderTarget7;
2100 struct ddraw_surface *RenderTargetImpl;
2101 HRESULT hr;
2102
2103 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2104
2105 if(!RenderTarget)
2106 return DDERR_INVALIDPARAMS;
2107
2108 hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2109 if(hr != D3D_OK) return hr;
2110 RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2111 *RenderTarget = &RenderTargetImpl->IDirectDrawSurface_iface;
2112 IDirectDrawSurface_AddRef(*RenderTarget);
2113 IDirectDrawSurface7_Release(RenderTarget7);
2114 return D3D_OK;
2115}
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
static HRESULT WINAPI d3d_device7_GetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
Definition: device.c:2058
IDirectDrawSurface IDirectDrawSurface_iface

◆ d3d_device2_GetStats()

static HRESULT WINAPI d3d_device2_GetStats ( IDirect3DDevice2 *  iface,
D3DSTATS *  stats 
)
static

Definition at line 646 of file device.c.

647{
649
650 TRACE("iface %p, stats %p.\n", iface, stats);
651
652 return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
653}

◆ d3d_device2_GetTransform()

static HRESULT WINAPI d3d_device2_GetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3276 of file device.c.

3278{
3280
3281 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3282
3283 return IDirect3DDevice3_GetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3284}
#define IDirect3DDevice3_GetTransform(p, a, b)
Definition: d3d.h:1217

◆ d3d_device2_Index()

static HRESULT WINAPI d3d_device2_Index ( IDirect3DDevice2 *  iface,
WORD  index 
)
static

Definition at line 2306 of file device.c.

2307{
2309
2310 TRACE("iface %p, index %#x.\n", iface, index);
2311
2312 return d3d_device3_Index(&device->IDirect3DDevice3_iface, index);
2313}
static HRESULT WINAPI d3d_device3_Index(IDirect3DDevice3 *iface, WORD index)
Definition: device.c:2299
GLuint index
Definition: glext.h:6031

◆ d3d_device2_MultiplyTransform()

static HRESULT WINAPI d3d_device2_MultiplyTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3362 of file device.c.

3364{
3366
3367 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3368
3369 return IDirect3DDevice3_MultiplyTransform(&device->IDirect3DDevice3_iface, state, matrix);
3370}
#define IDirect3DDevice3_MultiplyTransform(p, a, b)
Definition: d3d.h:1218

◆ d3d_device2_NextViewport()

static HRESULT WINAPI d3d_device2_NextViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport,
IDirect3DViewport2 **  next,
DWORD  flags 
)
static

Definition at line 968 of file device.c.

970{
973 IDirect3DViewport3 *res;
974 HRESULT hr;
975
976 TRACE("iface %p, viewport %p, next %p, flags %#lx.\n",
977 iface, viewport, next, flags);
978
979 hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
981 *next = (IDirect3DViewport2 *)res;
982 return hr;
983}

◆ d3d_device2_QueryInterface()

static HRESULT WINAPI d3d_device2_QueryInterface ( IDirect3DDevice2 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 196 of file device.c.

197{
199
200 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
201
202 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
203}

◆ d3d_device2_Release()

static ULONG WINAPI d3d_device2_Release ( IDirect3DDevice2 *  iface)
static

Definition at line 374 of file device.c.

375{
377
378 TRACE("iface %p.\n", iface);
379
380 return IUnknown_Release(device->outer_unknown);
381}

◆ d3d_device2_SetClipStatus()

static HRESULT WINAPI d3d_device2_SetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3796 of file device.c.

3797{
3799
3800 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3801
3802 return IDirect3DDevice7_SetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3803}
#define IDirect3DDevice7_SetClipStatus(p, a)
Definition: d3d.h:1370

◆ d3d_device2_SetCurrentViewport()

static HRESULT WINAPI d3d_device2_SetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 1772 of file device.c.

1773{
1776
1777 TRACE("iface %p, viewport %p.\n", iface, viewport);
1778
1779 return d3d_device3_SetCurrentViewport(&device->IDirect3DDevice3_iface,
1780 vp ? &vp->IDirect3DViewport3_iface : NULL);
1781}
static HRESULT WINAPI d3d_device3_SetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:1730

◆ d3d_device2_SetLightState()

static HRESULT WINAPI d3d_device2_SetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD  value 
)
static

Definition at line 3006 of file device.c.

3008{
3010
3011 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
3012
3013 return d3d_device3_SetLightState(&device->IDirect3DDevice3_iface, state, value);
3014}
static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
Definition: device.c:2918

◆ d3d_device2_SetRenderState()

static HRESULT WINAPI d3d_device2_SetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2890 of file device.c.

2892{
2894
2895 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
2896
2897 return IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, state, value);
2898}
#define IDirect3DDevice3_SetRenderState(p, a, b)
Definition: d3d.h:1213

◆ d3d_device2_SetRenderTarget()

static HRESULT WINAPI d3d_device2_SetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface *  target,
DWORD  flags 
)
static

Definition at line 1988 of file device.c.

1990{
1993 HRESULT hr;
1994
1995 TRACE("iface %p, target %p, flags %#lx.\n", iface, target, flags);
1996
1998
1999 if (!validate_surface_palette(target_impl))
2000 {
2001 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
2003 return DDERR_INVALIDCAPS;
2004 }
2005
2006 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
2007 {
2008 WARN("Surface %p is not a render target.\n", target_impl);
2010 return DDERR_INVALIDCAPS;
2011 }
2012
2013 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
2014 {
2015 WARN("Surface %p is a depth buffer.\n", target_impl);
2016 IUnknown_Release(device->rt_iface);
2017 device->rt_iface = (IUnknown *)target;
2018 device->target = NULL;
2019 device->target_ds = NULL;
2022 }
2023
2024 if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
2025 {
2026 WARN("Surface %p is not in video memory.\n", target_impl);
2027 IDirectDrawSurface_AddRef(target);
2028 IUnknown_Release(device->rt_iface);
2029 device->rt_iface = (IUnknown *)target;
2030 device->target = NULL;
2031 device->target_ds = NULL;
2033 return D3D_OK;
2034 }
2035
2038 return hr;
2039}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
Definition: surface.c:6014
static HRESULT d3d_device_set_render_target(struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
Definition: device.c:1836
static BOOL validate_surface_palette(struct ddraw_surface *surface)
Definition: device.c:1830
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:269
#define DDERR_INVALIDPIXELFORMAT
Definition: ddraw.h:82
#define DDERR_INVALIDCAPS
Definition: ddraw.h:77
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:265
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:266
Definition: tools.h:99

◆ d3d_device2_SetTransform()

static HRESULT WINAPI d3d_device2_SetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3192 of file device.c.

3194{
3196
3197 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3198
3199 return IDirect3DDevice3_SetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3200}
#define IDirect3DDevice3_SetTransform(p, a, b)
Definition: d3d.h:1216

◆ d3d_device2_SwapTextureHandles()

static HRESULT WINAPI d3d_device2_SwapTextureHandles ( IDirect3DDevice2 *  iface,
IDirect3DTexture2 *  tex1,
IDirect3DTexture2 *  tex2 
)
static

Definition at line 564 of file device.c.

566{
569 DWORD h1, h2, h;
570 HRESULT hr;
571
572 TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
573
574 if (!surf1->Handle || !surf2->Handle)
575 return E_INVALIDARG;
576
578 return hr;
579
581
582 h1 = surf1->Handle - 1;
583 h2 = surf2->Handle - 1;
584 global_handle_table.entries[h1].object = surf2;
585 global_handle_table.entries[h2].object = surf1;
586 surf2->Handle = h1 + 1;
587 surf1->Handle = h2 + 1;
588
590
591 if ((h == surf1->Handle || h == surf2->Handle)
593 return hr;
594 return D3D_OK;
595}
#define IDirect3DDevice2_SetRenderState(p, a, b)
Definition: d3d.h:1086
#define IDirect3DDevice2_GetRenderState(p, a, b)
Definition: d3d.h:1085
@ D3DRENDERSTATE_TEXTUREHANDLE
Definition: d3dtypes.h:875
struct ddraw_handle_table global_handle_table
Definition: main.c:40
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
Definition: surface.c:6030
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by d3d_device1_SwapTextureHandles().

◆ d3d_device2_Vertex()

static HRESULT WINAPI d3d_device2_Vertex ( IDirect3DDevice2 *  iface,
void *  vertex 
)
static

Definition at line 2277 of file device.c.

2278{
2280
2281 TRACE("iface %p, vertex %p.\n", iface, vertex);
2282
2283 return d3d_device3_Vertex(&device->IDirect3DDevice3_iface, vertex);
2284}
static HRESULT WINAPI d3d_device3_Vertex(IDirect3DDevice3 *iface, void *vertex)
Definition: device.c:2247
Definition: mesh.c:4665

◆ d3d_device3_AddRef()

static ULONG WINAPI d3d_device3_AddRef ( IDirect3DDevice3 *  iface)
static

Definition at line 233 of file device.c.

234{
236
237 TRACE("iface %p.\n", iface);
238
239 return IUnknown_AddRef(device->outer_unknown);
240}
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)

◆ d3d_device3_AddViewport()

static HRESULT WINAPI d3d_device3_AddViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 776 of file device.c.

777{
780
781 TRACE("iface %p, viewport %p.\n", iface, viewport);
782
783 /* Sanity check */
784 if(!vp)
785 return DDERR_INVALIDPARAMS;
786
789 list_add_head(&device->viewport_list, &vp->entry);
790 /* Viewport must be usable for Clear() after AddViewport, so set active_device here. */
791 vp->active_device = device;
793
794 return D3D_OK;
795}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define IDirect3DViewport3_AddRef(p)
Definition: d3d.h:826
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface)
Definition: viewport.c:1209
struct d3d_device * active_device
struct list entry

Referenced by d3d_device1_AddViewport(), and d3d_device2_AddViewport().

◆ d3d_device3_Begin()

static HRESULT WINAPI d3d_device3_Begin ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
DWORD  flags 
)
static

Definition at line 2135 of file device.c.

2137{
2139
2140 TRACE("iface %p, primitive_type %#x, fvf %#lx, flags %#lx.\n",
2141 iface, primitive_type, fvf, flags);
2142
2144 device->primitive_type = primitive_type;
2145 device->vertex_type = fvf;
2146 device->render_flags = flags;
2147 device->vertex_size = get_flexible_vertex_size(device->vertex_type);
2148 device->nb_vertices = 0;
2150
2151 return D3D_OK;
2152}
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType)
Definition: utils.c:915

Referenced by d3d_device2_Begin().

◆ d3d_device3_BeginIndexed()

static HRESULT WINAPI d3d_device3_BeginIndexed ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2195 of file device.c.

2198{
2199 FIXME("iface %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, flags %#lx stub!\n",
2200 iface, primitive_type, fvf, vertices, vertex_count, flags);
2201
2202 return D3D_OK;
2203}

Referenced by d3d_device2_BeginIndexed().

◆ d3d_device3_BeginScene()

static HRESULT WINAPI d3d_device3_BeginScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1536 of file device.c.

1537{
1539
1540 TRACE("iface %p.\n", iface);
1541
1542 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1543}

◆ d3d_device3_ComputeSphereVisibility()

static HRESULT WINAPI d3d_device3_ComputeSphereVisibility ( IDirect3DDevice3 *  iface,
D3DVECTOR *  centers,
D3DVALUE *  radii,
DWORD  sphere_count,
DWORD  flags,
DWORD *  return_values 
)
static

Definition at line 4525 of file device.c.

4527{
4528 static const DWORD enabled_planes = 0x3f;
4529 struct wined3d_vec4 plane[6];
4530 unsigned int i, j;
4531
4532 TRACE("iface %p, centers %p, radii %p, sphere_count %lu, flags %#lx, return_values %p.\n",
4533 iface, centers, radii, sphere_count, flags, return_values);
4534
4536
4537 compute_sphere_visibility(plane, enabled_planes, TRUE, centers, radii, sphere_count, return_values);
4538 for (i = 0; i < sphere_count; ++i)
4539 {
4540 BOOL intersect_frustum = FALSE, outside_frustum = FALSE;
4541 DWORD d3d7_result = return_values[i];
4542
4543 return_values[i] = 0;
4544
4545 for (j = 0; j < 6; ++j)
4546 {
4547 DWORD clip = (d3d7_result >> j) & (D3DSTATUS_CLIPUNIONLEFT | D3DSTATUS_CLIPINTERSECTIONLEFT);
4548
4549 if (clip == D3DSTATUS_CLIPUNIONLEFT)
4550 {
4551 return_values[i] |= D3DVIS_INTERSECT_LEFT << j * 2;
4552 intersect_frustum = TRUE;
4553 }
4554 else if (clip)
4555 {
4556 return_values[i] |= D3DVIS_OUTSIDE_LEFT << j * 2;
4557 outside_frustum = TRUE;
4558 }
4559 }
4560 if (outside_frustum)
4561 return_values[i] |= D3DVIS_OUTSIDE_FRUSTUM;
4562 else if (intersect_frustum)
4563 return_values[i] |= D3DVIS_INTERSECT_FRUSTUM;
4564 }
4565 return D3D_OK;
4566}
#define D3DVIS_INTERSECT_LEFT
Definition: d3dtypes.h:1354
#define D3DSTATUS_CLIPINTERSECTIONLEFT
Definition: d3dtypes.h:434
#define D3DSTATUS_CLIPUNIONLEFT
Definition: d3dtypes.h:421
#define D3DVIS_OUTSIDE_FRUSTUM
Definition: d3dtypes.h:1352
#define D3DVIS_INTERSECT_FRUSTUM
Definition: d3dtypes.h:1351
#define D3DVIS_OUTSIDE_LEFT
Definition: d3dtypes.h:1355
static void prepare_clip_space_planes(struct d3d_device *device, struct wined3d_vec4 *plane)
Definition: device.c:4436
static void compute_sphere_visibility(const struct wined3d_vec4 *planes, DWORD enabled_planes, BOOL equality, const D3DVECTOR *centres, const D3DVALUE *radii, unsigned int sphere_count, DWORD *return_values)
Definition: device.c:4486
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270

◆ d3d_device3_DeleteViewport()

static HRESULT WINAPI d3d_device3_DeleteViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 834 of file device.c.

835{
838
839 TRACE("iface %p, viewport %p.\n", iface, viewport);
840
841 if (!vp)
842 {
843 WARN("NULL viewport, returning DDERR_INVALIDPARAMS\n");
844 return DDERR_INVALIDPARAMS;
845 }
846
848
849 if (vp->active_device != device)
850 {
851 WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
853 return DDERR_INVALIDPARAMS;
854 }
855
856 if (device->current_viewport == vp)
857 {
858 TRACE("Deleting current viewport, unsetting and releasing.\n");
859
862 device->current_viewport = NULL;
863 }
864
865 vp->active_device = NULL;
866 list_remove(&vp->entry);
867
869
871
872 return D3D_OK;
873}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define IDirect3DViewport3_Release(p)
Definition: d3d.h:827
void viewport_deactivate(struct d3d_viewport *viewport)
Definition: viewport.c:111

Referenced by d3d_device1_DeleteViewport(), and d3d_device2_DeleteViewport().

◆ d3d_device3_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3686 of file device.c.

3689{
3691
3692 TRACE("iface %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, "
3693 "indices %p, index_count %lu, flags %#lx.\n",
3694 iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3695
3697
3698 return IDirect3DDevice7_DrawIndexedPrimitive(&device->IDirect3DDevice7_iface,
3699 primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3700}
#define IDirect3DDevice7_DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
Definition: d3d.h:1369
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3531

Referenced by d3d_device2_DrawIndexedPrimitive().

◆ d3d_device3_DrawIndexedPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD *  Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4104 of file device.c.

4108{
4110
4111 TRACE("iface %p, primitive_type %#x, FVF %#lx, strided_data %p, vertex_count %lu, indices %p, index_count %lu, flags %#lx.\n",
4112 iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4113
4114 setup_lighting(device, VertexType, Flags);
4115
4116 return IDirect3DDevice7_DrawIndexedPrimitiveStrided(&device->IDirect3DDevice7_iface,
4117 PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4118}
#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p, a, b, c, d, e, f, g)
Definition: d3d.h:1373
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245

◆ d3d_device3_DrawIndexedPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
IDirect3DVertexBuffer *  vertex_buffer,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 4364 of file device.c.

4367{
4368 struct d3d_vertex_buffer *vb =
4369 unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)vertex_buffer);
4371 DWORD stride;
4372
4373 TRACE("iface %p, primitive_type %#x, vb %p, indices %p, index_count %lu, flags %#lx.\n",
4374 iface, primitive_type, vertex_buffer, indices, index_count, flags);
4375
4377
4378 if (!(stride = get_flexible_vertex_size(vb->fvf)))
4379 return D3D_OK;
4380
4381 return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, primitive_type,
4382 &vb->IDirect3DVertexBuffer7_iface, 0, vb->size / stride, indices, index_count, flags);
4383}
#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p, a, b, c, d, e, f, g)
Definition: d3d.h:1375
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:510
GLsizei stride
Definition: glext.h:5848
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface

◆ d3d_device3_DrawPrimitive()

static HRESULT WINAPI d3d_device3_DrawPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3543 of file device.c.

3546{
3548
3549 TRACE("iface %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, flags %#lx.\n",
3550 iface, primitive_type, fvf, vertices, vertex_count, flags);
3551
3553
3554 return IDirect3DDevice7_DrawPrimitive(&device->IDirect3DDevice7_iface,
3555 primitive_type, fvf, vertices, vertex_count, flags);
3556}
#define IDirect3DDevice7_DrawPrimitive(p, a, b, c, d, e)
Definition: d3d.h:1368

Referenced by d3d_device2_DrawPrimitive(), and d3d_device3_End().

◆ d3d_device3_DrawPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 3996 of file device.c.

3999{
4001
4002 TRACE("iface %p, primitive_type %#x, FVF %#lx, strided_data %p, vertex_count %lu, flags %#lx.\n",
4003 iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4004
4005 setup_lighting(device, VertexType, Flags);
4006
4007 return IDirect3DDevice7_DrawPrimitiveStrided(&device->IDirect3DDevice7_iface,
4008 PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4009}
#define IDirect3DDevice7_DrawPrimitiveStrided(p, a, b, c, d, e)
Definition: d3d.h:1372

◆ d3d_device3_DrawPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4223 of file device.c.

4225{
4227 struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
4228
4229 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %lu, vertex_count %lu, flags %#lx.\n",
4230 iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4231
4233
4234 return IDirect3DDevice7_DrawPrimitiveVB(&device->IDirect3DDevice7_iface,
4235 PrimitiveType, &vb->IDirect3DVertexBuffer7_iface, StartVertex, NumVertices, Flags);
4236}
#define IDirect3DDevice7_DrawPrimitiveVB(p, a, b, c, d, e)
Definition: d3d.h:1374

◆ d3d_device3_End()

static HRESULT WINAPI d3d_device3_End ( IDirect3DDevice3 *  iface,
DWORD  flags 
)
static

Definition at line 3745 of file device.c.

3746{
3748
3749 TRACE("iface %p, flags %#lx.\n", iface, flags);
3750
3751 return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface, device->primitive_type,
3752 device->vertex_type, device->sysmem_vertex_buffer, device->nb_vertices, device->render_flags);
3753}

Referenced by d3d_device2_End().

◆ d3d_device3_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1609 of file device.c.

1610{
1612
1613 TRACE("iface %p.\n", iface);
1614
1615 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1616}

◆ d3d_device3_EnumTextureFormats()

static HRESULT WINAPI d3d_device3_EnumTextureFormats ( IDirect3DDevice3 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1197 of file device.c.

1199{
1201
1202 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1203
1204 return IDirect3DDevice7_EnumTextureFormats(&device->IDirect3DDevice7_iface, callback, context);
1205}
#define IDirect3DDevice7_EnumTextureFormats(p, a, b)
Definition: d3d.h:1347

◆ d3d_device3_GetCaps()

static HRESULT WINAPI d3d_device3_GetCaps ( IDirect3DDevice3 *  iface,
D3DDEVICEDESC *  HWDesc,
D3DDEVICEDESC *  HelDesc 
)
static

Definition at line 492 of file device.c.

494{
496 D3DDEVICEDESC7 desc7;
497 D3DDEVICEDESC desc1;
498 HRESULT hr;
499
500 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, HWDesc, HelDesc);
501
502 if (!HWDesc)
503 {
504 WARN("HWDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
505 return DDERR_INVALIDPARAMS;
506 }
507 if (!check_d3ddevicedesc_size(HWDesc->dwSize))
508 {
509 WARN("HWDesc->dwSize is %lu, returning DDERR_INVALIDPARAMS.\n", HWDesc->dwSize);
510 return DDERR_INVALIDPARAMS;
511 }
512 if (!HelDesc)
513 {
514 WARN("HelDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
515 return DDERR_INVALIDPARAMS;
516 }
517 if (!check_d3ddevicedesc_size(HelDesc->dwSize))
518 {
519 WARN("HelDesc->dwSize is %lu, returning DDERR_INVALIDPARAMS.\n", HelDesc->dwSize);
520 return DDERR_INVALIDPARAMS;
521 }
522
523 if (FAILED(hr = ddraw_get_d3dcaps(device->ddraw, &desc7)))
524 return hr;
525
526 ddraw_d3dcaps1_from_7(&desc1, &desc7);
527 DD_STRUCT_COPY_BYSIZE(HWDesc, &desc1);
528 DD_STRUCT_COPY_BYSIZE(HelDesc, &desc1);
529 return D3D_OK;
530}
#define DD_STRUCT_COPY_BYSIZE(to, from)
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1287
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1203
static BOOL check_d3ddevicedesc_size(DWORD size)
Definition: device.c:484
DWORD dwSize
Definition: d3dcaps.h:318

Referenced by d3d_device1_GetCaps(), and d3d_device2_GetCaps().

◆ d3d_device3_GetClipStatus()

static HRESULT WINAPI d3d_device3_GetClipStatus ( IDirect3DDevice3 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3837 of file device.c.

3838{
3840
3841 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3842
3843 return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3844}

◆ d3d_device3_GetCurrentViewport()

static HRESULT WINAPI d3d_device3_GetCurrentViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 **  viewport 
)
static

Definition at line 1798 of file device.c.

1799{
1801
1802 TRACE("iface %p, viewport %p.\n", iface, viewport);
1803
1805 if (!device->current_viewport)
1806 {
1808 WARN("No current viewport, returning D3DERR_NOCURRENTVIEWPORT\n");
1810 }
1811
1812 *viewport = &device->current_viewport->IDirect3DViewport3_iface;
1813 IDirect3DViewport3_AddRef(*viewport);
1814
1815 TRACE("Returning interface %p.\n", *viewport);
1817 return D3D_OK;
1818}
#define D3DERR_NOCURRENTVIEWPORT
Definition: d3d.h:160

Referenced by d3d_device2_GetCurrentViewport().

◆ d3d_device3_GetDirect3D()

static HRESULT WINAPI d3d_device3_GetDirect3D ( IDirect3DDevice3 *  iface,
IDirect3D3 **  d3d 
)
static

Definition at line 1666 of file device.c.

1667{
1669
1670 TRACE("iface %p, d3d %p.\n", iface, d3d);
1671
1672 if (!d3d)
1673 return DDERR_INVALIDPARAMS;
1674
1675 *d3d = &device->ddraw->IDirect3D3_iface;
1676 IDirect3D3_AddRef(*d3d);
1677
1678 TRACE("Returning interface %p.\n", *d3d);
1679 return D3D_OK;
1680}
#define IDirect3D3_AddRef(p)
Definition: d3d.h:329

◆ d3d_device3_GetLightState()

static HRESULT WINAPI d3d_device3_GetLightState ( IDirect3DDevice3 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 3034 of file device.c.

3036{
3038 HRESULT hr;
3039
3040 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3041
3043 {
3044 TRACE("Unexpected Light State Type\n");
3045 return DDERR_INVALIDPARAMS;
3046 }
3047
3048 if (!value)
3049 return DDERR_INVALIDPARAMS;
3050
3053 {
3054 *value = device->material;
3055 }
3056 else if (state == D3DLIGHTSTATE_COLORMODEL)
3057 {
3059 }
3060 else
3061 {
3063 switch (state)
3064 {
3065 case D3DLIGHTSTATE_AMBIENT: /* 2 */
3067 break;
3068 case D3DLIGHTSTATE_FOGMODE: /* 4 */
3070 break;
3071 case D3DLIGHTSTATE_FOGSTART: /* 5 */
3073 break;
3074 case D3DLIGHTSTATE_FOGEND: /* 6 */
3076 break;
3077 case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
3079 break;
3080 case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
3082 break;
3083 default:
3084 FIXME("Unhandled D3DLIGHTSTATETYPE %#x.\n", state);
3086 return DDERR_INVALIDPARAMS;
3087 }
3088
3089 hr = IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, rs, value);
3091 return hr;
3092 }
3094
3095 return D3D_OK;
3096}
#define IDirect3DDevice7_GetRenderState(p, a, b)
Definition: d3d.h:1364
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
D3DRENDERSTATETYPE
Definition: d3dtypes.h:874
@ D3DLIGHTSTATE_MATERIAL
Definition: d3dtypes.h:861
@ D3DLIGHTSTATE_FOGSTART
Definition: d3dtypes.h:865
@ D3DLIGHTSTATE_COLORMODEL
Definition: d3dtypes.h:863
@ D3DLIGHTSTATE_FOGMODE
Definition: d3dtypes.h:864
@ D3DLIGHTSTATE_FOGDENSITY
Definition: d3dtypes.h:867
@ D3DLIGHTSTATE_FOGEND
Definition: d3dtypes.h:866
@ D3DLIGHTSTATE_AMBIENT
Definition: d3dtypes.h:862
@ D3DLIGHTSTATE_COLORVERTEX
Definition: d3dtypes.h:868
#define D3DRENDERSTATE_FOGVERTEXMODE
Definition: dx7todx8.h:49
#define D3DRENDERSTATE_COLORVERTEX
Definition: dx7todx8.h:34
#define D3DRENDERSTATE_FOGSTART
Definition: dx7todx8.h:47
#define D3DRENDERSTATE_FOGDENSITY
Definition: dx7todx8.h:44
#define D3DRENDERSTATE_AMBIENT
Definition: dx7todx8.h:30
#define D3DRENDERSTATE_FOGEND
Definition: dx7todx8.h:46

Referenced by d3d_device2_GetLightState().

◆ d3d_device3_GetRenderState()

static HRESULT WINAPI d3d_device3_GetRenderState ( IDirect3DDevice3 *  iface,
D3DRENDERSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 2473 of file device.c.

2475{
2477
2478 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2479
2480 switch (state)
2481 {
2483 {
2484 /* This state is wrapped to SetTexture in SetRenderState, so
2485 * it has to be wrapped to GetTexture here. */
2486 struct wined3d_texture *tex = NULL;
2487 *value = 0;
2488
2490 if ((tex = device->stateblock_state->textures[0]))
2491 {
2492 /* The parent of the texture is the IDirectDrawSurface7
2493 * interface of the ddraw surface. */
2495 if (parent)
2496 *value = parent->root->Handle;
2497 }
2499
2500 return D3D_OK;
2501 }
2502
2504 {
2505 *value = device->texture_map_blend;
2506 return D3D_OK;
2507 }
2508
2512 *value = 0xffffffff;
2513 return D3D_OK;
2514
2515 default:
2516 return IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, state, value);
2517 }
2518}
@ D3DRENDERSTATE_TEXTUREMAPBLEND
Definition: d3dtypes.h:895
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1690
r parent
Definition: btrfs.c:3010
#define D3DRENDERSTATE_LIGHTING
Definition: dx7todx8.h:51
#define D3DRENDERSTATE_NORMALIZENORMALS
Definition: dx7todx8.h:54
#define D3DRENDERSTATE_LOCALVIEWER
Definition: dx7todx8.h:53

◆ d3d_device3_GetRenderTarget()

static HRESULT WINAPI d3d_device3_GetRenderTarget ( IDirect3DDevice3 *  iface,
IDirectDrawSurface4 **  RenderTarget 
)
static

Definition at line 2075 of file device.c.

2076{
2078 IDirectDrawSurface7 *RenderTarget7;
2079 struct ddraw_surface *RenderTargetImpl;
2080 HRESULT hr;
2081
2082 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2083
2084 if(!RenderTarget)
2085 return DDERR_INVALIDPARAMS;
2086
2087 hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2088 if(hr != D3D_OK) return hr;
2089 RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2090 *RenderTarget = &RenderTargetImpl->IDirectDrawSurface4_iface;
2091 IDirectDrawSurface4_AddRef(*RenderTarget);
2092 IDirectDrawSurface7_Release(RenderTarget7);
2093 return D3D_OK;
2094}
IDirectDrawSurface4 IDirectDrawSurface4_iface

◆ d3d_device3_GetStats()

static HRESULT WINAPI d3d_device3_GetStats ( IDirect3DDevice3 *  iface,
D3DSTATS *  Stats 
)
static

Definition at line 629 of file device.c.

630{
631 FIXME("iface %p, stats %p stub!\n", iface, Stats);
632
633 if(!Stats)
634 return DDERR_INVALIDPARAMS;
635
636 /* Fill the Stats with 0 */
637 Stats->dwTrianglesDrawn = 0;
638 Stats->dwLinesDrawn = 0;
639 Stats->dwPointsDrawn = 0;
640 Stats->dwSpansDrawn = 0;
641 Stats->dwVerticesProcessed = 0;
642
643 return D3D_OK;
644}
DWORD dwTrianglesDrawn
Definition: d3dtypes.h:1249
DWORD dwLinesDrawn
Definition: d3dtypes.h:1250
DWORD dwVerticesProcessed
Definition: d3dtypes.h:1253
DWORD dwPointsDrawn
Definition: d3dtypes.h:1251
DWORD dwSpansDrawn
Definition: d3dtypes.h:1252

Referenced by d3d_device1_GetStats(), and d3d_device2_GetStats().

◆ d3d_device3_GetTexture()

static HRESULT WINAPI d3d_device3_GetTexture ( IDirect3DDevice3 *  iface,
DWORD  stage,
IDirect3DTexture2 **  Texture2 
)
static

Definition at line 4640 of file device.c.

4641{
4643 struct ddraw_surface *ret_val_impl;
4644 HRESULT ret;
4645 IDirectDrawSurface7 *ret_val;
4646
4647 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, Texture2);
4648
4649 ret = IDirect3DDevice7_GetTexture(&device->IDirect3DDevice7_iface, stage, &ret_val);
4650
4651 ret_val_impl = unsafe_impl_from_IDirectDrawSurface7(ret_val);
4652 *Texture2 = ret_val_impl ? &ret_val_impl->IDirect3DTexture2_iface : NULL;
4653
4654 TRACE("Returning texture %p.\n", *Texture2);
4655
4656 return ret;
4657}
#define IDirect3DDevice7_GetTexture(p, a, b)
Definition: d3d.h:1377
return ret
Definition: mutex.c:147

◆ d3d_device3_GetTextureStageState()

static HRESULT WINAPI d3d_device3_GetTextureStageState ( IDirect3DDevice3 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD *  value 
)
static

Definition at line 4930 of file device.c.

4932{
4934
4935 TRACE("iface %p, stage %lu, state %#x, value %p.\n",
4936 iface, stage, state, value);
4937
4938 return IDirect3DDevice7_GetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value);
4939}
#define IDirect3DDevice7_GetTextureStageState(p, a, b, c)
Definition: d3d.h:1379

◆ d3d_device3_GetTransform()

static HRESULT WINAPI d3d_device3_GetTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3255 of file device.c.

3257{
3259
3260 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3261
3262 if (!matrix)
3263 return DDERR_INVALIDPARAMS;
3264
3266 {
3268 memcpy(matrix, &device->legacy_projection, sizeof(*matrix));
3270 return DD_OK;
3271 }
3272
3273 return IDirect3DDevice7_GetTransform(&device->IDirect3DDevice7_iface, state, matrix);
3274}
#define IDirect3DDevice7_GetTransform(p, a, b)
Definition: d3d.h:1355
#define D3DTRANSFORMSTATE_PROJECTION
Definition: dx7todx8.h:12
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DD_OK
Definition: ddraw.h:188

◆ d3d_device3_Index()

static HRESULT WINAPI d3d_device3_Index ( IDirect3DDevice3 *  iface,
WORD  index 
)
static

Definition at line 2299 of file device.c.

2300{
2301 FIXME("iface %p, index %#x stub!\n", iface, index);
2302
2303 return D3D_OK;
2304}

Referenced by d3d_device2_Index().

◆ d3d_device3_MultiplyTransform()

static HRESULT WINAPI d3d_device3_MultiplyTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3338 of file device.c.

3340{
3342
3343 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3344
3346 {
3347 struct wined3d_matrix projection, tmp;
3348
3350 multiply_matrix(&tmp, &device->legacy_projection, (struct wined3d_matrix *)matrix);
3351 multiply_matrix(&projection, &device->legacy_clipspace, &tmp);
3353 device->legacy_projection = tmp;
3355
3356 return D3D_OK;
3357 }
3358
3359 return IDirect3DDevice7_MultiplyTransform(&device->IDirect3DDevice7_iface, state, matrix);
3360}
#define IDirect3DDevice7_MultiplyTransform(p, a, b)
Definition: d3d.h:1357
void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
Definition: utils.c:1153

◆ d3d_device3_NextViewport()

static HRESULT WINAPI d3d_device3_NextViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  Viewport3,
IDirect3DViewport3 **  lplpDirect3DViewport3,
DWORD  flags 
)
static

Definition at line 915 of file device.c.

917{
920 struct d3d_viewport *next;
921 struct list *entry;
922
923 TRACE("iface %p, viewport %p, next %p, flags %#lx.\n",
924 iface, Viewport3, lplpDirect3DViewport3, flags);
925
926 if(!vp)
927 {
928 *lplpDirect3DViewport3 = NULL;
929 return DDERR_INVALIDPARAMS;
930 }
931
932
934 switch (flags)
935 {
936 case D3DNEXT_NEXT:
937 entry = list_next(&This->viewport_list, &vp->entry);
938 break;
939
940 case D3DNEXT_HEAD:
941 entry = list_head(&This->viewport_list);
942 break;
943
944 case D3DNEXT_TAIL:
945 entry = list_tail(&This->viewport_list);
946 break;
947
948 default:
949 WARN("Invalid flags %#lx.\n", flags);
950 *lplpDirect3DViewport3 = NULL;
952 return DDERR_INVALIDPARAMS;
953 }
954
955 if (entry)
956 {
958 *lplpDirect3DViewport3 = &next->IDirect3DViewport3_iface;
959 }
960 else
961 *lplpDirect3DViewport3 = NULL;
962
964
965 return D3D_OK;
966}
Definition: list.h:39
#define D3DNEXT_NEXT
Definition: d3d.h:192
#define D3DNEXT_TAIL
Definition: d3d.h:194
#define D3DNEXT_HEAD
Definition: d3d.h:193
uint32_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:117
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:139
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by d3d_device1_NextViewport(), and d3d_device2_NextViewport().

◆ d3d_device3_QueryInterface()

static HRESULT WINAPI d3d_device3_QueryInterface ( IDirect3DDevice3 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 187 of file device.c.

188{
190
191 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
192
193 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
194}

◆ d3d_device3_Release()

static ULONG WINAPI d3d_device3_Release ( IDirect3DDevice3 *  iface)
static

Definition at line 365 of file device.c.

366{
368
369 TRACE("iface %p.\n", iface);
370
371 return IUnknown_Release(device->outer_unknown);
372}

◆ d3d_device3_SetClipStatus()

static HRESULT WINAPI d3d_device3_SetClipStatus ( IDirect3DDevice3 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3787 of file device.c.

3788{
3790
3791 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3792
3793 return IDirect3DDevice7_SetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3794}

◆ d3d_device3_SetCurrentViewport()

static HRESULT WINAPI d3d_device3_SetCurrentViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 1730 of file device.c.

1731{
1734
1735 TRACE("iface %p, viewport %p, current_viewport %p.\n", iface, viewport, device->current_viewport);
1736
1737 if (!vp)
1738 {
1739 WARN("Direct3DViewport3 is NULL.\n");
1740 return DDERR_INVALIDPARAMS;
1741 }
1742
1744 /* Do nothing if the specified viewport is the same as the current one */
1745 if (device->current_viewport == vp)
1746 {
1748 return D3D_OK;
1749 }
1750
1751 if (vp->active_device != device)
1752 {
1753 WARN("Viewport %p, active device %p.\n", vp, vp->active_device);
1755 return DDERR_INVALIDPARAMS;
1756 }
1757
1758 IDirect3DViewport3_AddRef(viewport);
1759 if (device->current_viewport)
1760 {
1761 viewport_deactivate(device->current_viewport);
1762 IDirect3DViewport3_Release(&device->current_viewport->IDirect3DViewport3_iface);
1763 }
1764 device->current_viewport = vp;
1765 viewport_activate(device->current_viewport, FALSE);
1766
1768
1769 return D3D_OK;
1770}
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights)
Definition: viewport.c:51

Referenced by d3d_device2_SetCurrentViewport().

◆ d3d_device3_SetLightState()

static HRESULT WINAPI d3d_device3_SetLightState ( IDirect3DDevice3 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2918 of file device.c.

2920{
2922 HRESULT hr;
2923
2924 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
2925
2927 {
2928 TRACE("Unexpected Light State Type\n");
2929 return DDERR_INVALIDPARAMS;
2930 }
2931
2934 {
2935 if (value)
2936 {
2937 struct d3d_material *m;
2938
2940 {
2941 WARN("Invalid material handle.\n");
2943 return DDERR_INVALIDPARAMS;
2944 }
2945
2947 }
2948
2949 device->material = value;
2950 }
2951 else if (state == D3DLIGHTSTATE_COLORMODEL)
2952 {
2953 switch (value)
2954 {
2955 case D3DCOLOR_MONO:
2956 ERR("DDCOLOR_MONO should not happen!\n");
2957 break;
2958 case D3DCOLOR_RGB:
2959 /* We are already in this mode */
2960 TRACE("Setting color model to RGB (no-op).\n");
2961 break;
2962 default:
2963 ERR("Unknown color model!\n");
2965 return DDERR_INVALIDPARAMS;
2966 }
2967 }
2968 else
2969 {
2971 switch (state)
2972 {
2973 case D3DLIGHTSTATE_AMBIENT: /* 2 */
2975 break;
2976 case D3DLIGHTSTATE_FOGMODE: /* 4 */
2978 break;
2979 case D3DLIGHTSTATE_FOGSTART: /* 5 */
2981 break;
2982 case D3DLIGHTSTATE_FOGEND: /* 6 */
2984 break;
2985 case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
2987 break;
2988 case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
2990 break;
2991 default:
2992 FIXME("Unhandled D3DLIGHTSTATETYPE %#x.\n", state);
2994 return DDERR_INVALIDPARAMS;
2995 }
2996
2997 hr = IDirect3DDevice7_SetRenderState(&device->IDirect3DDevice7_iface, rs, value);
2999 return hr;
3000 }
3002
3003 return D3D_OK;
3004}
#define IDirect3DDevice7_SetRenderState(p, a, b)
Definition: d3d.h:1363
#define D3DCOLOR_MONO
Definition: d3dtypes.h:626
void material_activate(struct d3d_material *material)
Definition: material.c:444
@ DDRAW_HANDLE_MATERIAL

Referenced by d3d_device2_SetLightState().

◆ d3d_device3_SetRenderState()

static HRESULT WINAPI d3d_device3_SetRenderState ( IDirect3DDevice3 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2724 of file device.c.

2726{
2727 /* Note about D3DRENDERSTATE_TEXTUREMAPBLEND implementation: most of values
2728 for this state can be directly mapped to texture stage colorop and alphaop, but
2729 D3DTBLEND_MODULATE is tricky: it uses alpha from texture when available and alpha
2730 from diffuse otherwise. So changing the texture must be monitored in SetTexture to modify
2731 alphaarg when needed.
2732
2733 Aliens vs Predator 1 depends on accurate D3DTBLEND_MODULATE emulation
2734
2735 Legacy texture blending (TEXTUREMAPBLEND) and texture stage states: directx6 docs state that
2736 TEXTUREMAPBLEND is deprecated, yet can still be used. Games must not use both or results
2737 are undefined. D3DTBLEND_MODULATE mode in particular is dependent on texture pixel format and
2738 requires fixup of stage 0 texture states when texture changes, but this fixup can interfere
2739 with games not using this deprecated state. So a flag 'legacyTextureBlending' has to be kept
2740 in device - TRUE if the app is using TEXTUREMAPBLEND.
2741
2742 Tests show that setting TEXTUREMAPBLEND on native doesn't seem to change values returned by
2743 GetTextureStageState and vice versa. */
2744
2746 HRESULT hr;
2747
2748 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
2749
2751 {
2752 WARN("Unhandled state %#x.\n", state);
2753 return DDERR_INVALIDPARAMS;
2754 }
2755
2757
2758 switch (state)
2759 {
2761 {
2762 struct ddraw_surface *surf;
2763
2764 if (value == 0)
2765 {
2767 hr = D3D_OK;
2768 break;
2769 }
2770
2772 if (!surf)
2773 {
2774 WARN("Invalid texture handle.\n");
2776 break;
2777 }
2778
2780 break;
2781 }
2782
2784 {
2785 if (value == device->texture_map_blend)
2786 {
2787 TRACE("Application is setting the same value over, nothing to do.\n");
2788
2789 hr = D3D_OK;
2790 break;
2791 }
2792
2793 device->legacyTextureBlending = TRUE;
2794 device->texture_map_blend = value;
2795
2796 switch (value)
2797 {
2798 case D3DTBLEND_MODULATE:
2799 {
2801
2812 break;
2813 }
2814
2815 case D3DTBLEND_ADD:
2826 break;
2827
2841 break;
2842
2843 case D3DTBLEND_COPY:
2844 case D3DTBLEND_DECAL:
2853 break;
2854
2866 break;
2867
2868 default:
2869 FIXME("Unhandled texture environment %#lx.\n", value);
2870 }
2871 hr = D3D_OK;
2872 break;
2873 }
2874
2878 hr = D3D_OK;
2879 break;
2880
2881 default:
2882 hr = IDirect3DDevice7_SetRenderState(&device->IDirect3DDevice7_iface, state, value);
2883 break;
2884 }
2886
2887 return hr;
2888}
#define IDirect3DDevice3_SetTexture(p, a, b)
Definition: d3d.h:1229
@ D3DTBLEND_DECALALPHA
Definition: d3dtypes.h:738
@ D3DTBLEND_MODULATE
Definition: d3dtypes.h:737
@ D3DTBLEND_DECAL
Definition: d3dtypes.h:736
@ D3DTBLEND_MODULATEALPHA
Definition: d3dtypes.h:739
@ D3DTBLEND_ADD
Definition: d3dtypes.h:743
@ D3DTBLEND_COPY
Definition: d3dtypes.h:742
#define D3DSTATE_OVERRIDE_BIAS
Definition: d3dtypes.h:834
@ DDRAW_HANDLE_SURFACE
static void fixup_texture_alpha_op(struct d3d_device *device)
Definition: device.c:2697
void CDECL wined3d_stateblock_set_texture(struct wined3d_stateblock *stateblock, UINT stage, struct wined3d_texture *texture)
Definition: stateblock.c:1816
void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, UINT stage, enum wined3d_texture_stage_state state, unsigned int value)
Definition: stateblock.c:1718
@ WINED3D_TSS_COLOR_ARG2
Definition: wined3d.h:596
@ WINED3D_TSS_ALPHA_OP
Definition: wined3d.h:597
@ WINED3D_TSS_COLOR_OP
Definition: wined3d.h:594
@ WINED3D_TSS_ALPHA_ARG2
Definition: wined3d.h:599
@ WINED3D_TSS_COLOR_ARG1
Definition: wined3d.h:595
@ WINED3D_TSS_ALPHA_ARG1
Definition: wined3d.h:598
#define WINED3DTA_CURRENT
Definition: wined3d.h:882
@ WINED3D_TOP_SELECT_ARG1
Definition: wined3d.h:629
@ WINED3D_TOP_ADD
Definition: wined3d.h:634
@ WINED3D_TOP_MODULATE
Definition: wined3d.h:631
@ WINED3D_TOP_SELECT_ARG2
Definition: wined3d.h:630
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
Definition: wined3d.h:640
#define WINED3DTA_TEXTURE
Definition: wined3d.h:883

◆ d3d_device3_SetRenderTarget()

static HRESULT WINAPI d3d_device3_SetRenderTarget ( IDirect3DDevice3 *  iface,
IDirectDrawSurface4 *  target,
DWORD  flags 
)
static

Definition at line 1934 of file device.c.

1936{
1939 HRESULT hr;
1940
1941 TRACE("iface %p, target %p, flags %#lx.\n", iface, target, flags);
1942
1944
1945 if (!validate_surface_palette(target_impl))
1946 {
1947 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1949 return DDERR_INVALIDCAPS;
1950 }
1951
1952 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1953 {
1954 WARN("Surface %p is not a render target.\n", target_impl);
1956 return DDERR_INVALIDCAPS;
1957 }
1958
1959 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1960 {
1961 WARN("Surface %p is a depth buffer.\n", target_impl);
1962 IDirectDrawSurface4_AddRef(target);
1963 IUnknown_Release(device->rt_iface);
1964 device->rt_iface = (IUnknown *)target;
1965 device->target = NULL;
1966 device->target_ds = NULL;
1969 }
1970
1971 if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1972 {
1973 WARN("Surface %p is not in video memory.\n", target_impl);
1974 IDirectDrawSurface4_AddRef(target);
1975 IUnknown_Release(device->rt_iface);
1976 device->rt_iface = (IUnknown *)target;
1977 device->target = NULL;
1978 device->target_ds = NULL;
1980 return D3D_OK;
1981 }
1982
1985 return hr;
1986}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
Definition: surface.c:5966

◆ d3d_device3_SetTexture()

static HRESULT WINAPI d3d_device3_SetTexture ( IDirect3DDevice3 *  iface,
DWORD  stage,
IDirect3DTexture2 *  texture 
)
static

Definition at line 4722 of file device.c.

4724{
4728
4729 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
4730
4732
4733 if (tex && ((tex->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) || !device->hardware_device))
4734 {
4735 if (tex->draw_texture)
4736 {
4738 device->have_draw_textures = TRUE;
4739 }
4740 else
4741 {
4743 }
4744 }
4745
4748
4750
4751 return D3D_OK;
4752}
GLenum GLuint texture
Definition: glext.h:6295
struct wined3d_texture * draw_texture
struct wined3d_texture * wined3d_texture

◆ d3d_device3_SetTextureStageState()

static HRESULT WINAPI d3d_device3_SetTextureStageState ( IDirect3DDevice3 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5069 of file device.c.

5071{
5074 HRESULT hr;
5075
5076 TRACE("iface %p, stage %lu, state %#x, value %#lx.\n",
5077 iface, stage, state, value);
5078
5079 /* Tests show that legacy texture blending is not reset if the texture stage state
5080 * value is unchanged. */
5081 if (FAILED(hr = IDirect3DDevice7_GetTextureStageState(&device->IDirect3DDevice7_iface,
5082 stage, state, &old_value)))
5083 return hr;
5084
5085 if (old_value == value)
5086 {
5087 TRACE("Application is setting the same value over, nothing to do.\n");
5088 return D3D_OK;
5089 }
5090
5091 device->legacyTextureBlending = FALSE;
5092
5093 return IDirect3DDevice7_SetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value);
5094}
#define IDirect3DDevice7_SetTextureStageState(p, a, b, c)
Definition: d3d.h:1380
static ULONG * old_value
Definition: directory.c:54

◆ d3d_device3_SetTransform()

static HRESULT WINAPI d3d_device3_SetTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3166 of file device.c.

3168{
3170
3171 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3172
3173 if (!matrix)
3174 return DDERR_INVALIDPARAMS;
3175
3177 {
3178 struct wined3d_matrix projection;
3179
3181 multiply_matrix(&projection, &device->legacy_clipspace, (struct wined3d_matrix *)matrix);
3183 memcpy(&device->legacy_projection, matrix, sizeof(*matrix));
3185
3186 return D3D_OK;
3187 }
3188
3189 return IDirect3DDevice7_SetTransform(&device->IDirect3DDevice7_iface, state, matrix);
3190}
#define IDirect3DDevice7_SetTransform(p, a, b)
Definition: d3d.h:1354

◆ d3d_device3_ValidateDevice()

static HRESULT WINAPI d3d_device3_ValidateDevice ( IDirect3DDevice3 *  iface,
DWORD *  pass_count 
)
static

Definition at line 5144 of file device.c.

5145{
5147
5148 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
5149
5150 return IDirect3DDevice7_ValidateDevice(&device->IDirect3DDevice7_iface, pass_count);
5151}
#define IDirect3DDevice7_ValidateDevice(p, a)
Definition: d3d.h:1381

◆ d3d_device3_Vertex()

static HRESULT WINAPI d3d_device3_Vertex ( IDirect3DDevice3 *  iface,
void *  vertex 
)
static

Definition at line 2247 of file device.c.

2248{
2250
2251 TRACE("iface %p, vertex %p.\n", iface, vertex);
2252
2253 if (!vertex)
2254 return DDERR_INVALIDPARAMS;
2255
2257 if ((device->nb_vertices + 1) * device->vertex_size > device->buffer_size)
2258 {
2259 BYTE *old_buffer;
2260
2261 device->buffer_size = device->buffer_size ? device->buffer_size * 2 : device->vertex_size * 3;
2262 old_buffer = device->sysmem_vertex_buffer;
2263 device->sysmem_vertex_buffer = malloc(device->buffer_size);
2264 if (old_buffer)
2265 {
2266 memcpy(device->sysmem_vertex_buffer, old_buffer, device->nb_vertices * device->vertex_size);
2267 free(old_buffer);
2268 }
2269 }
2270
2271 memcpy(device->sysmem_vertex_buffer + device->nb_vertices++ * device->vertex_size, vertex, device->vertex_size);
2273
2274 return D3D_OK;
2275}
#define malloc
Definition: debug_ros.c:4
unsigned char BYTE
Definition: xxhash.c:193

Referenced by d3d_device2_Vertex().

◆ d3d_device7_AddRef()

static ULONG WINAPI d3d_device7_AddRef ( IDirect3DDevice7 *  iface)
static

Definition at line 224 of file device.c.

225{
227
228 TRACE("iface %p.\n", iface);
229
230 return IUnknown_AddRef(device->outer_unknown);
231}
static struct d3d_device * impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)

◆ d3d_device7_ApplyStateBlock()

static HRESULT d3d_device7_ApplyStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5697 of file device.c.

5698{
5700 struct wined3d_stateblock *wined3d_sb;
5701
5702 TRACE("iface %p, stateblock %#lx.\n", iface, stateblock);
5703
5705 if (device->recording)
5706 {
5708 WARN("Trying to apply a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n");
5710 }
5711 wined3d_sb = ddraw_get_object(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5712 if (!wined3d_sb)
5713 {
5714 WARN("Invalid stateblock handle.\n");
5717 }
5718
5719 wined3d_stateblock_apply(wined3d_sb, device->state);
5721
5722 return D3D_OK;
5723}
#define D3DERR_INBEGINSTATEBLOCK
Definition: d3d.h:186
#define D3DERR_INVALIDSTATEBLOCK
Definition: d3d.h:185
@ DDRAW_HANDLE_STATEBLOCK
void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, struct wined3d_stateblock *device_state)
Definition: stateblock.c:1156

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), and d3d_device7_ApplyStateBlock_FPUSetup().

◆ d3d_device7_ApplyStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5730 of file device.c.

5731{
5732 HRESULT hr;
5733 WORD old_fpucw;
5734
5735 old_fpucw = d3d_fpu_setup();
5736 hr = d3d_device7_ApplyStateBlock(iface, stateblock);
5737 set_fpu_control_word(old_fpucw);
5738
5739 return hr;
5740}
static WORD d3d_fpu_setup(void)
Definition: device.c:52
static void set_fpu_control_word(WORD fpucw)
Definition: device.c:43
static HRESULT d3d_device7_ApplyStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5697
unsigned short WORD
Definition: ntddk_ex.h:93

◆ d3d_device7_ApplyStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5725 of file device.c.

5726{
5727 return d3d_device7_ApplyStateBlock(iface, stateblock);
5728}

◆ d3d_device7_BeginScene()

static HRESULT d3d_device7_BeginScene ( IDirect3DDevice7 *  iface)
static

Definition at line 1504 of file device.c.

1505{
1507 HRESULT hr;
1508
1509 TRACE("iface %p.\n", iface);
1510
1512 hr = wined3d_device_begin_scene(device->wined3d_device);
1514
1515 if(hr == WINED3D_OK) return D3D_OK;
1516 else return D3DERR_SCENE_IN_SCENE; /* TODO: Other possible causes of failure */
1517}
#define D3DERR_SCENE_IN_SCENE
Definition: d3d.h:151
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3700
#define WINED3D_OK
Definition: wined3d.h:33

Referenced by d3d_device7_BeginScene_FPUPreserve(), and d3d_device7_BeginScene_FPUSetup().

◆ d3d_device7_BeginScene_FPUPreserve()

static HRESULT WINAPI d3d_device7_BeginScene_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 1524 of file device.c.

1525{
1526 HRESULT hr;
1527 WORD old_fpucw;
1528
1529 old_fpucw = d3d_fpu_setup();
1530 hr = d3d_device7_BeginScene(iface);
1531 set_fpu_control_word(old_fpucw);
1532
1533 return hr;
1534}
static HRESULT d3d_device7_BeginScene(IDirect3DDevice7 *iface)
Definition: device.c:1504

◆ d3d_device7_BeginScene_FPUSetup()

static HRESULT WINAPI d3d_device7_BeginScene_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 1519 of file device.c.

1520{
1521 return d3d_device7_BeginScene(iface);
1522}

◆ d3d_device7_BeginStateBlock()

static HRESULT d3d_device7_BeginStateBlock ( IDirect3DDevice7 *  iface)
static

Definition at line 5523 of file device.c.

5524{
5526 struct wined3d_stateblock *stateblock;
5527 HRESULT hr;
5528
5529 TRACE("iface %p.\n", iface);
5530
5532 if (device->recording)
5533 {
5535 WARN("Trying to begin a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n");
5537 }
5538 if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_RECORDED, &stateblock)))
5539 device->update_state = device->recording = stateblock;
5541
5542 return hr_ddraw_from_wined3d(hr);
5543}
HRESULT hr_ddraw_from_wined3d(HRESULT hr)
Definition: utils.c:1183
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, const struct wined3d_stateblock *device_state, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
Definition: stateblock.c:2508
@ WINED3D_SBT_RECORDED
Definition: wined3d.h:790

Referenced by d3d_device7_BeginStateBlock_FPUPreserve(), and d3d_device7_BeginStateBlock_FPUSetup().

◆ d3d_device7_BeginStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 5550 of file device.c.

5551{
5552 HRESULT hr;
5553 WORD old_fpucw;
5554
5555 old_fpucw = d3d_fpu_setup();
5557 set_fpu_control_word(old_fpucw);
5558
5559 return hr;
5560}
static HRESULT d3d_device7_BeginStateBlock(IDirect3DDevice7 *iface)
Definition: device.c:5523

◆ d3d_device7_BeginStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 5545 of file device.c.

5546{
5547 return d3d_device7_BeginStateBlock(iface);
5548}

◆ d3d_device7_CaptureStateBlock()

static HRESULT d3d_device7_CaptureStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5757 of file device.c.

5758{
5760 struct wined3d_stateblock *wined3d_sb;
5761
5762 TRACE("iface %p, stateblock %#lx.\n", iface, stateblock);
5763
5765 if (device->recording)
5766 {
5768 WARN("Trying to capture a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n");
5770 }
5771 wined3d_sb = ddraw_get_object(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5772 if (!wined3d_sb)
5773 {
5774 WARN("Invalid stateblock handle.\n");
5777 }
5778
5779 wined3d_stateblock_capture(wined3d_sb, device->state);
5781
5782 return D3D_OK;
5783}
void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock, const struct wined3d_stateblock *device_state)
Definition: stateblock.c:893

Referenced by d3d_device7_CaptureStateBlock_FPUPreserve(), and d3d_device7_CaptureStateBlock_FPUSetup().

◆ d3d_device7_CaptureStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5790 of file device.c.

5791{
5792 HRESULT hr;
5793 WORD old_fpucw;
5794
5795 old_fpucw = d3d_fpu_setup();
5796 hr = d3d_device7_CaptureStateBlock(iface, stateblock);
5797 set_fpu_control_word(old_fpucw);
5798
5799 return hr;
5800}
static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5757

◆ d3d_device7_CaptureStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5785 of file device.c.

5786{
5787 return d3d_device7_CaptureStateBlock(iface, stateblock);
5788}

◆ d3d_device7_Clear()

static HRESULT d3d_device7_Clear ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT *  rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5173 of file device.c.

5175{
5176 const struct wined3d_color c =
5177 {
5178 ((color >> 16) & 0xff) / 255.0f,
5179 ((color >> 8) & 0xff) / 255.0f,
5180 (color & 0xff) / 255.0f,
5181 ((color >> 24) & 0xff) / 255.0f,
5182 };
5184 HRESULT hr;
5185
5186 TRACE("iface %p, count %lu, rects %p, flags %#lx, color 0x%08lx, z %.8e, stencil %#lx.\n",
5187 iface, count, rects, flags, color, z, stencil);
5188
5189 if (count && !rects)
5190 {
5191 WARN("count %lu with NULL rects.\n", count);
5192 count = 0;
5193 }
5194
5197 hr = wined3d_device_clear(device->wined3d_device, count, (RECT *)rects, flags, &c, z, stencil);
5199
5200 return hr;
5201}
void d3d_device_apply_state(struct d3d_device *device, BOOL clear_state)
Definition: device.c:3454
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, unsigned int rect_count, const RECT *rects, uint32_t flags, const struct wined3d_color *color, float depth, unsigned int stencil)
Definition: device.c:3729
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLdouble GLdouble z
Definition: glext.h:5874

Referenced by d3d_device7_Clear_FPUPreserve(), and d3d_device7_Clear_FPUSetup().

◆ d3d_device7_Clear_FPUPreserve()

static HRESULT WINAPI d3d_device7_Clear_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT *  rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5209 of file device.c.

5211{
5212 HRESULT hr;
5213 WORD old_fpucw;
5214
5215 old_fpucw = d3d_fpu_setup();
5216 hr = d3d_device7_Clear(iface, count, rects, flags, color, z, stencil);
5217 set_fpu_control_word(old_fpucw);
5218
5219 return hr;
5220}
static HRESULT d3d_device7_Clear(IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
Definition: device.c:5173

◆ d3d_device7_Clear_FPUSetup()

static HRESULT WINAPI d3d_device7_Clear_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT *  rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5203 of file device.c.

5205{
5206 return d3d_device7_Clear(iface, count, rects, flags, color, z, stencil);
5207}

◆ d3d_device7_ComputeSphereVisibility()

static HRESULT WINAPI d3d_device7_ComputeSphereVisibility ( IDirect3DDevice7 *  iface,
D3DVECTOR *  centers,
D3DVALUE *  radii,
DWORD  sphere_count,
DWORD  flags,
DWORD *  return_values 
)
static

Definition at line 4503 of file device.c.

4505{
4506 struct wined3d_vec4 plane[12];
4507 DWORD enabled_planes = 0x3f;
4508 DWORD user_clip_planes;
4509 UINT j;
4510
4511 TRACE("iface %p, centers %p, radii %p, sphere_count %lu, flags %#lx, return_values %p.\n",
4512 iface, centers, radii, sphere_count, flags, return_values);
4513
4515
4517 enabled_planes |= user_clip_planes << 6;
4518 for (j = 6; j < 12; ++j)
4520
4521 compute_sphere_visibility(plane, enabled_planes, FALSE, centers, radii, sphere_count, return_values);
4522 return D3D_OK;
4523}
#define IDirect3DDevice7_GetClipPlane(p, a, b)
Definition: d3d.h:1390
float D3DVALUE
Definition: d3dtypes.h:89
#define D3DRENDERSTATE_CLIPPLANEENABLE
Definition: dx7todx8.h:33

◆ d3d_device7_CreateStateBlock()

static HRESULT d3d_device7_CreateStateBlock ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD *  stateblock 
)
static

Definition at line 5878 of file device.c.

5880{
5882 struct wined3d_stateblock *wined3d_sb;
5883 HRESULT hr;
5884 DWORD h;
5885
5886 TRACE("iface %p, type %#x, stateblock %p.\n", iface, type, stateblock);
5887
5888 if (!stateblock)
5889 return DDERR_INVALIDPARAMS;
5890
5891 if (type != D3DSBT_ALL
5894 {
5895 WARN("Unexpected stateblock type, returning DDERR_INVALIDPARAMS\n");
5896 return DDERR_INVALIDPARAMS;
5897 }
5898
5900
5901 if (device->recording)
5902 {
5904 WARN("Trying to apply a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n");
5906 }
5907
5908 if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device,
5909 device->state, wined3d_stateblock_type_from_ddraw(type), &wined3d_sb)))
5910 {
5911 WARN("Failed to create stateblock, hr %#lx.\n", hr);
5913 return hr_ddraw_from_wined3d(hr);
5914 }
5915
5916 h = ddraw_allocate_handle(&device->handle_table, wined3d_sb, DDRAW_HANDLE_STATEBLOCK);
5917 if (h == DDRAW_INVALID_HANDLE)
5918 {
5919 ERR("Failed to allocate stateblock handle.\n");
5920 wined3d_stateblock_decref(wined3d_sb);
5922 return DDERR_OUTOFMEMORY;
5923 }
5924
5925 *stateblock = h + 1;
5927
5928 return hr_ddraw_from_wined3d(hr);
5929}
@ D3DSBT_PIXELSTATE
Definition: d3d8types.h:831
@ D3DSBT_ALL
Definition: d3d8types.h:830
@ D3DSBT_VERTEXSTATE
Definition: d3d8types.h:832
static enum wined3d_stateblock_type wined3d_stateblock_type_from_ddraw(D3DSTATEBLOCKTYPE type)
Definition: device.c:110
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:670

Referenced by d3d_device7_CreateStateBlock_FPUPreserve(), and d3d_device7_CreateStateBlock_FPUSetup().

◆ d3d_device7_CreateStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD *  stateblock 
)
static

Definition at line 5937 of file device.c.

5939{
5940 HRESULT hr;
5941 WORD old_fpucw;
5942
5943 old_fpucw = d3d_fpu_setup();
5944 hr = d3d_device7_CreateStateBlock(iface, type, stateblock);
5945 set_fpu_control_word(old_fpucw);
5946
5947 return hr;
5948}
static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
Definition: device.c:5878

◆ d3d_device7_CreateStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD *  stateblock 
)
static

Definition at line 5931 of file device.c.

5933{
5934 return d3d_device7_CreateStateBlock(iface, type, stateblock);
5935}

◆ d3d_device7_DeleteStateBlock()

static HRESULT d3d_device7_DeleteStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5817 of file device.c.

5818{
5820 struct wined3d_stateblock *wined3d_sb;
5821 ULONG ref;
5822
5823 TRACE("iface %p, stateblock %#lx.\n", iface, stateblock);
5824
5826
5827 wined3d_sb = ddraw_free_handle(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5828 if (!wined3d_sb)
5829 {
5830 WARN("Invalid stateblock handle.\n");
5833 }
5834
5835 if ((ref = wined3d_stateblock_decref(wined3d_sb)))
5836 {
5837 ERR("Something is still holding stateblock %p (refcount %lu).\n", wined3d_sb, ref);
5838 }
5839
5841
5842 return D3D_OK;
5843}
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by d3d_device7_DeleteStateBlock_FPUPreserve(), and d3d_device7_DeleteStateBlock_FPUSetup().

◆ d3d_device7_DeleteStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5850 of file device.c.

5851{
5852 HRESULT hr;
5853 WORD old_fpucw;
5854
5855 old_fpucw = d3d_fpu_setup();
5856 hr = d3d_device7_DeleteStateBlock(iface, stateblock);
5857 set_fpu_control_word(old_fpucw);
5858
5859 return hr;
5860}
static HRESULT d3d_device7_DeleteStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5817

◆ d3d_device7_DeleteStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5845 of file device.c.

5846{
5847 return d3d_device7_DeleteStateBlock(iface, stateblock);
5848}

◆ d3d_device7_DrawIndexedPrimitive()

static HRESULT d3d_device7_DrawIndexedPrimitive ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3605 of file device.c.

3608{
3610 unsigned int idx_size = index_count * sizeof(*indices);
3611 unsigned short min_index = USHRT_MAX, max_index = 0;
3612 unsigned int i;
3613 HRESULT hr;
3615 UINT vb_pos, ib_pos;
3616
3617 TRACE("iface %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, "
3618 "indices %p, index_count %lu, flags %#lx.\n",
3619 iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3620
3621 if (!vertex_count || !index_count)
3622 {
3623 WARN("0 vertex or index count.\n");
3624 return D3D_OK;
3625 }
3626
3627 /* Prince of Persia 3D creates large vertex buffers but only actually uses
3628 * a few vertices from them. This improves performance dramatically. */
3629 for (i = 0; i < index_count; ++i)
3630 {
3631 min_index = min(min_index, indices[i]);
3632 max_index = max(max_index, indices[i]);
3633 }
3634
3635 /* Set the D3DDevice's FVF */
3637
3638 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device, &device->vertex_buffer,
3639 (char *)vertices + (min_index * stride), (max_index + 1 - min_index) * stride, stride, &vb_pos)))
3640 goto done;
3641
3642 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device,
3643 &device->index_buffer, indices, idx_size, sizeof(*indices), &ib_pos)))
3644 goto done;
3645
3646 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, stride);
3647 if (FAILED(hr))
3648 goto done;
3650
3655 wined3d_device_context_draw_indexed(device->immediate_context, (int)(vb_pos / stride) - min_index,
3656 ib_pos / sizeof(*indices), index_count, 0, 0);
3657
3658done:
3660 return hr;
3661}
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *This, DWORD fvf)
Definition: ddraw.c:4917
static enum wined3d_primitive_type wined3d_primitive_type_from_ddraw(D3DPRIMITIVETYPE type)
Definition: device.c:105
HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, struct wined3d_streaming_buffer *buffer, const void *data, unsigned int size, unsigned int stride, unsigned int *ret_pos)
Definition: buffer.c:1422
void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3779
void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *context, int base_vertex_index, unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count)
Definition: device.c:2649
#define USHRT_MAX
Definition: limits.h:23
#define min(a, b)
Definition: monoChain.cc:55
#define max(a, b)
Definition: svc.c:63
void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, struct wined3d_vertex_declaration *declaration)
Definition: stateblock.c:1571
void CDECL wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stateblock, struct wined3d_buffer *buffer, enum wined3d_format_id format_id)
Definition: stateblock.c:1918
HRESULT CDECL wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: stateblock.c:1939
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:214

Referenced by d3d_device7_DrawIndexedPrimitive_FPUPreserve(), d3d_device7_DrawIndexedPrimitive_FPUSetup(), and d3d_device7_DrawIndexedPrimitiveVB().

◆ d3d_device7_DrawIndexedPrimitive_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3671 of file device.c.

3674{
3675 HRESULT hr;
3676 WORD old_fpucw;
3677
3678 old_fpucw = d3d_fpu_setup();
3679 hr = d3d_device7_DrawIndexedPrimitive(iface, primitive_type, fvf,
3680 vertices, vertex_count, indices, index_count, flags);
3681 set_fpu_control_word(old_fpucw);
3682
3683 return hr;
3684}
static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:3605

◆ d3d_device7_DrawIndexedPrimitive_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3663 of file device.c.

3666{
3667 return d3d_device7_DrawIndexedPrimitive(iface, primitive_type, fvf,
3668 vertices, vertex_count, indices, index_count, flags);
3669}

◆ d3d_device7_DrawIndexedPrimitiveStrided()

static HRESULT d3d_device7_DrawIndexedPrimitiveStrided ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
D3DDRAWPRIMITIVESTRIDEDDATA *  strided_data,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 4027 of file device.c.

4030{
4032 UINT vtx_dst_stride = get_flexible_vertex_size(fvf);
4033 UINT vtx_dst_size = vertex_count * vtx_dst_stride;
4034 UINT idx_size = index_count * sizeof(WORD);
4035 void *dst_data;
4036 UINT vb_pos;
4037 UINT ib_pos;
4038 HRESULT hr;
4039
4040 TRACE("iface %p, primitive_type %#x, fvf %#lx, strided_data %p, "
4041 "vertex_count %lu, indices %p, index_count %lu, flags %#lx.\n",
4042 iface, primitive_type, fvf, strided_data, vertex_count, indices, index_count, flags);
4043
4044 if (!vertex_count || !index_count)
4045 {
4046 WARN("0 vertex or index count.\n");
4047 return D3D_OK;
4048 }
4049
4051
4052 if (FAILED(hr = wined3d_streaming_buffer_map(device->wined3d_device,
4053 &device->vertex_buffer, vtx_dst_size, vtx_dst_stride, &vb_pos, &dst_data)))
4054 goto done;
4055 pack_strided_data(dst_data, vertex_count, strided_data, fvf);
4056 wined3d_streaming_buffer_unmap(&device->vertex_buffer);
4057
4058 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device,
4059 &device->index_buffer, indices, idx_size, sizeof(WORD), &ib_pos)))
4060 goto done;
4061
4062 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, vtx_dst_stride);
4063 if (FAILED(hr))
4064 goto done;
4066
4072 vb_pos / vtx_dst_stride, ib_pos / sizeof(WORD), index_count, 0, 0);
4073
4074done:
4076 return hr;
4077}
static void pack_strided_data(BYTE *dst, DWORD count, const D3DDRAWPRIMITIVESTRIDEDDATA *src, DWORD fvf)
Definition: device.c:3875
void CDECL wined3d_streaming_buffer_unmap(struct wined3d_streaming_buffer *buffer)
Definition: buffer.c:1417
HRESULT CDECL wined3d_streaming_buffer_map(struct wined3d_device *device, struct wined3d_streaming_buffer *buffer, unsigned int size, unsigned int stride, unsigned int *ret_pos, void **ret_data)
Definition: buffer.c:1375

Referenced by d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), and d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup().

◆ d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD *  Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4088 of file device.c.

4092{
4093 HRESULT hr;
4094 WORD old_fpucw;
4095
4096 old_fpucw = d3d_fpu_setup();
4097 hr = d3d_device7_DrawIndexedPrimitiveStrided(iface, PrimitiveType, VertexType,
4098 D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4099 set_fpu_control_word(old_fpucw);
4100
4101 return hr;
4102}
static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:4027

◆ d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD *  Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4079 of file device.c.

4083{
4084 return d3d_device7_DrawIndexedPrimitiveStrided(iface, PrimitiveType, VertexType,
4085 D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4086}

◆ d3d_device7_DrawIndexedPrimitiveVB()

static HRESULT d3d_device7_DrawIndexedPrimitiveVB ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
IDirect3DVertexBuffer7 *  vb,
DWORD  start_vertex,
DWORD  vertex_count,
WORD *  indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 4255 of file device.c.

4258{
4264 struct wined3d_box wined3d_box = {0};
4265 HRESULT hr;
4266 UINT ib_pos;
4267
4268 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %lu, "
4269 "vertex_count %lu, indices %p, index_count %lu, flags %#lx.\n",
4270 iface, primitive_type, vb, start_vertex, vertex_count, indices, index_count, flags);
4271
4272 if (!vertex_count || !index_count)
4273 {
4274 WARN("0 vertex or index count.\n");
4275 return D3D_OK;
4276 }
4277
4278 vb_impl->discarded = false;
4279
4280 if (vb_impl->sysmem)
4281 {
4282 TRACE("Drawing from D3DVBCAPS_SYSTEMMEMORY vertex buffer, forwarding to DrawIndexedPrimitive().\n");
4284 wined3d_box.left = start_vertex * stride;
4289 {
4292 }
4293 hr = d3d_device7_DrawIndexedPrimitive(iface, primitive_type, vb_impl->fvf,
4297 return hr;
4298 }
4299
4300 /* Steps:
4301 * 1) Upload the indices to the index buffer
4302 * 2) Set the index source
4303 * 3) Set the Vertex Buffer as the Stream source
4304 * 4) Call wined3d_device_context_draw_indexed()
4305 */
4306
4308
4310
4311 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device,
4312 &device->index_buffer, indices, index_count * sizeof(WORD), sizeof(WORD), &ib_pos)))
4313 {
4315 return hr;
4316 }
4317
4318 /* Set the index stream */
4320
4321 /* Set the vertex stream source */
4323 0, vb_impl->wined3d_buffer, 0, stride)))
4324 {
4325 ERR("Failed to set stream source for device %p, hr %#lx.\n", device, hr);
4327 return hr;
4328 }
4329
4331 wined3d_primitive_type_from_ddraw(primitive_type), 0);
4333 wined3d_device_context_draw_indexed(device->immediate_context, start_vertex,
4334 ib_pos / sizeof(WORD), index_count, 0, 0);
4335
4337
4338 return hr;
4339}
#define D3DERR_VERTEXBUFFERLOCKED
Definition: d3d.h:165
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:520
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:304
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags)
Definition: resource.c:295
struct wined3d_vertex_declaration * wined3d_declaration
struct wined3d_buffer * wined3d_buffer
UINT left
Definition: wined3d.h:1873
UINT right
Definition: wined3d.h:1875
#define WINED3D_MAP_READ
Definition: wined3d.h:957

Referenced by d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), and d3d_device7_DrawIndexedPrimitiveVB_FPUSetup().

◆ d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
WORD *  Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4349 of file device.c.

4352{
4353 HRESULT hr;
4354 WORD old_fpucw;
4355
4356 old_fpucw = d3d_fpu_setup();
4357 hr = d3d_device7_DrawIndexedPrimitiveVB(iface, PrimitiveType,
4358 D3DVertexBuf, StartVertex, NumVertices, Indices, IndexCount, Flags);
4359 set_fpu_control_word(old_fpucw);
4360
4361 return hr;
4362}
static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:4255

◆ d3d_device7_DrawIndexedPrimitiveVB_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
WORD *  Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4341 of file device.c.

4344{
4345 return d3d_device7_DrawIndexedPrimitiveVB(iface, PrimitiveType,
4346 D3DVertexBuf, StartVertex, NumVertices, Indices, IndexCount, Flags);
4347}

◆ d3d_device7_DrawPrimitive()

static HRESULT d3d_device7_DrawPrimitive ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3468 of file device.c.

3471{
3473 UINT stride, vb_pos, size;
3474 HRESULT hr;
3475
3476 TRACE("iface %p, primitive_type %#x, fvf %#lx, vertices %p, vertex_count %lu, flags %#lx.\n",
3477 iface, primitive_type, fvf, vertices, vertex_count, flags);
3478
3479 if (!vertex_count)
3480 {
3481 WARN("0 vertex count.\n");
3482 return D3D_OK;
3483 }
3484
3485 /* Get the stride */
3488
3490
3491 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device,
3492 &device->vertex_buffer, vertices, size, stride, &vb_pos)))
3493 goto done;
3494
3495 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, stride);
3496 if (FAILED(hr))
3497 goto done;
3498
3503 wined3d_device_context_draw(device->immediate_context, vb_pos / stride, vertex_count, 0, 0);
3504
3505done:
3507 return hr;
3508}
void CDECL wined3d_device_context_draw(struct wined3d_device_context *context, unsigned int start_vertex, unsigned int vertex_count, unsigned int start_instance, unsigned int instance_count)
Definition: device.c:2635

Referenced by d3d_device7_DrawPrimitive_FPUPreserve(), d3d_device7_DrawPrimitive_FPUSetup(), and d3d_device7_DrawPrimitiveVB().

◆ d3d_device7_DrawPrimitive_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3517 of file device.c.

3520{
3521 HRESULT hr;
3522 WORD old_fpucw;
3523
3524 old_fpucw = d3d_fpu_setup();
3525 hr = d3d_device7_DrawPrimitive(iface, primitive_type, fvf, vertices, vertex_count, flags);
3526 set_fpu_control_word(old_fpucw);
3527
3528 return hr;
3529}
static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3468

◆ d3d_device7_DrawPrimitive_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void *  vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3510 of file device.c.

3513{
3514 return d3d_device7_DrawPrimitive(iface, primitive_type, fvf, vertices, vertex_count, flags);
3515}

◆ d3d_device7_DrawPrimitiveStrided()

static HRESULT d3d_device7_DrawPrimitiveStrided ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
D3DDRAWPRIMITIVESTRIDEDDATA *  strided_data,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3931 of file device.c.

3933{
3935 HRESULT hr;
3936 UINT dst_stride = get_flexible_vertex_size(fvf);
3937 UINT dst_size = dst_stride * vertex_count;
3938 void *dst_data;
3939 UINT vb_pos;
3940
3941 TRACE("iface %p, primitive_type %#x, fvf %#lx, strided_data %p, vertex_count %lu, flags %#lx.\n",
3942 iface, primitive_type, fvf, strided_data, vertex_count, flags);
3943
3944 if (!vertex_count)
3945 {
3946 WARN("0 vertex count.\n");
3947 return D3D_OK;
3948 }
3949
3951
3952 if (FAILED(hr = wined3d_streaming_buffer_map(device->wined3d_device,
3953 &device->vertex_buffer, dst_size, dst_stride, &vb_pos, &dst_data)))
3954 goto done;
3955 pack_strided_data(dst_data, vertex_count, strided_data, fvf);
3956 wined3d_streaming_buffer_unmap(&device->vertex_buffer);
3957
3958 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, dst_stride);
3959 if (FAILED(hr))
3960 goto done;
3962
3966 wined3d_device_context_draw(device->immediate_context, vb_pos / dst_stride, vertex_count, 0, 0);
3967
3968done:
3970 return hr;
3971}

Referenced by d3d_device7_DrawPrimitiveStrided_FPUPreserve(), and d3d_device7_DrawPrimitiveStrided_FPUSetup().

◆ d3d_device7_DrawPrimitiveStrided_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 3981 of file device.c.

3984{
3985 HRESULT hr;
3986 WORD old_fpucw;
3987
3988 old_fpucw = d3d_fpu_setup();
3989 hr = d3d_device7_DrawPrimitiveStrided(iface, PrimitiveType,
3990 VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
3991 set_fpu_control_word(old_fpucw);
3992
3993 return hr;
3994}
static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, DWORD flags)
Definition: device.c:3931

◆ d3d_device7_DrawPrimitiveStrided_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA *  D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 3973 of file device.c.

3976{
3977 return d3d_device7_DrawPrimitiveStrided(iface, PrimitiveType,
3978 VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
3979}

◆ d3d_device7_DrawPrimitiveVB()

static HRESULT d3d_device7_DrawPrimitiveVB ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
IDirect3DVertexBuffer7 *  vb,
DWORD  start_vertex,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 4139 of file device.c.

4141{
4146 struct wined3d_box wined3d_box = {0};
4147 DWORD stride;
4148 HRESULT hr;
4149
4150 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %lu, vertex_count %lu, flags %#lx.\n",
4151 iface, primitive_type, vb, start_vertex, vertex_count, flags);
4152
4153 if (!vertex_count)
4154 {
4155 WARN("0 vertex count.\n");
4156 return D3D_OK;
4157 }
4158
4159 vb_impl->discarded = false;
4160
4162
4163 if (vb_impl->sysmem)
4164 {
4165 TRACE("Drawing from D3DVBCAPS_SYSTEMMEMORY vertex buffer, forwarding to DrawPrimitive().\n");
4168 wined3d_box.left = start_vertex * stride;
4172 {
4175 }
4176 hr = d3d_device7_DrawPrimitive(iface, primitive_type, vb_impl->fvf, wined3d_map_desc.data,
4180 return hr;
4181 }
4182
4186 0, vb_impl->wined3d_buffer, 0, stride)))
4187 {
4188 WARN("Failed to set stream source, hr %#lx.\n", hr);
4190 return hr;
4191 }
4192
4193 /* Now draw the primitives */
4195 wined3d_primitive_type_from_ddraw(primitive_type), 0);
4197 wined3d_device_context_draw(device->immediate_context, start_vertex, vertex_count, 0, 0);
4198
4200
4201 return hr;
4202}

Referenced by d3d_device7_DrawPrimitiveVB_FPUPreserve(), and d3d_device7_DrawPrimitiveVB_FPUSetup().

◆ d3d_device7_DrawPrimitiveVB_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4210 of file device.c.

4212{
4213 HRESULT hr;
4214 WORD old_fpucw;
4215
4216 old_fpucw = d3d_fpu_setup();
4217 hr = d3d_device7_DrawPrimitiveVB(iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4218 set_fpu_control_word(old_fpucw);
4219
4220 return hr;
4221}
static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, DWORD flags)
Definition: device.c:4139

◆ d3d_device7_DrawPrimitiveVB_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4204 of file device.c.

4206{
4207 return d3d_device7_DrawPrimitiveVB(iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4208}

◆ d3d_device7_EndScene()

static HRESULT d3d_device7_EndScene ( IDirect3DDevice7 *  iface)
static

Definition at line 1577 of file device.c.

1578{
1580 HRESULT hr;
1581
1582 TRACE("iface %p.\n", iface);
1583
1585 hr = wined3d_device_end_scene(device->wined3d_device);
1587
1588 if(hr == WINED3D_OK) return D3D_OK;
1589 else return D3DERR_SCENE_NOT_IN_SCENE;
1590}
#define D3DERR_SCENE_NOT_IN_SCENE
Definition: d3d.h:152
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3715

Referenced by d3d_device7_EndScene_FPUPreserve(), and d3d_device7_EndScene_FPUSetup().

◆ d3d_device7_EndScene_FPUPreserve()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 1597 of file device.c.

1598{
1599 HRESULT hr;
1600 WORD old_fpucw;
1601
1602 old_fpucw = d3d_fpu_setup();
1603 hr = d3d_device7_EndScene(iface);
1604 set_fpu_control_word(old_fpucw);
1605
1606 return hr;
1607}
static HRESULT d3d_device7_EndScene(IDirect3DDevice7 *iface)
Definition: device.c:1577

◆ d3d_device7_EndScene_FPUSetup()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 1592 of file device.c.

1593{
1594 return d3d_device7_EndScene(iface);
1595}

◆ d3d_device7_EndStateBlock()

static HRESULT d3d_device7_EndStateBlock ( IDirect3DDevice7 *  iface,
DWORD *  stateblock 
)
static

Definition at line 5578 of file device.c.

5579{
5581 struct wined3d_stateblock *wined3d_sb;
5582 DWORD h;
5583
5584 TRACE("iface %p, stateblock %p.\n", iface, stateblock);
5585
5586 if (!stateblock)
5587 return DDERR_INVALIDPARAMS;
5588
5590 if (!device->recording)
5591 {
5593 WARN("Trying to end a stateblock, but no stateblock is being recorded.\n");
5595 }
5596 wined3d_sb = device->recording;
5598 device->recording = NULL;
5599 device->update_state = device->state;
5600
5601 h = ddraw_allocate_handle(&device->handle_table, wined3d_sb, DDRAW_HANDLE_STATEBLOCK);
5602 if (h == DDRAW_INVALID_HANDLE)
5603 {
5604 ERR("Failed to allocate a stateblock handle.\n");
5605 wined3d_stateblock_decref(wined3d_sb);
5607 *stateblock = 0;
5608 return DDERR_OUTOFMEMORY;
5609 }
5610
5612 *stateblock = h + 1;
5613
5614 return D3D_OK;
5615}
#define D3DERR_NOTINBEGINSTATEBLOCK
Definition: d3d.h:187
void CDECL wined3d_stateblock_init_contained_states(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:393

Referenced by d3d_device7_EndStateBlock_FPUPreserve(), and d3d_device7_EndStateBlock_FPUSetup().

◆ d3d_device7_EndStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_EndStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD *  stateblock 
)
static

Definition at line 5622 of file device.c.

5623{
5624 HRESULT hr;
5625 WORD old_fpucw;
5626
5627 old_fpucw = d3d_fpu_setup();
5628 hr = d3d_device7_EndStateBlock(iface, stateblock);
5629 set_fpu_control_word(old_fpucw);
5630
5631 return hr;
5632}
static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *stateblock)
Definition: device.c:5578

◆ d3d_device7_EndStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_EndStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD *  stateblock 
)
static

Definition at line 5617 of file device.c.

5618{
5619 return d3d_device7_EndStateBlock(iface, stateblock);
5620}

◆ d3d_device7_EnumTextureFormats()

static HRESULT d3d_device7_EnumTextureFormats ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1074 of file device.c.

1076{
1079 HRESULT hr;
1080 unsigned int i;
1081
1082 static const enum wined3d_format_id FormatList[] =
1083 {
1084 /* 16 bit */
1089 /* 32 bit */
1092 /* 8 bit */
1095 /* FOURCC codes */
1101 };
1102
1103 static const enum wined3d_format_id BumpFormatList[] =
1104 {
1110 };
1111
1112 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1113
1114 if (!callback)
1115 return DDERR_INVALIDPARAMS;
1116
1118
1119 memset(&mode, 0, sizeof(mode));
1120 if (FAILED(hr = wined3d_output_get_display_mode(device->ddraw->wined3d_output, &mode, NULL)))
1121 {
1123 WARN("Failed to get output display mode, hr %#lx.\n", hr);
1124 return hr;
1125 }
1126
1127 for (i = 0; i < ARRAY_SIZE(FormatList); ++i)
1128 {
1129 if (wined3d_check_device_format(device->ddraw->wined3d, device->ddraw->wined3d_adapter,
1131 WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK)
1132 {
1133 DDPIXELFORMAT pformat;
1134
1135 memset(&pformat, 0, sizeof(pformat));
1136 pformat.dwSize = sizeof(pformat);
1137 ddrawformat_from_wined3dformat(&pformat, FormatList[i]);
1138
1139 TRACE("Enumerating WineD3DFormat %d\n", FormatList[i]);
1140 hr = callback(&pformat, context);
1141 if(hr != DDENUMRET_OK)
1142 {
1143 TRACE("Format enumeration cancelled by application\n");
1145 return D3D_OK;
1146 }
1147 }
1148 }
1149
1150 for (i = 0; i < ARRAY_SIZE(BumpFormatList); ++i)
1151 {
1152 if (wined3d_check_device_format(device->ddraw->wined3d, device->ddraw->wined3d_adapter,
1155 {
1156 DDPIXELFORMAT pformat;
1157
1158 memset(&pformat, 0, sizeof(pformat));
1159 pformat.dwSize = sizeof(pformat);
1160 ddrawformat_from_wined3dformat(&pformat, BumpFormatList[i]);
1161
1162 TRACE("Enumerating WineD3DFormat %d\n", BumpFormatList[i]);
1163 hr = callback(&pformat, context);
1164 if(hr != DDENUMRET_OK)
1165 {
1166 TRACE("Format enumeration cancelled by application\n");
1168 return D3D_OK;
1169 }
1170 }
1171 }
1172 TRACE("End of enumeration\n");
1174
1175 return D3D_OK;
1176}
DWORD dwSize
Definition: ddraw.h:1072
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP
Definition: wined3d.h:942
@ WINED3DFMT_DXT2
Definition: wined3d.h:261
@ WINED3DFMT_R10G11B11_SNORM
Definition: wined3d.h:143
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:208
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:141
@ WINED3DFMT_DXT1
Definition: wined3d.h:260
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:147
@ WINED3DFMT_DXT3
Definition: wined3d.h:262
@ WINED3DFMT_DXT4
Definition: wined3d.h:263
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:142
@ WINED3DFMT_DXT5
Definition: wined3d.h:264

Referenced by d3d_device7_EnumTextureFormats_FPUPreserve(), and d3d_device7_EnumTextureFormats_FPUSetup().

◆ d3d_device7_EnumTextureFormats_FPUPreserve()

static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUPreserve ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1184 of file device.c.

1186{
1187 HRESULT hr;
1188 WORD old_fpucw;
1189
1190 old_fpucw = d3d_fpu_setup();
1192 set_fpu_control_word(old_fpucw);
1193
1194 return hr;
1195}
static HRESULT d3d_device7_EnumTextureFormats(IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: device.c:1074

◆ d3d_device7_EnumTextureFormats_FPUSetup()

static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUSetup ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void *  context 
)
static

Definition at line 1178 of file device.c.

1180{
1182}

◆ d3d_device7_GetCaps()

static HRESULT d3d_device7_GetCaps ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 *  device_desc 
)
static

Definition at line 421 of file device.c.

422{
424
425 TRACE("iface %p, device_desc %p.\n", iface, device_desc);
426
427 if (!device_desc)
428 {
429 WARN("device_desc is NULL, returning DDERR_INVALIDPARAMS.\n");
430 return DDERR_INVALIDPARAMS;
431 }
432
433 /* Call the same function used by IDirect3D, this saves code */
434 return ddraw_get_d3dcaps(device->ddraw, device_desc);
435}

Referenced by d3d_device7_GetCaps_FPUPreserve(), and d3d_device7_GetCaps_FPUSetup().

◆ d3d_device7_GetCaps_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetCaps_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 *  desc 
)
static

Definition at line 442 of file device.c.

443{
444 HRESULT hr;
445 WORD old_fpucw;
446
447 old_fpucw = d3d_fpu_setup();
448 hr = d3d_device7_GetCaps(iface, desc);
449 set_fpu_control_word(old_fpucw);
450
451 return hr;
452}
static HRESULT d3d_device7_GetCaps(IDirect3DDevice7 *iface, D3DDEVICEDESC7 *device_desc)
Definition: device.c:421
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683

◆ d3d_device7_GetCaps_FPUSetup()

static HRESULT WINAPI d3d_device7_GetCaps_FPUSetup ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 *  desc 
)
static

Definition at line 437 of file device.c.

438{
439 return d3d_device7_GetCaps(iface, desc);
440}

◆ d3d_device7_GetClipPlane()

static HRESULT d3d_device7_GetClipPlane ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6471 of file device.c.

6472{
6474
6475 TRACE("iface %p, idx %lu, plane %p.\n", iface, idx, plane);
6476
6477 if (!plane)
6478 return DDERR_INVALIDPARAMS;
6479
6482 memcpy(plane, &device->stateblock_state->clip_planes[idx], sizeof(struct wined3d_vec4));
6483 else
6484 {
6485 WARN("Clip plane %lu is not supported.\n", idx);
6486 if (idx < ARRAY_SIZE(device->user_clip_planes))
6487 memcpy(plane, &device->user_clip_planes[idx], sizeof(struct wined3d_vec4));
6488 }
6490
6491 return D3D_OK;
6492}
unsigned int idx
Definition: utils.c:40
#define WINED3D_MAX_CLIP_DISTANCES
Definition: wined3d.h:1601

Referenced by d3d_device7_GetClipPlane_FPUPreserve(), and d3d_device7_GetClipPlane_FPUSetup().

◆ d3d_device7_GetClipPlane_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetClipPlane_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6499 of file device.c.

6500{
6501 HRESULT hr;
6502 WORD old_fpucw;
6503
6504 old_fpucw = d3d_fpu_setup();
6506 set_fpu_control_word(old_fpucw);
6507
6508 return hr;
6509}
static HRESULT d3d_device7_GetClipPlane(IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
Definition: device.c:6471

◆ d3d_device7_GetClipPlane_FPUSetup()

static HRESULT WINAPI d3d_device7_GetClipPlane_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6494 of file device.c.

6495{
6496 return d3d_device7_GetClipPlane(iface, idx, plane);
6497}

◆ d3d_device7_GetClipStatus()

static HRESULT WINAPI d3d_device7_GetClipStatus ( IDirect3DDevice7 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3817 of file device.c.

3818{
3820 struct wined3d_viewport vp;
3821
3822 FIXME("iface %p, clip_status %p stub.\n", iface, clip_status);
3823
3824 vp = device->stateblock_state->viewport;
3825 clip_status->minx = vp.x;
3826 clip_status->maxx = vp.x + vp.width;
3827 clip_status->miny = vp.y;
3828 clip_status->maxy = vp.y + vp.height;
3829 clip_status->minz = 0.0f;
3830 clip_status->maxz = 0.0f;
3831 clip_status->dwFlags = D3DCLIPSTATUS_EXTENTS2;
3832 clip_status->dwStatus = 0;
3833
3834 return D3D_OK;
3835}
#define D3DCLIPSTATUS_EXTENTS2
Definition: d3dtypes.h:1244
DWORD dwStatus
Definition: d3dtypes.h:1237

◆ d3d_device7_GetDirect3D()

static HRESULT WINAPI d3d_device7_GetDirect3D ( IDirect3DDevice7 *  iface,
IDirect3D7 **  d3d 
)
static

Definition at line 1650 of file device.c.

1651{
1653
1654 TRACE("iface %p, d3d %p.\n", iface, d3d);
1655
1656 if (!d3d)
1657 return DDERR_INVALIDPARAMS;
1658
1659 *d3d = &device->ddraw->IDirect3D7_iface;
1660 IDirect3D7_AddRef(*d3d);
1661
1662 TRACE("Returning interface %p.\n", *d3d);
1663 return D3D_OK;
1664}
#define IDirect3D7_AddRef(p)
Definition: d3d.h:380

◆ d3d_device7_GetInfo()

static HRESULT WINAPI d3d_device7_GetInfo ( IDirect3DDevice7 *  iface,
DWORD  info_id,
void *  info,
DWORD  info_size 
)
static

Definition at line 6527 of file device.c.

6528{
6529 TRACE("iface %p, info_id %#lx, info %p, info_size %lu.\n",
6530 iface, info_id, info, info_size);
6531
6532 if (TRACE_ON(ddraw))
6533 {
6534 TRACE(" info requested : ");
6535 switch (info_id)
6536 {
6537 case D3DDEVINFOID_TEXTUREMANAGER: TRACE("D3DDEVINFOID_TEXTUREMANAGER\n"); break;
6538 case D3DDEVINFOID_D3DTEXTUREMANAGER: TRACE("D3DDEVINFOID_D3DTEXTUREMANAGER\n"); break;
6539 case D3DDEVINFOID_TEXTURING: TRACE("D3DDEVINFOID_TEXTURING\n"); break;
6540 default: ERR(" invalid flag !!!\n"); return DDERR_INVALIDPARAMS;
6541 }
6542 }
6543
6544 return S_FALSE; /* According to MSDN, this is valid for a non-debug driver */
6545}
#define D3DDEVINFOID_TEXTUREMANAGER
Definition: d3dtypes.h:1383
#define D3DDEVINFOID_D3DTEXTUREMANAGER
Definition: d3dtypes.h:1384
#define D3DDEVINFOID_TEXTURING
Definition: d3dtypes.h:1385
#define S_FALSE
Definition: winerror.h:3451

◆ d3d_device7_GetLight()

static HRESULT d3d_device7_GetLight ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5479 of file device.c.

5480{
5482 BOOL enabled;
5483 HRESULT hr;
5484
5485 TRACE("iface %p, light_idx %lu, light %p.\n", iface, light_idx, light);
5486
5488 /* Note: D3DLIGHT7 is compatible with struct wined3d_light. */
5489 hr = wined3d_stateblock_get_light(device->state, light_idx, (struct wined3d_light *)light, &enabled);
5491
5492 return hr_ddraw_from_wined3d(hr);
5493}
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
HRESULT CDECL wined3d_stateblock_get_light(const struct wined3d_stateblock *stateblock, UINT light_idx, struct wined3d_light *light, BOOL *enabled)
Definition: stateblock.c:2069

Referenced by d3d_device7_GetLight_FPUPreserve(), and d3d_device7_GetLight_FPUSetup().

◆ d3d_device7_GetLight_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5500 of file device.c.

5501{
5502 HRESULT hr;
5503 WORD old_fpucw;
5504
5505 old_fpucw = d3d_fpu_setup();
5506 hr = d3d_device7_GetLight(iface, light_idx, light);
5507 set_fpu_control_word(old_fpucw);
5508
5509 return hr;
5510}
static HRESULT d3d_device7_GetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
Definition: device.c:5479

◆ d3d_device7_GetLight_FPUSetup()

static HRESULT WINAPI d3d_device7_GetLight_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5495 of file device.c.

5496{
5497 return d3d_device7_GetLight(iface, light_idx, light);
5498}

◆ d3d_device7_GetLightEnable()

static HRESULT d3d_device7_GetLightEnable ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL *  enabled 
)
static

Definition at line 6360 of file device.c.

6361{
6363 struct wined3d_light light;
6364 HRESULT hr;
6365
6366 TRACE("iface %p, light_idx %lu, enabled %p.\n", iface, light_idx, enabled);
6367
6368 if (!enabled)
6369 return DDERR_INVALIDPARAMS;
6370
6372 hr = wined3d_stateblock_get_light(device->state, light_idx, &light, enabled);
6374
6375 return hr_ddraw_from_wined3d(hr);
6376}

Referenced by d3d_device7_GetLightEnable_FPUPreserve(), and d3d_device7_GetLightEnable_FPUSetup().

◆ d3d_device7_GetLightEnable_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetLightEnable_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL *  enabled 
)
static

Definition at line 6383 of file device.c.

6384{
6385 HRESULT hr;
6386 WORD old_fpucw;
6387
6388 old_fpucw = d3d_fpu_setup();
6389 hr = d3d_device7_GetLightEnable(iface, light_idx, enabled);
6390 set_fpu_control_word(old_fpucw);
6391
6392 return hr;
6393}
static HRESULT d3d_device7_GetLightEnable(IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
Definition: device.c:6360

◆ d3d_device7_GetLightEnable_FPUSetup()

static HRESULT WINAPI d3d_device7_GetLightEnable_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL *  enabled 
)
static

Definition at line 6378 of file device.c.

6379{
6380 return d3d_device7_GetLightEnable(iface, light_idx, enabled);
6381}

◆ d3d_device7_GetMaterial()

static HRESULT d3d_device7_GetMaterial ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5388 of file device.c.

5389{
5391
5392 TRACE("iface %p, material %p.\n", iface, material);
5393
5395 /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
5396 memcpy(material, &device->stateblock_state->material, sizeof(*material));
5398
5399 return D3D_OK;
5400}
DWORD material

Referenced by d3d_device7_GetMaterial_FPUPreserve(), and d3d_device7_GetMaterial_FPUSetup().

◆ d3d_device7_GetMaterial_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetMaterial_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5407 of file device.c.

5408{
5409 HRESULT hr;
5410 WORD old_fpucw;
5411
5412 old_fpucw = d3d_fpu_setup();
5413 hr = d3d_device7_GetMaterial(iface, material);
5414 set_fpu_control_word(old_fpucw);
5415
5416 return hr;
5417}
static HRESULT d3d_device7_GetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
Definition: device.c:5388

◆ d3d_device7_GetMaterial_FPUSetup()

static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5402 of file device.c.

5403{
5404 return d3d_device7_GetMaterial(iface, material);
5405}

◆ d3d_device7_GetRenderState()

static HRESULT d3d_device7_GetRenderState ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 2332 of file device.c.

2334{
2337 HRESULT hr = D3D_OK;
2338
2339 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2340
2341 if (!value)
2342 return DDERR_INVALIDPARAMS;
2343
2345 device_state = device->stateblock_state;
2346 switch (state)
2347 {
2349 {
2350 enum wined3d_texture_filter_type tex_mag = device_state->sampler_states[0][WINED3D_SAMP_MAG_FILTER];
2351
2352 switch (tex_mag)
2353 {
2354 case WINED3D_TEXF_POINT:
2356 break;
2359 break;
2360 default:
2361 ERR("Unhandled texture mag %d !\n",tex_mag);
2362 *value = 0;
2363 }
2364 break;
2365 }
2366
2368 {
2369 enum wined3d_texture_filter_type tex_min;
2370 enum wined3d_texture_filter_type tex_mip;
2371
2372 tex_min = device_state->sampler_states[0][WINED3D_SAMP_MIN_FILTER];
2373 tex_mip = device_state->sampler_states[0][WINED3D_SAMP_MIP_FILTER];
2374 switch (tex_min)
2375 {
2376 case WINED3D_TEXF_POINT:
2377 switch (tex_mip)
2378 {
2379 case WINED3D_TEXF_NONE:
2381 break;
2382 case WINED3D_TEXF_POINT:
2384 break;
2387 break;
2388 default:
2389 ERR("Unhandled mip filter %#x.\n", tex_mip);
2391 break;
2392 }
2393 break;
2395 switch (tex_mip)
2396 {
2397 case WINED3D_TEXF_NONE:
2399 break;
2400 case WINED3D_TEXF_POINT:
2402 break;
2405 break;
2406 default:
2407 ERR("Unhandled mip filter %#x.\n", tex_mip);
2409 break;
2410 }
2411 break;
2412 default:
2413 ERR("Unhandled texture min filter %#x.\n",tex_min);
2415 break;
2416 }
2417 break;
2418 }
2419
2422 *value = device_state->sampler_states[0][WINED3D_SAMP_ADDRESS_U];
2423 break;
2425 *value = device_state->sampler_states[0][WINED3D_SAMP_ADDRESS_V];
2426 break;
2427
2429 FIXME("Unhandled render state D3DRENDERSTATE_BORDERCOLOR.\n");
2430 hr = E_NOTIMPL;
2431 break;
2432
2435 WARN("Render state %#x is invalid in d3d7.\n", state);
2437 break;
2438
2439 default:
2442 {
2443 FIXME("Unhandled stipple pattern render state (%#x).\n", state);
2444 hr = E_NOTIMPL;
2445 break;
2446 }
2448 }
2450
2451 return hr;
2452}
@ D3DFILTER_MIPLINEAR
Definition: d3dtypes.h:707
@ D3DFILTER_LINEARMIPLINEAR
Definition: d3dtypes.h:709
@ D3DFILTER_MIPNEAREST
Definition: d3dtypes.h:706
@ D3DFILTER_LINEAR
Definition: d3dtypes.h:705
@ D3DFILTER_NEAREST
Definition: d3dtypes.h:704
@ D3DFILTER_LINEARMIPNEAREST
Definition: d3dtypes.h:708
@ D3DRENDERSTATE_BORDERCOLOR
Definition: d3dtypes.h:919
@ D3DRENDERSTATE_STIPPLEPATTERN31
Definition: d3dtypes.h:970
@ D3DRENDERSTATE_TEXTUREMAG
Definition: d3dtypes.h:891
@ D3DRENDERSTATE_TEXTUREMIN
Definition: d3dtypes.h:892
@ D3DRENDERSTATE_TEXTUREADDRESS
Definition: d3dtypes.h:877
@ D3DRENDERSTATE_TEXTUREADDRESSU
Definition: d3dtypes.h:920
@ D3DRENDERSTATE_TEXTUREADDRESSV
Definition: d3dtypes.h:921
@ D3DRENDERSTATE_STIPPLEPATTERN00
Definition: d3dtypes.h:939
#define E_NOTIMPL
Definition: ddrawi.h:99
static enum wined3d_render_state wined3d_render_state_from_ddraw(D3DRENDERSTATETYPE state)
Definition: device.c:75
@ WINED3D_SAMP_MIN_FILTER
Definition: wined3d.h:560
@ WINED3D_SAMP_MIP_FILTER
Definition: wined3d.h:561
@ WINED3D_SAMP_MAG_FILTER
Definition: wined3d.h:559
@ WINED3D_SAMP_ADDRESS_V
Definition: wined3d.h:556
@ WINED3D_SAMP_ADDRESS_U
Definition: wined3d.h:555
wined3d_texture_filter_type
Definition: wined3d.h:704
@ WINED3D_TEXF_NONE
Definition: wined3d.h:705
@ WINED3D_TEXF_LINEAR
Definition: wined3d.h:707

Referenced by d3d_device7_GetRenderState_FPUPreserve(), and d3d_device7_GetRenderState_FPUSetup().

◆ d3d_device7_GetRenderState_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetRenderState_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 2460 of file device.c.

2462{
2463 HRESULT hr;
2464 WORD old_fpucw;
2465
2466 old_fpucw = d3d_fpu_setup();
2468 set_fpu_control_word(old_fpucw);
2469
2470 return hr;
2471}
static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
Definition: device.c:2332

◆ d3d_device7_GetRenderState_FPUSetup()

static HRESULT WINAPI d3d_device7_GetRenderState_FPUSetup ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD *  value 
)
static

Definition at line 2454 of file device.c.

2456{
2457 return d3d_device7_GetRenderState(iface, state, value);
2458}

◆ d3d_device7_GetRenderTarget()

static HRESULT WINAPI d3d_device7_GetRenderTarget ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 **  RenderTarget 
)
static

Definition at line 2058 of file device.c.

2059{
2061 HRESULT hr;
2062
2063 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2064
2065 if(!RenderTarget)
2066 return DDERR_INVALIDPARAMS;
2067
2069 hr = IUnknown_QueryInterface(device->rt_iface, &IID_IDirectDrawSurface7, (void **)RenderTarget);
2071
2072 return hr;
2073}

Referenced by d3d_device2_GetRenderTarget(), and d3d_device3_GetRenderTarget().

◆ d3d_device7_GetTexture()

static HRESULT d3d_device7_GetTexture ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  texture 
)
static

Definition at line 4586 of file device.c.

4588{
4592
4593 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
4594
4595 if (!texture)
4596 return DDERR_INVALIDPARAMS;
4597
4598 if (stage >= DDRAW_MAX_TEXTURES)
4599 {
4600 WARN("Invalid stage %lu.\n", stage);
4601 *texture = NULL;
4602 return D3D_OK;
4603 }
4604
4606 if (!(wined3d_texture = device->stateblock_state->textures[stage]))
4607 {
4608 *texture = NULL;
4610 return D3D_OK;
4611 }
4612
4614 *texture = &ddraw_texture->root->IDirectDrawSurface7_iface;
4615 IDirectDrawSurface7_AddRef(*texture);
4617
4618 return D3D_OK;
4619}
#define DDRAW_MAX_TEXTURES
Definition: ddraw_private.h:71
struct ddraw_surface * root

Referenced by d3d_device7_GetTexture_FPUPreserve(), and d3d_device7_GetTexture_FPUSetup().

◆ d3d_device7_GetTexture_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTexture_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  Texture 
)
static

Definition at line 4627 of file device.c.

4629{
4630 HRESULT hr;
4631 WORD old_fpucw;
4632
4633 old_fpucw = d3d_fpu_setup();
4634 hr = d3d_device7_GetTexture(iface, stage, Texture);
4635 set_fpu_control_word(old_fpucw);
4636
4637 return hr;
4638}
static HRESULT d3d_device7_GetTexture(IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **texture)
Definition: device.c:4586

◆ d3d_device7_GetTexture_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTexture_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  Texture 
)
static

Definition at line 4621 of file device.c.

4623{
4624 return d3d_device7_GetTexture(iface, stage, Texture);
4625}

◆ d3d_device7_GetTextureStageState()

static HRESULT d3d_device7_GetTextureStageState ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD *  value 
)
static

Definition at line 4809 of file device.c.

4811{
4814 const struct tss_lookup *l;
4815
4816 TRACE("iface %p, stage %lu, state %#x, value %p.\n",
4817 iface, stage, state, value);
4818
4819 if (!value)
4820 return DDERR_INVALIDPARAMS;
4821
4823 {
4824 WARN("Invalid state %#x passed.\n", state);
4825 return DD_OK;
4826 }
4827
4828 if (stage >= DDRAW_MAX_TEXTURES)
4829 {
4830 WARN("Invalid stage %lu.\n", stage);
4831 *value = 0;
4832 return D3D_OK;
4833 }
4834
4835 l = &tss_lookup[state];
4836
4838
4839 device_state = device->stateblock_state;
4840
4841 if (l->sampler_state)
4842 {
4843 *value = device_state->sampler_states[stage][l->u.sampler_state];
4844
4845 switch (state)
4846 {
4847 /* Mipfilter is a sampler state with different values */
4848 case D3DTSS_MIPFILTER:
4849 {
4850 switch (*value)
4851 {
4852 case WINED3D_TEXF_NONE:
4853 *value = D3DTFP_NONE;
4854 break;
4855 case WINED3D_TEXF_POINT:
4857 break;
4860 break;
4861 default:
4862 ERR("Unexpected mipfilter value %#lx.\n", *value);
4863 *value = D3DTFP_NONE;
4864 break;
4865 }
4866 break;
4867 }
4868
4869 /* Magfilter has slightly different values */
4870 case D3DTSS_MAGFILTER:
4871 {
4872 switch (*value)
4873 {
4874 case WINED3D_TEXF_POINT:
4876 break;
4879 break;
4882 break;
4885 break;
4888 break;
4889 default:
4890 ERR("Unexpected wined3d mag filter value %#lx.\n", *value);
4892 break;
4893 }
4894 break;
4895 }
4896
4897 default:
4898 break;
4899 }
4900 }
4901 else
4902 {
4903 *value = device_state->texture_states[stage][l->u.texture_state];
4904 }
4905
4907
4908 return D3D_OK;
4909}
r l[0]
Definition: byte_order.h:168
@ D3DTSS_MAGFILTER
Definition: d3d8types.h:926
@ D3DTSS_MIPFILTER
Definition: d3d8types.h:928
@ D3DTSS_TEXTURETRANSFORMFLAGS
Definition: d3d8types.h:934
@ D3DTFP_LINEAR
Definition: d3dtypes.h:1166
@ D3DTFP_POINT
Definition: d3dtypes.h:1165
@ D3DTFP_NONE
Definition: d3dtypes.h:1164
@ D3DTFG_GAUSSIANCUBIC
Definition: d3dtypes.h:1149
@ D3DTFG_POINT
Definition: d3dtypes.h:1146
@ D3DTFG_ANISOTROPIC
Definition: d3dtypes.h:1150
@ D3DTFG_FLATCUBIC
Definition: d3dtypes.h:1148
@ D3DTFG_LINEAR
Definition: d3dtypes.h:1147
@ WINED3D_TEXF_GAUSSIAN_CUBIC
Definition: wined3d.h:710
@ WINED3D_TEXF_FLAT_CUBIC
Definition: wined3d.h:709
@ WINED3D_TEXF_ANISOTROPIC
Definition: wined3d.h:708

Referenced by d3d_device7_GetTextureStageState_FPUPreserve(), and d3d_device7_GetTextureStageState_FPUSetup().

◆ d3d_device7_GetTextureStageState_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD *  value 
)
static

Definition at line 4917 of file device.c.

4919{
4920 HRESULT hr;
4921 WORD old_fpucw;
4922
4923 old_fpucw = d3d_fpu_setup();
4925 set_fpu_control_word(old_fpucw);
4926
4927 return hr;
4928}
static HRESULT d3d_device7_GetTextureStageState(IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
Definition: device.c:4809

◆ d3d_device7_GetTextureStageState_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD *  value 
)
static

Definition at line 4911 of file device.c.

4913{
4914 return d3d_device7_GetTextureStageState(iface, stage, state, value);
4915}

◆ d3d_device7_GetTransform()

static HRESULT d3d_device7_GetTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3218 of file device.c.

3220{
3222
3223 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3224
3225 if (!matrix)
3226 return DDERR_INVALIDPARAMS;
3227
3228 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3230 memcpy(matrix, &device->stateblock_state->transforms[wined3d_transform_state_from_ddraw(state)], sizeof(*matrix));
3232
3233 return D3D_OK;
3234}
static enum wined3d_transform_state wined3d_transform_state_from_ddraw(D3DTRANSFORMSTATETYPE state)
Definition: device.c:88

Referenced by d3d_device7_GetTransform_FPUPreserve(), and d3d_device7_GetTransform_FPUSetup().

◆ d3d_device7_GetTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3242 of file device.c.

3244{
3245 HRESULT hr;
3246 WORD old_fpucw;
3247
3248 old_fpucw = d3d_fpu_setup();
3250 set_fpu_control_word(old_fpucw);
3251
3252 return hr;
3253}
static HRESULT d3d_device7_GetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3218

◆ d3d_device7_GetTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3236 of file device.c.

3238{
3239 return d3d_device7_GetTransform(iface, state, matrix);
3240}

◆ d3d_device7_GetViewport()

static HRESULT d3d_device7_GetViewport ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5283 of file device.c.

5284{
5287
5288 TRACE("iface %p, viewport %p.\n", iface, viewport);
5289
5290 if (!viewport)
5291 return DDERR_INVALIDPARAMS;
5292
5294 wined3d_viewport = device->stateblock_state->viewport;
5296
5297 viewport->dwX = wined3d_viewport.x;
5298 viewport->dwY = wined3d_viewport.y;
5299 viewport->dwWidth = wined3d_viewport.width;
5300 viewport->dwHeight = wined3d_viewport.height;
5301 viewport->dvMinZ = wined3d_viewport.min_z;
5302 viewport->dvMaxZ = wined3d_viewport.max_z;
5303
5304 return D3D_OK;
5305}
D3DVALUE dvMinZ
Definition: d3dtypes.h:395
DWORD dwWidth
Definition: d3dtypes.h:393
D3DVALUE dvMaxZ
Definition: d3dtypes.h:396
DWORD dwHeight
Definition: d3dtypes.h:394

Referenced by d3d_device7_GetViewport_FPUPreserve(), and d3d_device7_GetViewport_FPUSetup().

◆ d3d_device7_GetViewport_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5312 of file device.c.

5313{
5314 HRESULT hr;
5315 WORD old_fpucw;
5316
5317 old_fpucw = d3d_fpu_setup();
5318 hr = d3d_device7_GetViewport(iface, viewport);
5319 set_fpu_control_word(old_fpucw);
5320
5321 return hr;
5322}
static HRESULT d3d_device7_GetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
Definition: device.c:5283

◆ d3d_device7_GetViewport_FPUSetup()

static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5307 of file device.c.

5308{
5309 return d3d_device7_GetViewport(iface, viewport);
5310}

◆ d3d_device7_LightEnable()

static HRESULT d3d_device7_LightEnable ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6313 of file device.c.

6314{
6316 HRESULT hr;
6317
6318 TRACE("iface %p, light_idx %lu, enabled %#x.\n", iface, light_idx, enabled);
6319
6321 hr = wined3d_stateblock_set_light_enable(device->update_state, light_idx, enabled);
6323
6324 return hr_ddraw_from_wined3d(hr);
6325}
HRESULT CDECL wined3d_stateblock_set_light_enable(struct wined3d_stateblock *stateblock, UINT light_idx, BOOL enable)
Definition: stateblock.c:2042

Referenced by d3d_device7_LightEnable_FPUPreserve(), and d3d_device7_LightEnable_FPUSetup().

◆ d3d_device7_LightEnable_FPUPreserve()

static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6332 of file device.c.

6333{
6334 HRESULT hr;
6335 WORD old_fpucw;
6336
6337 old_fpucw = d3d_fpu_setup();
6338 hr = d3d_device7_LightEnable(iface, light_idx, enabled);
6339 set_fpu_control_word(old_fpucw);
6340
6341 return hr;
6342}
static HRESULT d3d_device7_LightEnable(IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
Definition: device.c:6313

◆ d3d_device7_LightEnable_FPUSetup()

static HRESULT WINAPI d3d_device7_LightEnable_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6327 of file device.c.

6328{
6329 return d3d_device7_LightEnable(iface, light_idx, enabled);
6330}

◆ d3d_device7_Load()

static HRESULT d3d_device7_Load ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  dst_texture,
POINT *  dst_pos,
IDirectDrawSurface7 *  src_texture,
RECT *  src_rect,
DWORD  flags 
)
static

Definition at line 6114 of file device.c.

6116{
6120 POINT destpoint;
6121 RECT srcrect;
6122
6123 TRACE("iface %p, dst_texture %p, dst_pos %s, src_texture %p, src_rect %s, flags %#lx.\n",
6124 iface, dst_texture, wine_dbgstr_point(dst_pos), src_texture, wine_dbgstr_rect(src_rect), flags);
6125
6126 if( (!src) || (!dest) )
6127 return DDERR_INVALIDPARAMS;
6128
6130
6131 if (!src_rect)
6132 SetRect(&srcrect, 0, 0, src->surface_desc.dwWidth, src->surface_desc.dwHeight);
6133 else
6134 srcrect = *src_rect;
6135
6136 if (!dst_pos)
6137 destpoint.x = destpoint.y = 0;
6138 else
6139 destpoint = *dst_pos;
6140
6141 /* Check bad dimensions. dst_pos is validated against src, not dest, because
6142 * destination can be a subset of mip levels, in which case actual coordinates used
6143 * for it may be divided. If any dimension of dest is larger than source, it can't be
6144 * mip level subset, so an error can be returned early.
6145 */
6146 if (IsRectEmpty(&srcrect) || srcrect.right > src->surface_desc.dwWidth ||
6147 srcrect.bottom > src->surface_desc.dwHeight ||
6148 destpoint.x + srcrect.right - srcrect.left > src->surface_desc.dwWidth ||
6149 destpoint.y + srcrect.bottom - srcrect.top > src->surface_desc.dwHeight ||
6150 dest->surface_desc.dwWidth > src->surface_desc.dwWidth ||
6151 dest->surface_desc.dwHeight > src->surface_desc.dwHeight)
6152 {
6154 return DDERR_INVALIDPARAMS;
6155 }
6156
6157 /* Must be top level surfaces. */
6158 if (src->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL ||
6159 dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL)
6160 {
6162 return DDERR_INVALIDPARAMS;
6163 }
6164
6165 if (src->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
6166 {
6167 struct ddraw_surface *src_face, *dest_face;
6168 DWORD src_face_flag, dest_face_flag;
6170 DDSURFACEDESC2 ddsd;
6171 int i;
6172
6173 if (!(dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP))
6174 {
6176 return DDERR_INVALIDPARAMS;
6177 }
6178
6179 /* Iterate through cube faces 2 times. First time is just to check INVALIDPARAMS conditions, second
6180 * time it's actual surface loading. */
6181 for (i = 0; i < 2; i++)
6182 {
6183 dest_face = dest;
6184 src_face = src;
6185
6186 for (;dest_face && src_face;)
6187 {
6188 src_face_flag = src_face->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES;
6189 dest_face_flag = dest_face->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES;
6190
6191 if (src_face_flag == dest_face_flag)
6192 {
6193 if (i == 0)
6194 {
6195 /* Destination mip levels must be subset of source mip levels. */
6196 if (!is_mip_level_subset(dest_face, src_face))
6197 {
6199 return DDERR_INVALIDPARAMS;
6200 }
6201 }
6202 else if (flags & dest_face_flag)
6203 {
6204 copy_mipmap_chain(device, dest_face, src_face, &destpoint, &srcrect);
6205 }
6206
6207 if (src_face_flag < DDSCAPS2_CUBEMAP_NEGATIVEZ)
6208 {
6210 ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | (src_face_flag << 1);
6211 IDirectDrawSurface7_GetAttachedSurface(&src->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6212
6213 if (src_face != src) IDirectDrawSurface7_Release(&src_face->IDirectDrawSurface7_iface);
6214
6216 }
6217 else
6218 {
6219 if (src_face != src) IDirectDrawSurface7_Release(&src_face->IDirectDrawSurface7_iface);
6220
6221 src_face = NULL;
6222 }
6223 }
6224
6225 if (dest_face_flag < DDSCAPS2_CUBEMAP_NEGATIVEZ)
6226 {
6228 ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | (dest_face_flag << 1);
6229 IDirectDrawSurface7_GetAttachedSurface(&dest->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6230
6231 if (dest_face != dest) IDirectDrawSurface7_Release(&dest_face->IDirectDrawSurface7_iface);
6232
6234 }
6235 else
6236 {
6237 if (dest_face != dest) IDirectDrawSurface7_Release(&dest_face->IDirectDrawSurface7_iface);
6238
6239 dest_face = NULL;
6240 }
6241 }
6242
6243 if (i == 0)
6244 {
6245 /* Native returns error if src faces are not subset of dest faces. */
6246 if (src_face)
6247 {
6249 return DDERR_INVALIDPARAMS;
6250 }
6251 }
6252 }
6253
6255 return D3D_OK;
6256 }
6257 else if (dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
6258 {
6260 return DDERR_INVALIDPARAMS;
6261 }
6262
6263 /* Handle non cube map textures. */
6264
6265 /* Destination mip levels must be subset of source mip levels. */
6267 {
6269 return DDERR_INVALIDPARAMS;
6270 }
6271
6272 copy_mipmap_chain(device, dest, src, &destpoint, &srcrect);
6273
6275
6276 return D3D_OK;
6277}
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static BOOL is_mip_level_subset(struct ddraw_surface *dest, struct ddraw_surface *src)
Definition: device.c:5950
static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
Definition: device.c:5997
#define DDSCAPS2_CUBEMAP
Definition: ddsformat.c:64
static char * dest
Definition: rtl.c:149
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define DDSCAPS2_CUBEMAP_NEGATIVEZ
Definition: ddraw.h:298
#define DDSCAPS2_CUBEMAP_ALLFACES
Definition: ddraw.h:299
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24

Referenced by d3d_device7_Load_FPUPreserve(), and d3d_device7_Load_FPUSetup().

◆ d3d_device7_Load_FPUPreserve()

static HRESULT WINAPI d3d_device7_Load_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  dst_texture,
POINT *  dst_pos,
IDirectDrawSurface7 *  src_texture,
RECT *  src_rect,
DWORD  flags 
)
static

Definition at line 6285 of file device.c.

6287{
6288 HRESULT hr;
6289 WORD old_fpucw;
6290
6291 old_fpucw = d3d_fpu_setup();
6292 hr = d3d_device7_Load(iface, dst_texture, dst_pos, src_texture, src_rect, flags);
6293 set_fpu_control_word(old_fpucw);
6294
6295 return hr;
6296}
static HRESULT d3d_device7_Load(IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
Definition: device.c:6114

◆ d3d_device7_Load_FPUSetup()

static HRESULT WINAPI d3d_device7_Load_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  dst_texture,
POINT *  dst_pos,
IDirectDrawSurface7 *  src_texture,
RECT *  src_rect,
DWORD  flags 
)
static

Definition at line 6279 of file device.c.

6281{
6282 return d3d_device7_Load(iface, dst_texture, dst_pos, src_texture, src_rect, flags);
6283}

◆ d3d_device7_MultiplyTransform()

static HRESULT d3d_device7_MultiplyTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3303 of file device.c.

3305{
3307
3308 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3309
3310 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3315
3316 return D3D_OK;
3317}
void CDECL wined3d_stateblock_multiply_transform(struct wined3d_stateblock *stateblock, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: stateblock.c:1859

Referenced by d3d_device7_MultiplyTransform_FPUPreserve(), and d3d_device7_MultiplyTransform_FPUSetup().

◆ d3d_device7_MultiplyTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3325 of file device.c.

3327{
3328 HRESULT hr;
3329 WORD old_fpucw;
3330
3331 old_fpucw = d3d_fpu_setup();
3333 set_fpu_control_word(old_fpucw);
3334
3335 return hr;
3336}
static HRESULT d3d_device7_MultiplyTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3303

◆ d3d_device7_MultiplyTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3319 of file device.c.

3321{
3323}

◆ d3d_device7_PreLoad()

static HRESULT d3d_device7_PreLoad ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 5650 of file device.c.

5651{
5653
5654 TRACE("iface %p, texture %p.\n", iface, texture);
5655
5656 if (!texture)
5657 return DDERR_INVALIDPARAMS;
5658
5661 : surface->wined3d_texture));
5663
5664 return D3D_OK;
5665}
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:311
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1649

Referenced by d3d_device7_PreLoad_FPUPreserve(), and d3d_device7_PreLoad_FPUSetup().

◆ d3d_device7_PreLoad_FPUPreserve()

static HRESULT WINAPI d3d_device7_PreLoad_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 5672 of file device.c.

5673{
5674 HRESULT hr;
5675 WORD old_fpucw;
5676
5677 old_fpucw = d3d_fpu_setup();
5678 hr = d3d_device7_PreLoad(iface, texture);
5679 set_fpu_control_word(old_fpucw);
5680
5681 return hr;
5682}
static HRESULT d3d_device7_PreLoad(IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
Definition: device.c:5650

◆ d3d_device7_PreLoad_FPUSetup()

static HRESULT WINAPI d3d_device7_PreLoad_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 5667 of file device.c.

5668{
5669 return d3d_device7_PreLoad(iface, texture);
5670}

◆ d3d_device7_QueryInterface()

static HRESULT WINAPI d3d_device7_QueryInterface ( IDirect3DDevice7 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 178 of file device.c.

179{
181
182 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
183
184 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
185}

◆ d3d_device7_Release()

static ULONG WINAPI d3d_device7_Release ( IDirect3DDevice7 *  iface)
static

Definition at line 356 of file device.c.

357{
359
360 TRACE("iface %p.\n", iface);
361
362 return IUnknown_Release(device->outer_unknown);
363}

◆ d3d_device7_SetClipPlane()

static HRESULT d3d_device7_SetClipPlane ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6411 of file device.c.

6412{
6414 const struct wined3d_vec4 *wined3d_plane;
6415 HRESULT hr;
6416
6417 TRACE("iface %p, idx %lu, plane %p.\n", iface, idx, plane);
6418
6419 if (!plane)
6420 return DDERR_INVALIDPARAMS;
6421
6422 wined3d_plane = (struct wined3d_vec4 *)plane;
6423
6425 hr = wined3d_stateblock_set_clip_plane(device->update_state, idx, wined3d_plane);
6426 if (idx < ARRAY_SIZE(device->user_clip_planes))
6427 {
6428 device->user_clip_planes[idx] = *wined3d_plane;
6430 {
6431 WARN("Clip plane %lu is not supported.\n", idx);
6432 hr = D3D_OK;
6433 }
6434 }
6436
6437 return hr;
6438}
HRESULT CDECL wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock, UINT plane_idx, const struct wined3d_vec4 *plane)
Definition: stateblock.c:1875
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44

Referenced by d3d_device7_SetClipPlane_FPUPreserve(), and d3d_device7_SetClipPlane_FPUSetup().

◆ d3d_device7_SetClipPlane_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetClipPlane_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6445 of file device.c.

6446{
6447 HRESULT hr;
6448 WORD old_fpucw;
6449
6450 old_fpucw = d3d_fpu_setup();
6452 set_fpu_control_word(old_fpucw);
6453
6454 return hr;
6455}
static HRESULT d3d_device7_SetClipPlane(IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
Definition: device.c:6411

◆ d3d_device7_SetClipPlane_FPUSetup()

static HRESULT WINAPI d3d_device7_SetClipPlane_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE *  plane 
)
static

Definition at line 6440 of file device.c.

6441{
6442 return d3d_device7_SetClipPlane(iface, idx, plane);
6443}

◆ d3d_device7_SetClipStatus()

static HRESULT WINAPI d3d_device7_SetClipStatus ( IDirect3DDevice7 *  iface,
D3DCLIPSTATUS *  clip_status 
)
static

Definition at line 3780 of file device.c.

3781{
3782 FIXME("iface %p, clip_status %p stub!\n", iface, clip_status);
3783
3784 return D3D_OK;
3785}

◆ d3d_device7_SetLight()

static HRESULT d3d_device7_SetLight ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5434 of file device.c.

5435{
5437 HRESULT hr;
5438
5439 TRACE("iface %p, light_idx %lu, light %p.\n", iface, light_idx, light);
5440
5442 /* Note: D3DLIGHT7 is compatible with struct wined3d_light. */
5443 hr = wined3d_stateblock_set_light(device->update_state, light_idx, (const struct wined3d_light *)light);
5445
5446 return hr_ddraw_from_wined3d(hr);
5447}
HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock, UINT light_idx, const struct wined3d_light *light)
Definition: stateblock.c:1996

Referenced by d3d_device7_SetLight_FPUPreserve(), and d3d_device7_SetLight_FPUSetup().

◆ d3d_device7_SetLight_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5454 of file device.c.

5455{
5456 HRESULT hr;
5457 WORD old_fpucw;
5458
5459 old_fpucw = d3d_fpu_setup();
5460 hr = d3d_device7_SetLight(iface, light_idx, light);
5461 set_fpu_control_word(old_fpucw);
5462
5463 return hr;
5464}
static HRESULT d3d_device7_SetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
Definition: device.c:5434

◆ d3d_device7_SetLight_FPUSetup()

static HRESULT WINAPI d3d_device7_SetLight_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 *  light 
)
static

Definition at line 5449 of file device.c.

5450{
5451 return d3d_device7_SetLight(iface, light_idx, light);
5452}

◆ d3d_device7_SetMaterial()

static HRESULT d3d_device7_SetMaterial ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5339 of file device.c.

5340{
5342
5343 TRACE("iface %p, material %p.\n", iface, material);
5344
5345 if (!material)
5346 return DDERR_INVALIDPARAMS;
5347
5349 /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
5350 wined3d_stateblock_set_material(device->update_state, (const struct wined3d_material *)material);
5352
5353 return D3D_OK;
5354}
void CDECL wined3d_stateblock_set_material(struct wined3d_stateblock *stateblock, const struct wined3d_material *material)
Definition: stateblock.c:1891

Referenced by d3d_device7_SetMaterial_FPUPreserve(), and d3d_device7_SetMaterial_FPUSetup().

◆ d3d_device7_SetMaterial_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5361 of file device.c.

5362{
5363 HRESULT hr;
5364 WORD old_fpucw;
5365
5366 old_fpucw = d3d_fpu_setup();
5367 hr = d3d_device7_SetMaterial(iface, material);
5368 set_fpu_control_word(old_fpucw);
5369
5370 return hr;
5371}
static HRESULT d3d_device7_SetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
Definition: device.c:5339

◆ d3d_device7_SetMaterial_FPUSetup()

static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 *  material 
)
static

Definition at line 5356 of file device.c.

5357{
5358 return d3d_device7_SetMaterial(iface, material);
5359}

◆ d3d_device7_SetRenderState()

static HRESULT d3d_device7_SetRenderState ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2543 of file device.c.

2545{
2547 HRESULT hr = D3D_OK;
2548
2549 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
2550
2552 /* Some render states need special care */
2553 switch (state)
2554 {
2555 /*
2556 * The ddraw texture filter mapping works like this:
2557 * D3DFILTER_NEAREST Point min/mag, no mip
2558 * D3DFILTER_MIPNEAREST Point min/mag, point mip
2559 * D3DFILTER_LINEARMIPNEAREST: Point min/mag, linear mip
2560 *
2561 * D3DFILTER_LINEAR Linear min/mag, no mip
2562 * D3DFILTER_MIPLINEAR Linear min/mag, point mip
2563 * D3DFILTER_LINEARMIPLINEAR Linear min/mag, linear mip
2564 *
2565 * This is the opposite of the GL naming convention,
2566 * D3DFILTER_LINEARMIPNEAREST corresponds to GL_NEAREST_MIPMAP_LINEAR.
2567 */
2569 {
2570 enum wined3d_texture_filter_type tex_mag;
2571
2572 switch (value)
2573 {
2574 case D3DFILTER_NEAREST:
2577 tex_mag = WINED3D_TEXF_POINT;
2578 break;
2579 case D3DFILTER_LINEAR:
2582 tex_mag = WINED3D_TEXF_LINEAR;
2583 break;
2584 default:
2585 tex_mag = WINED3D_TEXF_POINT;
2586 FIXME("Unhandled texture mag %#lx.\n", value);
2587 break;
2588 }
2589
2591 break;
2592 }
2593
2595 {
2596 enum wined3d_texture_filter_type tex_min;
2597 enum wined3d_texture_filter_type tex_mip;
2598
2599 switch (value)
2600 {
2601 case D3DFILTER_NEAREST:
2602 tex_min = WINED3D_TEXF_POINT;
2603 tex_mip = WINED3D_TEXF_NONE;
2604 break;
2605 case D3DFILTER_LINEAR:
2606 tex_min = WINED3D_TEXF_LINEAR;
2607 tex_mip = WINED3D_TEXF_NONE;
2608 break;
2610 tex_min = WINED3D_TEXF_POINT;
2611 tex_mip = WINED3D_TEXF_POINT;
2612 break;
2614 tex_min = WINED3D_TEXF_LINEAR;
2615 tex_mip = WINED3D_TEXF_POINT;
2616 break;
2618 tex_min = WINED3D_TEXF_POINT;
2619 tex_mip = WINED3D_TEXF_LINEAR;
2620 break;
2622 tex_min = WINED3D_TEXF_LINEAR;
2623 tex_mip = WINED3D_TEXF_LINEAR;
2624 break;
2625
2626 default:
2627 FIXME("Unhandled texture min %#lx.\n",value);
2628 tex_min = WINED3D_TEXF_POINT;
2629 tex_mip = WINED3D_TEXF_NONE;
2630 break;
2631 }
2632
2635 break;
2636 }
2637
2640 /* Drop through */
2643 break;
2646 break;
2647
2649 /* This should probably just forward to the corresponding sampler
2650 * state. Needs tests. */
2651 FIXME("Unhandled render state D3DRENDERSTATE_BORDERCOLOR.\n");
2652 hr = E_NOTIMPL;
2653 break;
2654
2657 WARN("Render state %#x is invalid in d3d7.\n", state);
2659 break;
2660
2661 default:
2664 {
2665 FIXME("Unhandled stipple pattern render state (%#x).\n", state);
2666 hr = E_NOTIMPL;
2667 break;
2668 }
2669
2671 break;
2672 }
2674
2675 return hr;
2676}
void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, UINT sampler_idx, enum wined3d_sampler_state state, unsigned int value)
Definition: stateblock.c:1702
void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, enum wined3d_render_state state, unsigned int value)
Definition: stateblock.c:1623

Referenced by d3d_device7_SetRenderState_FPUPreserve(), and d3d_device7_SetRenderState_FPUSetup().

◆ d3d_device7_SetRenderState_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetRenderState_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2684 of file device.c.

2686{
2687 HRESULT hr;
2688 WORD old_fpucw;
2689
2690 old_fpucw = d3d_fpu_setup();
2692 set_fpu_control_word(old_fpucw);
2693
2694 return hr;
2695}
static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
Definition: device.c:2543

◆ d3d_device7_SetRenderState_FPUSetup()

static HRESULT WINAPI d3d_device7_SetRenderState_FPUSetup ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2678 of file device.c.

2680{
2681 return d3d_device7_SetRenderState(iface, state, value);
2682}

◆ d3d_device7_SetRenderTarget()

static HRESULT d3d_device7_SetRenderTarget ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  target,
DWORD  flags 
)
static

Definition at line 1866 of file device.c.

1868{
1871 HRESULT hr;
1872
1873 TRACE("iface %p, target %p, flags %#lx.\n", iface, target, flags);
1874
1876
1877 if (!validate_surface_palette(target_impl))
1878 {
1879 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1881 return DDERR_INVALIDCAPS;
1882 }
1883
1884 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1885 {
1886 WARN("Surface %p is not a render target.\n", target_impl);
1888 return DDERR_INVALIDCAPS;
1889 }
1890
1891 if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1892 {
1893 WARN("Surface %p is not in video memory.\n", target_impl);
1895 return DDERR_INVALIDPARAMS;
1896 }
1897
1898 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1899 {
1900 WARN("Surface %p is a depth buffer.\n", target_impl);
1901 IDirectDrawSurface7_AddRef(target);
1902 IUnknown_Release(device->rt_iface);
1903 device->rt_iface = (IUnknown *)target;
1904 device->target = NULL;
1905 device->target_ds = NULL;
1908 }
1909
1912 return hr;
1913}

Referenced by d3d_device7_SetRenderTarget_FPUPreserve(), and d3d_device7_SetRenderTarget_FPUSetup().

◆ d3d_device7_SetRenderTarget_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  NewTarget,
DWORD  flags 
)
static

Definition at line 1921 of file device.c.

1923{
1924 HRESULT hr;
1925 WORD old_fpucw;
1926
1927 old_fpucw = d3d_fpu_setup();
1928 hr = d3d_device7_SetRenderTarget(iface, NewTarget, flags);
1929 set_fpu_control_word(old_fpucw);
1930
1931 return hr;
1932}
static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 *target, DWORD flags)
Definition: device.c:1866

◆ d3d_device7_SetRenderTarget_FPUSetup()

static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 *  NewTarget,
DWORD  flags 
)
static

Definition at line 1915 of file device.c.

1917{
1918 return d3d_device7_SetRenderTarget(iface, NewTarget, flags);
1919}

◆ d3d_device7_SetTexture()

static HRESULT d3d_device7_SetTexture ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 4674 of file device.c.

4676{
4680
4681 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
4682
4683 if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
4684 {
4685 if (surf->draw_texture)
4686 {
4688 device->have_draw_textures = TRUE;
4689 }
4690 else
4691 {
4693 }
4694 }
4695
4699
4700 return D3D_OK;
4701}

Referenced by d3d_device7_SetTexture_FPUPreserve(), and d3d_device7_SetTexture_FPUSetup().

◆ d3d_device7_SetTexture_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTexture_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 4709 of file device.c.

4711{
4712 HRESULT hr;
4713 WORD old_fpucw;
4714
4715 old_fpucw = d3d_fpu_setup();
4716 hr = d3d_device7_SetTexture(iface, stage, texture);
4717 set_fpu_control_word(old_fpucw);
4718
4719 return hr;
4720}
static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
Definition: device.c:4674

◆ d3d_device7_SetTexture_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTexture_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 *  texture 
)
static

Definition at line 4703 of file device.c.

4705{
4706 return d3d_device7_SetTexture(iface, stage, texture);
4707}

◆ d3d_device7_SetTextureStageState()

static HRESULT d3d_device7_SetTextureStageState ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 4958 of file device.c.

4960{
4962 const struct tss_lookup *l;
4963
4964 TRACE("iface %p, stage %lu, state %#x, value %#lx.\n",
4965 iface, stage, state, value);
4966
4968 {
4969 WARN("Invalid state %#x passed.\n", state);
4970 return DD_OK;
4971 }
4972
4973 l = &tss_lookup[state];
4974
4976
4977 if (l->sampler_state)
4978 {
4979 switch (state)
4980 {
4981 /* Mipfilter is a sampler state with different values */
4982 case D3DTSS_MIPFILTER:
4983 {
4984 switch (value)
4985 {
4986 case D3DTFP_NONE:
4988 break;
4989 case D3DTFP_POINT:
4991 break;
4992 case 0: /* Unchecked */
4993 case D3DTFP_LINEAR:
4995 break;
4996 default:
4997 ERR("Unexpected mipfilter value %#lx.\n", value);
4999 break;
5000 }
5001 break;
5002 }
5003
5004 /* Magfilter has slightly different values */
5005 case D3DTSS_MAGFILTER:
5006 {
5007 switch (value)
5008 {
5009 case D3DTFG_POINT:
5011 break;
5012 case D3DTFG_LINEAR:
5014 break;
5015 case D3DTFG_FLATCUBIC:
5017 break;
5020 break;
5021 case D3DTFG_ANISOTROPIC:
5023 break;
5024 default:
5025 ERR("Unexpected d3d7 mag filter value %#lx.\n", value);
5027 break;
5028 }
5029 break;
5030 }
5031
5032 case D3DTSS_ADDRESS:
5034 break;
5035
5036 default:
5037 break;
5038 }
5039
5040 wined3d_stateblock_set_sampler_state(device->state, stage, l->u.sampler_state, value);
5041 }
5042 else
5043 wined3d_stateblock_set_texture_stage_state(device->update_state, stage, l->u.texture_state, value);
5044
5046
5047 return D3D_OK;
5048}
@ D3DTSS_ADDRESS
Definition: d3dtypes.h:1077

Referenced by d3d_device7_SetTextureStageState_FPUPreserve(), and d3d_device7_SetTextureStageState_FPUSetup().

◆ d3d_device7_SetTextureStageState_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5056 of file device.c.

5058{
5059 HRESULT hr;
5060 WORD old_fpucw;
5061
5062 old_fpucw = d3d_fpu_setup();
5064 set_fpu_control_word(old_fpucw);
5065
5066 return hr;
5067}
static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
Definition: device.c:4958

◆ d3d_device7_SetTextureStageState_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5050 of file device.c.

5052{
5053 return d3d_device7_SetTextureStageState(iface, stage, state, value);
5054}

◆ d3d_device7_SetTransform()

static HRESULT d3d_device7_SetTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3128 of file device.c.

3130{
3132
3133 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3134
3135 if (!matrix)
3136 return DDERR_INVALIDPARAMS;
3137
3138 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3143
3144 return D3D_OK;
3145}

Referenced by d3d_device7_SetTransform_FPUPreserve(), and d3d_device7_SetTransform_FPUSetup().

◆ d3d_device7_SetTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3153 of file device.c.

3155{
3156 HRESULT hr;
3157 WORD old_fpucw;
3158
3159 old_fpucw = d3d_fpu_setup();
3161 set_fpu_control_word(old_fpucw);
3162
3163 return hr;
3164}
static HRESULT d3d_device7_SetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3128

◆ d3d_device7_SetTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX *  matrix 
)
static

Definition at line 3147 of file device.c.

3149{
3150 return d3d_device7_SetTransform(iface, state, matrix);
3151}

◆ d3d_device7_SetViewport()

static HRESULT d3d_device7_SetViewport ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5222 of file device.c.

5223{
5225 struct wined3d_sub_resource_desc rt_desc;
5226 struct wined3d_rendertarget_view *rtv;
5227 struct ddraw_surface *surface;
5228 struct wined3d_viewport vp;
5229
5230 TRACE("iface %p, viewport %p.\n", iface, viewport);
5231
5232 if (!viewport)
5233 return DDERR_INVALIDPARAMS;
5234
5236 rtv = device->target ? ddraw_surface_get_rendertarget_view(device->target) : NULL;
5237 if (!rtv)
5238 {
5240 return DDERR_INVALIDCAPS;
5241 }
5244
5245 if (!wined3d_bound_range(viewport->dwX, viewport->dwWidth, rt_desc.width)
5246 || !wined3d_bound_range(viewport->dwY, viewport->dwHeight, rt_desc.height))
5247 {
5248 WARN("Invalid viewport, returning E_INVALIDARG.\n");
5250 return E_INVALIDARG;
5251 }
5252
5253 vp.x = viewport->dwX;
5254 vp.y = viewport->dwY;
5255 vp.width = viewport->dwWidth;
5256 vp.height = viewport->dwHeight;
5257 vp.min_z = viewport->dvMinZ;
5258 vp.max_z = viewport->dvMaxZ;
5259
5260 wined3d_stateblock_set_viewport(device->update_state, &vp);
5262
5263 return D3D_OK;
5264}
struct wined3d_rendertarget_view * ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface)
Definition: surface.c:7053
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:4055
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:407
void CDECL wined3d_stateblock_set_viewport(struct wined3d_stateblock *stateblock, const struct wined3d_viewport *viewport)
Definition: stateblock.c:1900
static bool wined3d_bound_range(unsigned int start, unsigned int count, unsigned int limit)
Definition: wined3d.h:2995

Referenced by d3d_device7_SetViewport_FPUPreserve(), and d3d_device7_SetViewport_FPUSetup().

◆ d3d_device7_SetViewport_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5271 of file device.c.

5272{
5273 HRESULT hr;
5274 WORD old_fpucw;
5275
5276 old_fpucw = d3d_fpu_setup();
5277 hr = d3d_device7_SetViewport(iface, viewport);
5278 set_fpu_control_word(old_fpucw);
5279
5280 return hr;
5281}
static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
Definition: device.c:5222

◆ d3d_device7_SetViewport_FPUSetup()

static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 *  viewport 
)
static

Definition at line 5266 of file device.c.

5267{
5268 return d3d_device7_SetViewport(iface, viewport);
5269}

◆ d3d_device7_ValidateDevice()

static HRESULT d3d_device7_ValidateDevice ( IDirect3DDevice7 *  iface,
DWORD *  pass_count 
)
static

Definition at line 5113 of file device.c.

5114{
5116 HRESULT hr;
5117
5118 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
5119
5121 hr = wined3d_device_validate_device(device->wined3d_device, device->stateblock_state, pass_count);
5123
5124 return hr;
5125}
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, const struct wined3d_stateblock_state *state, DWORD *num_passes)
Definition: device.c:3963

Referenced by d3d_device7_ValidateDevice_FPUPreserve(), and d3d_device7_ValidateDevice_FPUSetup().

◆ d3d_device7_ValidateDevice_FPUPreserve()

static HRESULT WINAPI d3d_device7_ValidateDevice_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD *  pass_count 
)
static

Definition at line 5132 of file device.c.

5133{
5134 HRESULT hr;
5135 WORD old_fpucw;
5136
5137 old_fpucw = d3d_fpu_setup();
5138 hr = d3d_device7_ValidateDevice(iface, pass_count);
5139 set_fpu_control_word(old_fpucw);
5140
5141 return hr;
5142}
static HRESULT d3d_device7_ValidateDevice(IDirect3DDevice7 *iface, DWORD *pass_count)
Definition: device.c:5113

◆ d3d_device7_ValidateDevice_FPUSetup()

static HRESULT WINAPI d3d_device7_ValidateDevice_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD *  pass_count 
)
static

Definition at line 5127 of file device.c.

5128{
5129 return d3d_device7_ValidateDevice(iface, pass_count);
5130}

◆ d3d_device_apply_state()

void d3d_device_apply_state ( struct d3d_device *  device,
BOOL  clear_state 
)

Definition at line 3454 of file device.c.

3455{
3456 if (device->ddraw && device->ddraw->device_last_applied_state != device)
3457 {
3459 device->ddraw->device_last_applied_state = device;
3460 }
3461 if (clear_state)
3462 wined3d_stateblock_apply_clear_state(device->state, device->wined3d_device);
3463 else
3464 wined3d_device_apply_stateblock(device->wined3d_device, device->state);
3466}
void d3d_device_sync_surfaces(struct d3d_device *device)
Definition: device.c:3427
void CDECL wined3d_stateblock_primary_dirtify_all_states(struct wined3d_device *device, struct wined3d_stateblock *stateblock)
Definition: stateblock.c:313
void CDECL wined3d_stateblock_apply_clear_state(struct wined3d_stateblock *stateblock, struct wined3d_device *device)
Definition: stateblock.c:2917
void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, struct wined3d_stateblock *stateblock)
Definition: stateblock.c:3038

Referenced by d3d_device7_Clear(), d3d_device7_DrawIndexedPrimitive(), d3d_device7_DrawIndexedPrimitiveStrided(), d3d_device7_DrawIndexedPrimitiveVB(), d3d_device7_DrawPrimitive(), d3d_device7_DrawPrimitiveStrided(), and d3d_device7_DrawPrimitiveVB().

◆ d3d_device_create()

HRESULT d3d_device_create ( struct ddraw *  ddraw,
const GUID *  guid,
struct ddraw_surface *  target,
IUnknown *  rt_iface,
UINT  version,
struct d3d_device **  device,
IUnknown *  outer_unknown 
)

Definition at line 6959 of file device.c.

6961{
6962 struct d3d_device *object;
6963 HRESULT hr;
6964
6965 TRACE("ddraw %p, guid %s, target %p, version %u, device %p, outer_unknown %p.\n",
6967
6968 if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
6969 || (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
6970 {
6971 WARN("Surface %p is not a render target.\n", target);
6972 return DDERR_INVALIDCAPS;
6973 }
6974
6976 {
6977 WARN("Surface %p has an indexed pixel format, but no palette.\n", target);
6979 }
6980
6981 if (ddraw->flags & DDRAW_NO3D)
6982 {
6983 ERR_(winediag)("The application wants to create a Direct3D device, "
6984 "but the current DirectDrawRenderer does not support this.\n");
6985
6986 return DDERR_OUTOFMEMORY;
6987 }
6988
6989 if (!(object = calloc(1, sizeof(*object))))
6990 {
6991 ERR("Failed to allocate device memory.\n");
6992 return DDERR_OUTOFMEMORY;
6993 }
6994
6996 {
6997 WARN("Failed to initialize device, hr %#lx.\n", hr);
6998 free(object);
6999 return hr;
7000 }
7001
7002 TRACE("Created device %p.\n", object);
7003 *device = object;
7004
7005 return D3D_OK;
7006}
#define DDRAW_NO3D
Definition: ddraw_private.h:56
static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
Definition: device.c:6858
static const WCHAR version[]
Definition: asmname.c:66
#define DDERR_NOPALETTEATTACHED
Definition: ddraw.h:148
#define ERR_(ch,...)
Definition: debug.h:156
IUnknown * outer_unknown
IUnknown * rt_iface
DWORD flags

Referenced by d3d2_CreateDevice(), d3d3_CreateDevice(), d3d7_CreateDevice(), and ddraw_surface7_QueryInterface().

◆ d3d_device_init()

static HRESULT d3d_device_init ( struct d3d_device *  device,
struct ddraw *  ddraw,
const GUID *  guid,
struct ddraw_surface *  target,
IUnknown *  rt_iface,
UINT  version,
IUnknown *  outer_unknown 
)
static

Definition at line 6858 of file device.c.

6860{
6861 static const struct wined3d_matrix ident =
6862 {
6863 1.0f, 0.0f, 0.0f, 0.0f,
6864 0.0f, 1.0f, 0.0f, 0.0f,
6865 0.0f, 0.0f, 1.0f, 0.0f,
6866 0.0f, 0.0f, 0.0f, 1.0f,
6867 };
6868 struct wined3d_rendertarget_view *rtv;
6869 HRESULT hr;
6870
6872 device->IDirect3DDevice7_iface.lpVtbl = &d3d_device7_fpu_preserve_vtbl;
6873 else
6874 device->IDirect3DDevice7_iface.lpVtbl = &d3d_device7_fpu_setup_vtbl;
6875
6876 device->IDirect3DDevice3_iface.lpVtbl = &d3d_device3_vtbl;
6877 device->IDirect3DDevice2_iface.lpVtbl = &d3d_device2_vtbl;
6878 device->IDirect3DDevice_iface.lpVtbl = &d3d_device1_vtbl;
6879 device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
6880 device->ref = 1;
6881 device->version = version;
6882 device->hardware_device = IsEqualGUID(&IID_IDirect3DTnLHalDevice, guid)
6883 || IsEqualGUID(&IID_IDirect3DHALDevice, guid);
6884
6885 if (device->hardware_device && !(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
6886 {
6887 WARN("Surface %p is not in video memory.\n", target);
6889 }
6890
6891 if (outer_unknown)
6892 device->outer_unknown = outer_unknown;
6893 else
6894 device->outer_unknown = &device->IUnknown_inner;
6895
6896 device->ddraw = ddraw;
6897 list_init(&device->viewport_list);
6898
6899 if (!ddraw_handle_table_init(&device->handle_table, 64))
6900 {
6901 ERR("Failed to initialize handle table.\n");
6902 return DDERR_OUTOFMEMORY;
6903 }
6904
6905 device->legacyTextureBlending = FALSE;
6906 device->legacy_projection = ident;
6907 device->legacy_clipspace = ident;
6908
6910 {
6911 ERR("Failed to create the primary stateblock, hr %#lx.\n", hr);
6912 ddraw_handle_table_destroy(&device->handle_table);
6913 return hr;
6914 }
6915 device->stateblock_state = wined3d_stateblock_get_state(device->state);
6916 device->update_state = device->state;
6917
6918 /* This is for convenience. */
6919 device->wined3d_device = ddraw->wined3d_device;
6920 device->immediate_context = ddraw->immediate_context;
6922
6925
6926 /* Render to the back buffer */
6928 if (FAILED(hr = wined3d_device_context_set_rendertarget_views(device->immediate_context, 0, 1, &rtv, TRUE)))
6929 {
6930 ERR("Failed to set render target, hr %#lx.\n", hr);
6932 ddraw_handle_table_destroy(&device->handle_table);
6933 return hr;
6934 }
6935
6936 device->rt_iface = rt_iface;
6937 device->target = target;
6938 if (version != 1)
6939 IUnknown_AddRef(device->rt_iface);
6940
6941 list_add_head(&ddraw->d3ddevice_list, &device->ddraw_entry);
6942
6945 if (version == 1) /* Color keying is initially enabled for version 1 devices. */
6947 else if (version == 2)
6949 if (version < 7)
6950 {
6952 IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface,
6954 }
6956 return D3D_OK;
6957}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define D3DERR_SURFACENOTINVIDMEM
Definition: d3d.h:147
void ddraw_handle_table_destroy(struct ddraw_handle_table *t)
Definition: main.c:132
BOOL ddraw_handle_table_init(struct ddraw_handle_table *t, UINT initial_size)
Definition: main.c:118
static void device_reset_viewport_state(struct d3d8_device *device)
Definition: device.c:559
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
Definition: device.c:6612
static const struct IDirect3DDeviceVtbl d3d_device1_vtbl
Definition: device.c:6754
static const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
Definition: device.c:6715
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device)
Definition: device.c:6817
static const struct IUnknownVtbl d3d_device_inner_vtbl
Definition: device.c:6782
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
Definition: device.c:6557
static const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
Definition: device.c:6667
HRESULT CDECL wined3d_device_context_set_rendertarget_views(struct wined3d_device_context *context, unsigned int start_idx, unsigned int count, struct wined3d_rendertarget_view *const *views, BOOL set_viewport)
Definition: device.c:2377
ULONG CDECL wined3d_device_incref(struct wined3d_device *device)
Definition: device.c:161
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define DDSCL_FPUPRESERVE
Definition: ddraw.h:545
struct wined3d_device * wined3d_device
Definition: ddraw_private.h:99
struct wined3d_device_context * immediate_context
DWORD cooperative_level
struct list d3ddevice_list
_In_ ULONG _In_ ULONG_PTR ident
Definition: winddi.h:3994
const struct wined3d_stateblock_state *CDECL wined3d_stateblock_get_state(const struct wined3d_stateblock *stateblock)
Definition: stateblock.c:2064
@ WINED3D_SBT_PRIMARY
Definition: wined3d.h:791
@ WINED3D_RS_COLORKEYENABLE
Definition: wined3d.h:323
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:293
@ WINED3D_RS_NORMALIZENORMALS
Definition: wined3d.h:353
@ WINED3D_RS_SPECULARENABLE
Definition: wined3d.h:312
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:909
static void wined3d_streaming_buffer_init(struct wined3d_streaming_buffer *buffer, unsigned int bind_flags)
Definition: wined3d.h:2937
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:910

◆ d3d_device_inner_AddRef()

static ULONG WINAPI d3d_device_inner_AddRef ( IUnknown *  iface)
static

Definition at line 214 of file device.c.

215{
216 struct d3d_device *device = impl_from_IUnknown(iface);
218
219 TRACE("%p increasing refcount to %lu.\n", device, ref);
220
221 return ref;
222}
#define InterlockedIncrement
Definition: armddk.h:53
static struct d2d_device_context * impl_from_IUnknown(IUnknown *iface)
Definition: device.c:207

◆ d3d_device_inner_QueryInterface()

static HRESULT WINAPI d3d_device_inner_QueryInterface ( IUnknown *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 120 of file device.c.

121{
122 struct d3d_device *device = impl_from_IUnknown(iface);
123
124 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
125
126 if (!riid)
127 {
128 *out = NULL;
129 return DDERR_INVALIDPARAMS;
130 }
131
133 {
134 IDirect3DDevice7_AddRef(&device->IDirect3DDevice7_iface);
135 *out = &device->IDirect3DDevice7_iface;
136 return S_OK;
137 }
138
139 if (device->version == 7)
140 {
141 if (IsEqualGUID(&IID_IDirect3DDevice7, riid))
142 {
143 IDirect3DDevice7_AddRef(&device->IDirect3DDevice7_iface);
144 *out = &device->IDirect3DDevice7_iface;
145 return S_OK;
146 }
147 }
148 else
149 {
150 if (IsEqualGUID(&IID_IDirect3DDevice3, riid) && device->version == 3)
151 {
152 IDirect3DDevice3_AddRef(&device->IDirect3DDevice3_iface);
153 *out = &device->IDirect3DDevice3_iface;
154 return S_OK;
155 }
156
157 if (IsEqualGUID(&IID_IDirect3DDevice2, riid) && device->version >= 2)
158 {
159 IDirect3DDevice2_AddRef(&device->IDirect3DDevice2_iface);
160 *out = &device->IDirect3DDevice2_iface;
161 return S_OK;
162 }
163
164 if (IsEqualGUID(&IID_IDirect3DDevice, riid))
165 {
166 IDirect3DDevice_AddRef(&device->IDirect3DDevice_iface);
167 *out = &device->IDirect3DDevice_iface;
168 return S_OK;
169 }
170 }
171
172 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
173
174 *out = NULL;
175 return E_NOINTERFACE;
176}
const GUID IID_IUnknown
#define IDirect3DDevice2_AddRef(p)
Definition: d3d.h:1063
#define IDirect3DDevice_AddRef(p)
Definition: d3d.h:965
#define IDirect3DDevice3_AddRef(p)
Definition: d3d.h:1191
#define IDirect3DDevice7_AddRef(p)
Definition: d3d.h:1343
#define S_OK
Definition: intsafe.h:52
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ d3d_device_inner_Release()

static ULONG WINAPI d3d_device_inner_Release ( IUnknown *  iface)
static

Definition at line 260 of file device.c.

261{
262 struct d3d_device *This = impl_from_IUnknown(iface);
265
266 TRACE("%p decreasing refcount to %lu.\n", This, ref);
267
268 /* This method doesn't destroy the wined3d device, because it's still in
269 * use for 2D rendering. IDirectDrawSurface7::Release will destroy the
270 * wined3d device when the render target is released. */
271 if (!ref)
272 {
273 static struct wined3d_rendertarget_view *const null_rtv;
274 DWORD i;
275 struct list *vp_entry, *vp_entry2;
276
278
279 /* There is no need to unset any resources here, wined3d will take
280 * care of that on uninit_3d(). */
281
283 wined3d_streaming_buffer_cleanup(&This->vertex_buffer);
284
285 wined3d_device_context_set_rendertarget_views(This->immediate_context, 0, 1, &null_rtv, FALSE);
286
287 /* Release the wined3d device. This won't destroy it. */
288 if (!wined3d_device_decref(This->wined3d_device))
289 ERR("The wined3d device (%p) was destroyed unexpectedly.\n", This->wined3d_device);
290
291 /* The texture handles should be unset by now, but there might be some bits
292 * missing in our reference counting(needs test). Do a sanity check. */
293 for (i = 0; i < This->handle_table.entry_count; ++i)
294 {
295 struct ddraw_handle_entry *entry = &This->handle_table.entries[i];
296
297 switch (entry->type)
298 {
300 break;
301
303 {
304 /* No FIXME here because this might happen because of sloppy applications. */
305 WARN("Leftover stateblock handle %#lx (%p), deleting.\n", i + 1, entry->object);
306 IDirect3DDevice7_DeleteStateBlock(&This->IDirect3DDevice7_iface, i + 1);
307 break;
308 }
309
310 default:
311 FIXME("Handle %#lx (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type);
312 break;
313 }
314 }
315
316 ddraw_handle_table_destroy(&This->handle_table);
317
318 LIST_FOR_EACH_SAFE(vp_entry, vp_entry2, &This->viewport_list)
319 {
320 struct d3d_viewport *vp = LIST_ENTRY(vp_entry, struct d3d_viewport, entry);
321 IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
322 }
323
325 if (This->recording)
327
328 /* Releasing the render target below may release the last reference to the ddraw object. Detach
329 * the device from it before so it doesn't try to save / restore state on the teared down device. */
330 if (This->ddraw)
331 {
332 if (This->ddraw->device_last_applied_state == This)
333 This->ddraw->device_last_applied_state = NULL;
334 list_remove(&This->ddraw_entry);
335 This->ddraw = NULL;
336 }
337
338 TRACE("Releasing render target %p.\n", This->rt_iface);
339 rt_iface = This->rt_iface;
340 This->rt_iface = NULL;
341 This->target = NULL;
342 This->target_ds = NULL;
343 if (This->version != 1)
344 IUnknown_Release(rt_iface);
345 TRACE("Render target release done.\n");
346
347 /* Now free the structure */
348 free(This);
350 }
351
352 TRACE("Done\n");
353 return ref;
354}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DDevice3_DeleteViewport(p, a)
Definition: d3d.h:1197
#define IDirect3DDevice7_DeleteStateBlock(p, a)
Definition: d3d.h:1384
@ DDRAW_HANDLE_FREE
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:251
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:230
static void wined3d_streaming_buffer_cleanup(struct wined3d_streaming_buffer *buffer)
Definition: wined3d.h:2943

◆ d3d_device_set_render_target()

static HRESULT d3d_device_set_render_target ( struct d3d_device *  device,
struct ddraw_surface *  target,
IUnknown *  rt_iface 
)
static

Definition at line 1836 of file device.c.

1838{
1839 struct wined3d_rendertarget_view *rtv;
1840 HRESULT hr;
1841
1842 if (device->rt_iface == rt_iface)
1843 {
1844 TRACE("No-op SetRenderTarget operation, not doing anything\n");
1845 return D3D_OK;
1846 }
1847 if (!target)
1848 {
1849 WARN("Trying to set render target to NULL.\n");
1850 return DDERR_INVALIDPARAMS;
1851 }
1852
1854 if (FAILED(hr = wined3d_device_context_set_rendertarget_views(device->immediate_context, 0, 1, &rtv, FALSE)))
1855 return hr;
1856
1857 IUnknown_AddRef(rt_iface);
1858 IUnknown_Release(device->rt_iface);
1859 device->rt_iface = rt_iface;
1860 device->target = target;
1862
1863 return D3D_OK;
1864}

Referenced by d3d_device2_SetRenderTarget(), d3d_device3_SetRenderTarget(), and d3d_device7_SetRenderTarget().

◆ d3d_device_sync_rendertarget()

static void d3d_device_sync_rendertarget ( struct d3d_device *  device)
static

Definition at line 3392 of file device.c.

3393{
3394 struct wined3d_rendertarget_view *rtv, *dsv;
3395
3396 rtv = device->target ? ddraw_surface_get_rendertarget_view(device->target) : NULL;
3397 if (rtv)
3398 {
3399 if (FAILED(wined3d_device_context_set_rendertarget_views(device->immediate_context, 0, 1, &rtv, FALSE)))
3400 ERR("wined3d_device_context_set_rendertarget_views failed.\n");
3401 }
3402 else if (!device->target)
3403 {
3404 /* NULL device->target may appear when the game was setting invalid render target which in some cases
3405 * still keeps the invalid render target in the device even while returning an error.
3406 *
3407 * TODO: make render go nowhere instead of lefover render target (like it seems to work on Windows on HW devices
3408 * while may just crash on software devices. */
3409 FIXME("Keeping leftover render target.\n");
3410 }
3411
3412 dsv = device->target_ds ? ddraw_surface_get_rendertarget_view(device->target_ds) : NULL;
3413 if (FAILED(wined3d_device_context_set_depth_stencil_view(device->immediate_context, dsv)))
3414 ERR("wined3d_device_context_set_depth_stencil_view failed.\n");
3416
3417 if (device->hardware_device)
3418 return;
3419
3420 if (rtv)
3422
3423 if (dsv)
3425}
static struct wined3d_texture * ddraw_surface_get_draw_texture(struct ddraw_surface *surface, unsigned int flags)
HRESULT CDECL wined3d_device_context_set_depth_stencil_view(struct wined3d_device_context *context, struct wined3d_rendertarget_view *view)
Definition: device.c:2453
void *CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:400
void CDECL wined3d_stateblock_depth_buffer_changed(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:4043

Referenced by d3d_device_sync_surfaces().

◆ d3d_device_sync_surfaces()

void d3d_device_sync_surfaces ( struct d3d_device *  device)

Definition at line 3427 of file device.c.

3428{
3429 const struct wined3d_stateblock_state *state = device->stateblock_state;
3430 struct ddraw_surface *surface;
3431 unsigned int i, j;
3432
3434
3435 if (!device->have_draw_textures)
3436 return;
3437
3438 for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
3439 {
3440 if (!state->textures[i])
3441 continue;
3442
3443 j = 0;
3444 while ((surface = wined3d_texture_get_sub_resource_parent(state->textures[i], j)))
3445 {
3446 if (!surface->draw_texture)
3447 break;
3449 ++j;
3450 }
3451 }
3452}
static void d3d_device_sync_rendertarget(struct d3d_device *device)
Definition: device.c:3392
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:4033

Referenced by d3d_device_apply_state().

◆ d3d_device_update_depth_stencil()

enum wined3d_depth_buffer_type d3d_device_update_depth_stencil ( struct d3d_device *  device)

Definition at line 6817 of file device.c.

6818{
6819 IDirectDrawSurface7 *depthStencil = NULL;
6820 IDirectDrawSurface7 *render_target;
6821 static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, {0} };
6822
6823 if (device->rt_iface && SUCCEEDED(IUnknown_QueryInterface(device->rt_iface,
6824 &IID_IDirectDrawSurface7, (void **)&render_target)))
6825 {
6826 IDirectDrawSurface7_GetAttachedSurface(render_target, &depthcaps, &depthStencil);
6827 IDirectDrawSurface7_Release(render_target);
6828 }
6829 if (!depthStencil)
6830 {
6831 TRACE("Setting wined3d depth stencil to NULL\n");
6834 device->target_ds = NULL;
6835 return WINED3D_ZB_FALSE;
6836 }
6837
6838 device->target_ds = impl_from_IDirectDrawSurface7(depthStencil);
6842
6843 IDirectDrawSurface7_Release(depthStencil);
6844 return WINED3D_ZB_TRUE;
6845}
@ WINED3D_ZB_TRUE
Definition: wined3d.h:474
@ WINED3D_ZB_FALSE
Definition: wined3d.h:473

Referenced by d3d_device_init(), d3d_device_set_render_target(), and ddraw_surface_attach_surface().

◆ d3d_fpu_setup()

static WORD d3d_fpu_setup ( void  )
inlinestatic

Definition at line 52 of file device.c.

53{
54 WORD oldcw;
55
56#if defined(__i386__) && defined(_MSC_VER)
57 __asm fnstcw oldcw;
58#elif defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__) && (defined(__GNUC__) || defined(__clang__)))
59 __asm__ volatile ("fnstcw %0" : "=m" (oldcw));
60#else
61 static BOOL warned = FALSE;
62 if(!warned)
63 {
64 FIXME("FPUPRESERVE not implemented for this platform / compiler\n");
65 warned = TRUE;
66 }
67 return 0;
68#endif
69
71
72 return oldcw;
73}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tpush %rbx\n" "\t.seh_pushreg %rbx\n" "\tpush %rdi\n" "\t.seh_pushreg %rdi\n" "\tpush %rsi\n" "\t.seh_pushreg %rsi\n" "\tpush %r12\n" "\t.seh_pushreg %r12\n" "\tpush %r13\n" "\t.seh_pushreg %r13\n" "\tpush %r14\n" "\t.seh_pushreg %r14\n" "\tpush %r15\n" "\t.seh_pushreg %r15\n" "\tsub $40, %rsp\n" "\t.seh_stackalloc 40\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $40, %rsp\n" "\tpop %r15\n" "\tpop %r14\n" "\tpop %r13\n" "\tpop %r12\n" "\tpop %rsi\n" "\tpop %rdi\n" "\tpop %rbx\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), d3d_device7_BeginScene_FPUPreserve(), d3d_device7_BeginStateBlock_FPUPreserve(), d3d_device7_CaptureStateBlock_FPUPreserve(), d3d_device7_Clear_FPUPreserve(), d3d_device7_CreateStateBlock_FPUPreserve(), d3d_device7_DeleteStateBlock_FPUPreserve(), d3d_device7_DrawIndexedPrimitive_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), d3d_device7_DrawPrimitive_FPUPreserve(), d3d_device7_DrawPrimitiveStrided_FPUPreserve(), d3d_device7_DrawPrimitiveVB_FPUPreserve(), d3d_device7_EndScene_FPUPreserve(), d3d_device7_EndStateBlock_FPUPreserve(), d3d_device7_EnumTextureFormats_FPUPreserve(), d3d_device7_GetCaps_FPUPreserve(), d3d_device7_GetClipPlane_FPUPreserve(), d3d_device7_GetLight_FPUPreserve(), d3d_device7_GetLightEnable_FPUPreserve(), d3d_device7_GetMaterial_FPUPreserve(), d3d_device7_GetRenderState_FPUPreserve(), d3d_device7_GetTexture_FPUPreserve(), d3d_device7_GetTextureStageState_FPUPreserve(), d3d_device7_GetTransform_FPUPreserve(), d3d_device7_GetViewport_FPUPreserve(), d3d_device7_LightEnable_FPUPreserve(), d3d_device7_Load_FPUPreserve(), d3d_device7_MultiplyTransform_FPUPreserve(), d3d_device7_PreLoad_FPUPreserve(), d3d_device7_SetClipPlane_FPUPreserve(), d3d_device7_SetLight_FPUPreserve(), d3d_device7_SetMaterial_FPUPreserve(), d3d_device7_SetRenderState_FPUPreserve(), d3d_device7_SetRenderTarget_FPUPreserve(), d3d_device7_SetTexture_FPUPreserve(), d3d_device7_SetTextureStageState_FPUPreserve(), d3d_device7_SetTransform_FPUPreserve(), d3d_device7_SetViewport_FPUPreserve(), and d3d_device7_ValidateDevice_FPUPreserve().

◆ device_reset_viewport_state()

static void device_reset_viewport_state ( struct d3d_device *  device)
static

Definition at line 6847 of file device.c.

6848{
6849 struct wined3d_viewport vp;
6850 RECT rect;
6851
6852 wined3d_device_context_get_viewports(device->immediate_context, NULL, &vp);
6856}
void CDECL wined3d_device_context_get_scissor_rects(const struct wined3d_device_context *context, unsigned int *rect_count, RECT *rects)
Definition: device.c:1890
void CDECL wined3d_device_context_get_viewports(const struct wined3d_device_context *context, unsigned int *viewport_count, struct wined3d_viewport *viewports)
Definition: device.c:1844
void CDECL wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect)
Definition: stateblock.c:1910

◆ fixup_texture_alpha_op()

static void fixup_texture_alpha_op ( struct d3d_device *  device)
static

Definition at line 2697 of file device.c.

2698{
2699 /* This fixup is required by the way D3DTBLEND_MODULATE maps to texture stage states.
2700 See d3d_device3_SetRenderState() for details. */
2701 struct wined3d_texture *tex;
2702 BOOL tex_alpha = TRUE;
2703 DDPIXELFORMAT ddfmt;
2704
2705 if (!(device->legacyTextureBlending && device->texture_map_blend == D3DTBLEND_MODULATE))
2706 return;
2707
2708 if ((tex = device->stateblock_state->textures[0]))
2709 {
2711
2713 ddfmt.dwSize = sizeof(ddfmt);
2714 ddrawformat_from_wined3dformat(&ddfmt, desc.format);
2715 if (!ddfmt.dwRGBAlphaBitMask)
2716 tex_alpha = FALSE;
2717 }
2718
2719 /* Args 1 and 2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */
2722}
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:280
DWORD dwRGBAlphaBitMask
Definition: ddraw.h:1115

Referenced by d3d_device3_SetRenderState(), and d3d_device3_SetTexture().

◆ impl_from_IUnknown()

static struct d3d_device * impl_from_IUnknown ( IUnknown *  iface)
inlinestatic

Definition at line 115 of file device.c.

116{
117 return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner);
118}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ in_plane()

static DWORD in_plane ( UINT  idx,
struct wined3d_vec4  p,
D3DVECTOR  center,
D3DVALUE  radius,
BOOL  equality 
)
static

Definition at line 4412 of file device.c.

4413{
4414 float distance, norm;
4415
4416 norm = sqrtf(p.x * p.x + p.y * p.y + p.z * p.z);
4417 distance = (p.x * center.x + p.y * center.y + p.z * center.z + p.w) / norm;
4418
4419 if (equality)
4420 {
4421 if (fabs(distance) <= radius)
4422 return D3DSTATUS_CLIPUNIONLEFT << idx;
4423 if (distance <= -radius)
4425 }
4426 else
4427 {
4428 if (fabs(distance) < radius)
4429 return D3DSTATUS_CLIPUNIONLEFT << idx;
4430 if (distance < -radius)
4432 }
4433 return 0;
4434}
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
_ACRTIMP double __cdecl fabs(double)
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
GLfloat GLfloat p
Definition: glext.h:8902
#define sqrtf(x)
Definition: mymath.h:59

Referenced by compute_sphere_visibility().

◆ is_mip_level_subset()

static BOOL is_mip_level_subset ( struct ddraw_surface *  dest,
struct ddraw_surface *  src 
)
static

Definition at line 5950 of file device.c.

5951{
5952 struct ddraw_surface *src_level, *dest_level;
5954 DDSURFACEDESC2 ddsd;
5955 BOOL levelFound; /* at least one suitable sublevel in dest found */
5956
5957 /* To satisfy "destination is mip level subset of source" criteria (regular texture counts as 1 level),
5958 * 1) there must be at least one mip level in destination that matched dimensions of some mip level in source and
5959 * 2) there must be no destination levels that don't match any levels in source. Otherwise it's INVALIDPARAMS.
5960 */
5961 levelFound = FALSE;
5962
5963 src_level = src;
5964 dest_level = dest;
5965
5966 for (;src_level && dest_level;)
5967 {
5968 if (src_level->surface_desc.dwWidth == dest_level->surface_desc.dwWidth &&
5969 src_level->surface_desc.dwHeight == dest_level->surface_desc.dwHeight)
5970 {
5971 levelFound = TRUE;
5972
5975 IDirectDrawSurface7_GetAttachedSurface(&dest_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
5976
5977 if (dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface);
5978
5980 }
5981
5984 IDirectDrawSurface7_GetAttachedSurface(&src_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
5985
5986 if (src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
5987
5989 }
5990
5991 if (src_level && src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
5992 if (dest_level && dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface);
5993
5994 return !dest_level && levelFound;
5995}

Referenced by d3d_device7_Load().

◆ pack_strided_data()

static void pack_strided_data ( BYTE *  dst,
DWORD  count,
const D3DDRAWPRIMITIVESTRIDEDDATA *  src,
DWORD  fvf 
)
static

Definition at line 3875 of file device.c.

3876{
3877 DWORD i, tex, offset;
3878
3879 for (i = 0; i < count; i++)
3880 {
3881 /* The contents of the strided data are determined by the fvf,
3882 * not by the members set in src. So it's valid
3883 * to have diffuse.lpvData set to 0xdeadbeef if the diffuse flag is
3884 * not set in the fvf. */
3885 if (fvf & D3DFVF_POSITION_MASK)
3886 {
3887 offset = i * src->position.dwStride;
3888 if (fvf & D3DFVF_XYZRHW)
3889 {
3890 memcpy(dst, ((BYTE *)src->position.lpvData) + offset, 4 * sizeof(float));
3891 dst += 4 * sizeof(float);
3892 }
3893 else
3894 {
3895 memcpy(dst, ((BYTE *)src->position.lpvData) + offset, 3 * sizeof(float));
3896 dst += 3 * sizeof(float);
3897 }
3898 }
3899
3900 if (fvf & D3DFVF_NORMAL)
3901 {
3902 offset = i * src->normal.dwStride;
3903 memcpy(dst, ((BYTE *)src->normal.lpvData) + offset, 3 * sizeof(float));
3904 dst += 3 * sizeof(float);
3905 }
3906
3907 if (fvf & D3DFVF_DIFFUSE)
3908 {
3909 offset = i * src->diffuse.dwStride;
3910 memcpy(dst, ((BYTE *)src->diffuse.lpvData) + offset, sizeof(DWORD));
3911 dst += sizeof(DWORD);
3912 }
3913
3914 if (fvf & D3DFVF_SPECULAR)
3915 {
3916 offset = i * src->specular.dwStride;
3917 memcpy(dst, ((BYTE *)src->specular.lpvData) + offset, sizeof(DWORD));
3918 dst += sizeof(DWORD);
3919 }
3920
3921 for (tex = 0; tex < GET_TEXCOUNT_FROM_FVF(fvf); ++tex)
3922 {
3923 DWORD attrib_count = GET_TEXCOORD_SIZE_FROM_FVF(fvf, tex);
3924 offset = i * src->textureCoords[tex].dwStride;
3925 memcpy(dst, ((BYTE *)src->textureCoords[tex].lpvData) + offset, attrib_count * sizeof(float));
3926 dst += attrib_count * sizeof(float);
3927 }
3928 }
3929}
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num)
#define GET_TEXCOUNT_FROM_FVF(d3dvtVertexType)
GLintptr offset
Definition: glext.h:5920
static float(__cdecl *square_half_float)(float x
#define DWORD
Definition: nt_native.h:44

Referenced by d3d_device7_DrawIndexedPrimitiveStrided(), and d3d_device7_DrawPrimitiveStrided().

◆ prepare_clip_space_planes()

static void prepare_clip_space_planes ( struct d3d_device *  device,
struct wined3d_vec4 *  plane 
)
static

Definition at line 4436 of file device.c.

4437{
4438 const struct wined3d_stateblock_state *state;
4439 struct wined3d_matrix m;
4440
4441 /* We want the wined3d matrices since those include the legacy viewport
4442 * transformation. */
4444 state = device->stateblock_state;
4445 multiply_matrix(&m, &state->transforms[WINED3D_TS_VIEW], &state->transforms[WINED3D_TS_WORLD]);
4446 multiply_matrix(&m, &state->transforms[WINED3D_TS_PROJECTION], &m);
4448
4449 /* Left plane. */
4450 plane[0].x = m._14 + m._11;
4451 plane[0].y = m._24 + m._21;
4452 plane[0].z = m._34 + m._31;
4453 plane[0].w = m._44 + m._41;
4454
4455 /* Right plane. */
4456 plane[1].x = m._14 - m._11;
4457 plane[1].y = m._24 - m._21;
4458 plane[1].z = m._34 - m._31;
4459 plane[1].w = m._44 - m._41;
4460
4461 /* Top plane. */
4462 plane[2].x = m._14 - m._12;
4463 plane[2].y = m._24 - m._22;
4464 plane[2].z = m._34 - m._32;
4465 plane[2].w = m._44 - m._42;
4466
4467 /* Bottom plane. */
4468 plane[3].x = m._14 + m._12;
4469 plane[3].y = m._24 + m._22;
4470 plane[3].z = m._34 + m._32;
4471 plane[3].w = m._44 + m._42;
4472
4473 /* Front plane. */
4474 plane[4].x = m._13;
4475 plane[4].y = m._23;
4476 plane[4].z = m._33;
4477 plane[4].w = m._43;
4478
4479 /* Back plane. */
4480 plane[5].x = m._14 - m._13;
4481 plane[5].y = m._24 - m._23;
4482 plane[5].z = m._34 - m._33;
4483 plane[5].w = m._44 - m._43;
4484}
@ WINED3D_TS_WORLD
Definition: wined3d.h:677

Referenced by d3d_device3_ComputeSphereVisibility(), and d3d_device7_ComputeSphereVisibility().

◆ set_fpu_control_word()

static void set_fpu_control_word ( WORD  fpucw)
inlinestatic

Definition at line 43 of file device.c.

44{
45#if defined(__i386__) && defined(_MSC_VER)
46 __asm fldcw fpucw;
47#elif defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__) && (defined(__GNUC__) || defined(__clang__)))
48 __asm__ volatile ("fldcw %0" : : "m" (fpucw));
49#endif
50}

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), d3d_device7_BeginScene_FPUPreserve(), d3d_device7_BeginStateBlock_FPUPreserve(), d3d_device7_CaptureStateBlock_FPUPreserve(), d3d_device7_Clear_FPUPreserve(), d3d_device7_CreateStateBlock_FPUPreserve(), d3d_device7_DeleteStateBlock_FPUPreserve(), d3d_device7_DrawIndexedPrimitive_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), d3d_device7_DrawPrimitive_FPUPreserve(), d3d_device7_DrawPrimitiveStrided_FPUPreserve(), d3d_device7_DrawPrimitiveVB_FPUPreserve(), d3d_device7_EndScene_FPUPreserve(), d3d_device7_EndStateBlock_FPUPreserve(), d3d_device7_EnumTextureFormats_FPUPreserve(), d3d_device7_GetCaps_FPUPreserve(), d3d_device7_GetClipPlane_FPUPreserve(), d3d_device7_GetLight_FPUPreserve(), d3d_device7_GetLightEnable_FPUPreserve(), d3d_device7_GetMaterial_FPUPreserve(), d3d_device7_GetRenderState_FPUPreserve(), d3d_device7_GetTexture_FPUPreserve(), d3d_device7_GetTextureStageState_FPUPreserve(), d3d_device7_GetTransform_FPUPreserve(), d3d_device7_GetViewport_FPUPreserve(), d3d_device7_LightEnable_FPUPreserve(), d3d_device7_Load_FPUPreserve(), d3d_device7_MultiplyTransform_FPUPreserve(), d3d_device7_PreLoad_FPUPreserve(), d3d_device7_SetClipPlane_FPUPreserve(), d3d_device7_SetLight_FPUPreserve(), d3d_device7_SetMaterial_FPUPreserve(), d3d_device7_SetRenderState_FPUPreserve(), d3d_device7_SetRenderTarget_FPUPreserve(), d3d_device7_SetTexture_FPUPreserve(), d3d_device7_SetTextureStageState_FPUPreserve(), d3d_device7_SetTransform_FPUPreserve(), d3d_device7_SetViewport_FPUPreserve(), d3d_device7_ValidateDevice_FPUPreserve(), and d3d_fpu_setup().

◆ setup_lighting()

static void setup_lighting ( const struct d3d_device *  device,
DWORD  fvf,
DWORD  flags 
)
static

Definition at line 3531 of file device.c.

3532{
3533 BOOL enable = TRUE;
3534
3535 /* Ignore the D3DFVF_XYZRHW case here, wined3d takes care of that */
3536 if (!device->material || !(fvf & D3DFVF_NORMAL) || (flags & D3DDP_DONOTLIGHT))
3537 enable = FALSE;
3538
3540}
#define D3DDP_DONOTLIGHT
Definition: d3d.h:200
GLboolean enable
Definition: glext.h:11120
@ WINED3D_RS_LIGHTING
Definition: wined3d.h:347

Referenced by d3d_device3_DrawIndexedPrimitive(), d3d_device3_DrawIndexedPrimitiveStrided(), d3d_device3_DrawIndexedPrimitiveVB(), d3d_device3_DrawPrimitive(), d3d_device3_DrawPrimitiveStrided(), and d3d_device3_DrawPrimitiveVB().

◆ unsafe_impl_from_IDirect3DDevice()

struct d3d_device * unsafe_impl_from_IDirect3DDevice ( IDirect3DDevice *  iface)

Definition at line 6810 of file device.c.

6811{
6812 if (!iface) return NULL;
6813 assert(iface->lpVtbl == &d3d_device1_vtbl);
6814 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice_iface);
6815}
#define assert(_expr)
Definition: assert.h:32

Referenced by d3d_material1_GetHandle(), and d3d_texture1_GetHandle().

◆ unsafe_impl_from_IDirect3DDevice2()

struct d3d_device * unsafe_impl_from_IDirect3DDevice2 ( IDirect3DDevice2 *  iface)

Definition at line 6803 of file device.c.

6804{
6805 if (!iface) return NULL;
6806 assert(iface->lpVtbl == &d3d_device2_vtbl);
6807 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice2_iface);
6808}

Referenced by d3d_material2_GetHandle().

◆ unsafe_impl_from_IDirect3DDevice3()

struct d3d_device * unsafe_impl_from_IDirect3DDevice3 ( IDirect3DDevice3 *  iface)

Definition at line 6796 of file device.c.

6797{
6798 if (!iface) return NULL;
6799 assert(iface->lpVtbl == &d3d_device3_vtbl);
6800 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice3_iface);
6801}

Referenced by d3d_material3_GetHandle(), and d3d_vertex_buffer7_ProcessVertices().

◆ unsafe_impl_from_IDirect3DDevice7()

struct d3d_device * unsafe_impl_from_IDirect3DDevice7 ( IDirect3DDevice7 *  iface)

Definition at line 6789 of file device.c.

6790{
6791 if (!iface) return NULL;
6792 assert((iface->lpVtbl == &d3d_device7_fpu_preserve_vtbl) || (iface->lpVtbl == &d3d_device7_fpu_setup_vtbl));
6793 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice7_iface);
6794}

Referenced by d3d_vertex_buffer7_ProcessVertices().

◆ validate_surface_palette()

static BOOL validate_surface_palette ( struct ddraw_surface *  surface)
static

Definition at line 1830 of file device.c.

1831{
1833 || surface->palette;
1834}
static BOOL format_is_paletteindexed(const DDPIXELFORMAT *fmt)
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1187
struct ddraw_palette * palette

Referenced by d3d_device2_SetRenderTarget(), d3d_device3_SetRenderTarget(), d3d_device7_SetRenderTarget(), and d3d_device_create().

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( winediag  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ddraw  )

◆ wined3d_primitive_type_from_ddraw()

◆ wined3d_render_state_from_ddraw()

static enum wined3d_render_state wined3d_render_state_from_ddraw ( D3DRENDERSTATETYPE  state)
static

Definition at line 75 of file device.c.

76{
77 switch (state)
78 {
83 default:
84 return (enum wined3d_render_state)state;
85 }
86}
#define D3DRENDERSTATE_ZBIAS
Definition: dx7todx8.h:78
#define D3DRENDERSTATE_EDGEANTIALIAS
Definition: dx7todx8.h:39
wined3d_render_state
Definition: wined3d.h:288
@ WINED3D_RS_ANTIALIASEDLINEENABLE
Definition: wined3d.h:383
@ WINED3D_RS_DEPTHBIAS
Definition: wined3d.h:401

Referenced by d3d_device7_GetRenderState(), and d3d_device7_SetRenderState().

◆ wined3d_stateblock_type_from_ddraw()

static enum wined3d_stateblock_type wined3d_stateblock_type_from_ddraw ( D3DSTATEBLOCKTYPE  type)
static

Definition at line 110 of file device.c.

111{
112 return (enum wined3d_stateblock_type)type;
113}
wined3d_stateblock_type
Definition: wined3d.h:786

Referenced by d3d_device7_CreateStateBlock().

◆ wined3d_transform_state_from_ddraw()

static enum wined3d_transform_state wined3d_transform_state_from_ddraw ( D3DTRANSFORMSTATETYPE  state)
static

Definition at line 88 of file device.c.

89{
90 switch (state)
91 {
100 default:
101 return (enum wined3d_transform_state)state;
102 }
103}
#define D3DTRANSFORMSTATE_WORLD2
Definition: dx7todx8.h:24
#define D3DTRANSFORMSTATE_WORLD1
Definition: dx7todx8.h:23
#define D3DTRANSFORMSTATE_WORLD
Definition: dx7todx8.h:22
#define D3DTRANSFORMSTATE_WORLD3
Definition: dx7todx8.h:25
wined3d_transform_state
Definition: wined3d.h:666

Referenced by d3d_device7_GetTransform(), d3d_device7_MultiplyTransform(), and d3d_device7_SetTransform().

Variable Documentation

◆ d3d_device1_vtbl

const struct IDirect3DDeviceVtbl d3d_device1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d_device1_GetStats(IDirect3DDevice *iface, D3DSTATS *stats)
Definition: device.c:655
static HRESULT WINAPI d3d_device1_GetPickRecords(IDirect3DDevice *iface, DWORD *count, D3DPICKRECORD *records)
Definition: device.c:1048
static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
Definition: device.c:1313
static HRESULT WINAPI d3d_device1_CreateExecuteBuffer(IDirect3DDevice *iface, D3DEXECUTEBUFFERDESC *buffer_desc, IDirect3DExecuteBuffer **ExecuteBuffer, IUnknown *outer_unknown)
Definition: device.c:684
static HRESULT WINAPI d3d_device1_GetDirect3D(IDirect3DDevice *iface, IDirect3D **d3d)
Definition: device.c:1698
static HRESULT WINAPI d3d_device1_DeleteViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport)
Definition: device.c:886
static HRESULT WINAPI d3d_device1_EnumTextureFormats(IDirect3DDevice *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
Definition: device.c:1287
static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport, IDirect3DViewport **next, DWORD flags)
Definition: device.c:985
static HRESULT WINAPI d3d_device1_QueryInterface(IDirect3DDevice *iface, REFIID riid, void **out)
Definition: device.c:205
static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface, IDirect3DExecuteBuffer *ExecuteBuffer, IDirect3DViewport *viewport, DWORD flags)
Definition: device.c:734
static ULONG WINAPI d3d_device1_Release(IDirect3DDevice *iface)
Definition: device.c:383
static HRESULT WINAPI d3d_device1_SwapTextureHandles(IDirect3DDevice *iface, IDirect3DTexture *tex1, IDirect3DTexture *tex2)
Definition: device.c:597
static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
Definition: device.c:1426
static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteBuffer *buffer, IDirect3DViewport *viewport, DWORD flags, D3DRECT *rect)
Definition: device.c:1023
static ULONG WINAPI d3d_device1_AddRef(IDirect3DDevice *iface)
Definition: device.c:251
static HRESULT WINAPI d3d_device1_AddViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport)
Definition: device.c:808
static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE matrix_handle, D3DMATRIX *matrix)
Definition: device.c:1367
static HRESULT WINAPI d3d_device1_GetCaps(IDirect3DDevice *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
Definition: device.c:542
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene(IDirect3DDevice *iface)
Definition: device.c:1627
static HRESULT WINAPI d3d_device1_Initialize(IDirect3DDevice *iface, IDirect3D *d3d, GUID *guid, D3DDEVICEDESC *device_desc)
Definition: device.c:410
static HRESULT WINAPI d3d_device1_BeginScene(IDirect3DDevice *iface)
Definition: device.c:1554
static HRESULT WINAPI d3d_device1_DeleteMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
Definition: device.c:1467

Definition at line 6754 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice().

◆ d3d_device2_vtbl

const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
static

Definition at line 6715 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice2().

◆ d3d_device3_vtbl

const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
static

Definition at line 6667 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice3().

◆ d3d_device7_fpu_preserve_vtbl

const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
static

Definition at line 6612 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice7().

◆ d3d_device7_fpu_setup_vtbl

const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
static

Definition at line 6557 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice7().

◆ d3d_device_inner_vtbl

const struct IUnknownVtbl d3d_device_inner_vtbl
static
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **out)
Definition: device.c:5124
static ULONG STDMETHODCALLTYPE d3d_device_inner_AddRef(IUnknown *iface)
Definition: device.c:5166
static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface)
Definition: device.c:5176

Definition at line 6782 of file device.c.

Referenced by d3d_device_init().

◆ IID_D3DDEVICE_WineD3D

const GUID IID_D3DDEVICE_WineD3D
Initial value:
= {
0xaef72d43,
0xb09a,
0x4b7b,
{ 0xb7,0x98,0xc6,0x8a,0x77,0x2d,0x72,0x2a }
}

Definition at line 36 of file device.c.

Referenced by d3d1_FindDevice(), d3d2_FindDevice(), d3d3_FindDevice(), d3d7_EnumZBufferFormats(), ddraw_find_device(), and ddraw_surface7_QueryInterface().

◆ tss_lookup

Initial value:
=
{
{FALSE, .u.texture_state = WINED3D_TSS_INVALID},
{FALSE, .u.texture_state = WINED3D_TSS_COLOR_OP},
{FALSE, .u.texture_state = WINED3D_TSS_COLOR_ARG1},
{FALSE, .u.texture_state = WINED3D_TSS_COLOR_ARG2},
{FALSE, .u.texture_state = WINED3D_TSS_ALPHA_OP},
{FALSE, .u.texture_state = WINED3D_TSS_ALPHA_ARG1},
{FALSE, .u.texture_state = WINED3D_TSS_ALPHA_ARG2},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_MAT00},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_MAT01},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_MAT10},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_MAT11},
{FALSE, .u.texture_state = WINED3D_TSS_TEXCOORD_INDEX},
{TRUE, .u.sampler_state = WINED3D_SAMP_ADDRESS_U},
{TRUE, .u.sampler_state = WINED3D_SAMP_ADDRESS_U},
{TRUE, .u.sampler_state = WINED3D_SAMP_ADDRESS_V},
{TRUE, .u.sampler_state = WINED3D_SAMP_BORDER_COLOR},
{TRUE, .u.sampler_state = WINED3D_SAMP_MAG_FILTER},
{TRUE, .u.sampler_state = WINED3D_SAMP_MIN_FILTER},
{TRUE, .u.sampler_state = WINED3D_SAMP_MIP_FILTER},
{TRUE, .u.sampler_state = WINED3D_SAMP_MIPMAP_LOD_BIAS},
{TRUE, .u.sampler_state = WINED3D_SAMP_MAX_MIP_LEVEL},
{TRUE, .u.sampler_state = WINED3D_SAMP_MAX_ANISOTROPY},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_LSCALE},
{FALSE, .u.texture_state = WINED3D_TSS_BUMPENV_LOFFSET},
}
@ WINED3D_SAMP_MAX_ANISOTROPY
Definition: wined3d.h:564
@ WINED3D_SAMP_MIPMAP_LOD_BIAS
Definition: wined3d.h:562
@ WINED3D_SAMP_BORDER_COLOR
Definition: wined3d.h:558
@ WINED3D_SAMP_MAX_MIP_LEVEL
Definition: wined3d.h:563
@ WINED3D_TSS_BUMPENV_LOFFSET
Definition: wined3d.h:606
@ WINED3D_TSS_BUMPENV_MAT11
Definition: wined3d.h:603
@ WINED3D_TSS_INVALID
Definition: wined3d.h:612
@ WINED3D_TSS_BUMPENV_MAT10
Definition: wined3d.h:602
@ WINED3D_TSS_TEXCOORD_INDEX
Definition: wined3d.h:604
@ WINED3D_TSS_BUMPENV_MAT01
Definition: wined3d.h:601
@ WINED3D_TSS_BUMPENV_LSCALE
Definition: wined3d.h:605
@ WINED3D_TSS_BUMPENV_MAT00
Definition: wined3d.h:600
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
Definition: wined3d.h:607