ReactOS  0.4.13-dev-551-gf37fb1f
device.c File Reference
#include "config.h"
#include "d3d9_private.h"
Include dependency graph for device.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d9)
 
static void STDMETHODCALLTYPE d3d9_null_wined3d_object_destroyed (void *parent)
 
D3DFORMAT d3dformat_from_wined3dformat (enum wined3d_format_id format)
 
enum wined3d_format_id wined3dformat_from_d3dformat (D3DFORMAT format)
 
unsigned int wined3dmapflags_from_d3dmapflags (unsigned int flags)
 
static UINT vertex_count_from_primitive_count (D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
 
static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect (enum wined3d_swap_effect effect)
 
void present_parameters_from_wined3d_swapchain_desc (D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
 
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect (D3DSWAPEFFECT effect)
 
static enum wined3d_swap_interval wined3dswapinterval_from_d3d (DWORD interval)
 
static BOOL wined3d_swapchain_desc_from_present_parameters (struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters, BOOL extended)
 
void d3dcaps_from_wined3dcaps (D3DCAPS9 *caps, const WINED3DCAPS *wined3d_caps)
 
static HRESULT WINAPI d3d9_device_QueryInterface (IDirect3DDevice9Ex *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_device_AddRef (IDirect3DDevice9Ex *iface)
 
static ULONG WINAPI DECLSPEC_HOTPATCH d3d9_device_Release (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI d3d9_device_TestCooperativeLevel (IDirect3DDevice9Ex *iface)
 
static UINT WINAPI d3d9_device_GetAvailableTextureMem (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI d3d9_device_EvictManagedResources (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI d3d9_device_GetDirect3D (IDirect3DDevice9Ex *iface, IDirect3D9 **d3d9)
 
static HRESULT WINAPI d3d9_device_GetDeviceCaps (IDirect3DDevice9Ex *iface, D3DCAPS9 *caps)
 
static HRESULT WINAPI d3d9_device_GetDisplayMode (IDirect3DDevice9Ex *iface, UINT swapchain, D3DDISPLAYMODE *mode)
 
static HRESULT WINAPI d3d9_device_GetCreationParameters (IDirect3DDevice9Ex *iface, D3DDEVICE_CREATION_PARAMETERS *parameters)
 
static HRESULT WINAPI d3d9_device_SetCursorProperties (IDirect3DDevice9Ex *iface, UINT hotspot_x, UINT hotspot_y, IDirect3DSurface9 *bitmap)
 
static void WINAPI d3d9_device_SetCursorPosition (IDirect3DDevice9Ex *iface, int x, int y, DWORD flags)
 
static BOOL WINAPI d3d9_device_ShowCursor (IDirect3DDevice9Ex *iface, BOOL show)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain (IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_GetSwapChain (IDirect3DDevice9Ex *iface, UINT swapchain_idx, IDirect3DSwapChain9 **swapchain)
 
static UINT WINAPI d3d9_device_GetNumberOfSwapChains (IDirect3DDevice9Ex *iface)
 
static HRESULT CDECL reset_enum_callback (struct wined3d_resource *resource)
 
static HRESULT d3d9_device_get_swapchains (struct d3d9_device *device)
 
static HRESULT d3d9_device_reset (struct d3d9_device *device, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset (IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Present (IDirect3DDevice9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region)
 
static HRESULT WINAPI d3d9_device_GetBackBuffer (IDirect3DDevice9Ex *iface, UINT swapchain, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
 
static HRESULT WINAPI d3d9_device_GetRasterStatus (IDirect3DDevice9Ex *iface, UINT swapchain, D3DRASTER_STATUS *raster_status)
 
static HRESULT WINAPI d3d9_device_SetDialogBoxMode (IDirect3DDevice9Ex *iface, BOOL enable)
 
static void WINAPI d3d9_device_SetGammaRamp (IDirect3DDevice9Ex *iface, UINT swapchain, DWORD flags, const D3DGAMMARAMP *ramp)
 
static void WINAPI d3d9_device_GetGammaRamp (IDirect3DDevice9Ex *iface, UINT swapchain, D3DGAMMARAMP *ramp)
 
static HRESULT WINAPI d3d9_device_CreateTexture (IDirect3DDevice9Ex *iface, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_CreateVolumeTexture (IDirect3DDevice9Ex *iface, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **texture, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_CreateCubeTexture (IDirect3DDevice9Ex *iface, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **texture, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_CreateVertexBuffer (IDirect3DDevice9Ex *iface, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer9 **buffer, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_CreateIndexBuffer (IDirect3DDevice9Ex *iface, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **buffer, HANDLE *shared_handle)
 
static HRESULT d3d9_device_create_surface (struct d3d9_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
 
BOOL is_gdi_compat_wined3dformat (enum wined3d_format_id format)
 
static HRESULT WINAPI d3d9_device_CreateRenderTarget (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_UpdateSurface (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, const RECT *src_rect, IDirect3DSurface9 *dst_surface, const POINT *dst_point)
 
static HRESULT WINAPI d3d9_device_UpdateTexture (IDirect3DDevice9Ex *iface, IDirect3DBaseTexture9 *src_texture, IDirect3DBaseTexture9 *dst_texture)
 
static HRESULT WINAPI d3d9_device_GetRenderTargetData (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *render_target, IDirect3DSurface9 *dst_surface)
 
static HRESULT WINAPI d3d9_device_GetFrontBufferData (IDirect3DDevice9Ex *iface, UINT swapchain, IDirect3DSurface9 *dst_surface)
 
static HRESULT WINAPI d3d9_device_StretchRect (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, const RECT *src_rect, IDirect3DSurface9 *dst_surface, const RECT *dst_rect, D3DTEXTUREFILTERTYPE filter)
 
static HRESULT WINAPI d3d9_device_ColorFill (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color)
 
static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, HANDLE *shared_handle)
 
static HRESULT WINAPI d3d9_device_SetRenderTarget (IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 *surface)
 
static HRESULT WINAPI d3d9_device_GetRenderTarget (IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 **surface)
 
static HRESULT WINAPI d3d9_device_SetDepthStencilSurface (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *depth_stencil)
 
static HRESULT WINAPI d3d9_device_GetDepthStencilSurface (IDirect3DDevice9Ex *iface, IDirect3DSurface9 **depth_stencil)
 
static HRESULT WINAPI d3d9_device_BeginScene (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_EndScene (IDirect3DDevice9Ex *iface)
 
static void d3d9_rts_flag_auto_gen_mipmap (struct d3d9_device *device)
 
static HRESULT WINAPI d3d9_device_Clear (IDirect3DDevice9Ex *iface, DWORD rect_count, const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil)
 
static HRESULT WINAPI d3d9_device_SetTransform (IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d9_device_GetTransform (IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d9_device_MultiplyTransform (IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d9_device_SetViewport (IDirect3DDevice9Ex *iface, const D3DVIEWPORT9 *viewport)
 
static HRESULT WINAPI d3d9_device_GetViewport (IDirect3DDevice9Ex *iface, D3DVIEWPORT9 *viewport)
 
static HRESULT WINAPI d3d9_device_SetMaterial (IDirect3DDevice9Ex *iface, const D3DMATERIAL9 *material)
 
static HRESULT WINAPI d3d9_device_GetMaterial (IDirect3DDevice9Ex *iface, D3DMATERIAL9 *material)
 
static HRESULT WINAPI d3d9_device_SetLight (IDirect3DDevice9Ex *iface, DWORD index, const D3DLIGHT9 *light)
 
static HRESULT WINAPI d3d9_device_GetLight (IDirect3DDevice9Ex *iface, DWORD index, D3DLIGHT9 *light)
 
static HRESULT WINAPI d3d9_device_LightEnable (IDirect3DDevice9Ex *iface, DWORD index, BOOL enable)
 
static HRESULT WINAPI d3d9_device_GetLightEnable (IDirect3DDevice9Ex *iface, DWORD index, BOOL *enable)
 
static HRESULT WINAPI d3d9_device_SetClipPlane (IDirect3DDevice9Ex *iface, DWORD index, const float *plane)
 
static HRESULT WINAPI d3d9_device_GetClipPlane (IDirect3DDevice9Ex *iface, DWORD index, float *plane)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState (IDirect3DDevice9Ex *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d9_device_GetRenderState (IDirect3DDevice9Ex *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d9_device_CreateStateBlock (IDirect3DDevice9Ex *iface, D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateblock)
 
static HRESULT WINAPI d3d9_device_BeginStateBlock (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI d3d9_device_EndStateBlock (IDirect3DDevice9Ex *iface, IDirect3DStateBlock9 **stateblock)
 
static HRESULT WINAPI d3d9_device_SetClipStatus (IDirect3DDevice9Ex *iface, const D3DCLIPSTATUS9 *clip_status)
 
static HRESULT WINAPI d3d9_device_GetClipStatus (IDirect3DDevice9Ex *iface, D3DCLIPSTATUS9 *clip_status)
 
static HRESULT WINAPI d3d9_device_GetTexture (IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 **texture)
 
static HRESULT WINAPI d3d9_device_SetTexture (IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 *texture)
 
static HRESULT WINAPI d3d9_device_GetTextureStageState (IDirect3DDevice9Ex *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d9_device_SetTextureStageState (IDirect3DDevice9Ex *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d9_device_GetSamplerState (IDirect3DDevice9Ex *iface, DWORD sampler, D3DSAMPLERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState (IDirect3DDevice9Ex *iface, DWORD sampler, D3DSAMPLERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d9_device_ValidateDevice (IDirect3DDevice9Ex *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d9_device_SetPaletteEntries (IDirect3DDevice9Ex *iface, UINT palette_idx, const PALETTEENTRY *entries)
 
static HRESULT WINAPI d3d9_device_GetPaletteEntries (IDirect3DDevice9Ex *iface, UINT palette_idx, PALETTEENTRY *entries)
 
static HRESULT WINAPI d3d9_device_SetCurrentTexturePalette (IDirect3DDevice9Ex *iface, UINT palette_idx)
 
static HRESULT WINAPI d3d9_device_GetCurrentTexturePalette (IDirect3DDevice9Ex *iface, UINT *palette_idx)
 
static HRESULT WINAPI d3d9_device_SetScissorRect (IDirect3DDevice9Ex *iface, const RECT *rect)
 
static HRESULT WINAPI d3d9_device_GetScissorRect (IDirect3DDevice9Ex *iface, RECT *rect)
 
static HRESULT WINAPI d3d9_device_SetSoftwareVertexProcessing (IDirect3DDevice9Ex *iface, BOOL software)
 
static BOOL WINAPI d3d9_device_GetSoftwareVertexProcessing (IDirect3DDevice9Ex *iface)
 
static HRESULT WINAPI d3d9_device_SetNPatchMode (IDirect3DDevice9Ex *iface, float segment_count)
 
static float WINAPI d3d9_device_GetNPatchMode (IDirect3DDevice9Ex *iface)
 
static void d3d9_generate_auto_mipmaps (struct d3d9_device *device)
 
static HRESULT WINAPI d3d9_device_DrawPrimitive (IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, UINT start_vertex, UINT primitive_count)
 
static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive (IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, INT base_vertex_idx, UINT min_vertex_idx, UINT vertex_count, UINT start_idx, UINT primitive_count)
 
static HRESULT d3d9_device_prepare_vertex_buffer (struct d3d9_device *device, UINT min_size)
 
static HRESULT WINAPI d3d9_device_DrawPrimitiveUP (IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, UINT primitive_count, const void *data, UINT stride)
 
static HRESULT d3d9_device_prepare_index_buffer (struct d3d9_device *device, UINT min_size)
 
static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP (IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, UINT min_vertex_idx, UINT vertex_count, UINT primitive_count, const void *index_data, D3DFORMAT index_format, const void *vertex_data, UINT vertex_stride)
 
static HRESULT WINAPI d3d9_device_ProcessVertices (IDirect3DDevice9Ex *iface, UINT src_start_idx, UINT dst_idx, UINT vertex_count, IDirect3DVertexBuffer9 *dst_buffer, IDirect3DVertexDeclaration9 *declaration, DWORD flags)
 
static HRESULT WINAPI d3d9_device_CreateVertexDeclaration (IDirect3DDevice9Ex *iface, const D3DVERTEXELEMENT9 *elements, IDirect3DVertexDeclaration9 **declaration)
 
static HRESULT WINAPI d3d9_device_SetVertexDeclaration (IDirect3DDevice9Ex *iface, IDirect3DVertexDeclaration9 *declaration)
 
static HRESULT WINAPI d3d9_device_GetVertexDeclaration (IDirect3DDevice9Ex *iface, IDirect3DVertexDeclaration9 **declaration)
 
static struct wined3d_vertex_declarationdevice_get_fvf_declaration (struct d3d9_device *device, DWORD fvf)
 
static HRESULT WINAPI d3d9_device_SetFVF (IDirect3DDevice9Ex *iface, DWORD fvf)
 
static HRESULT WINAPI d3d9_device_GetFVF (IDirect3DDevice9Ex *iface, DWORD *fvf)
 
static HRESULT WINAPI d3d9_device_CreateVertexShader (IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DVertexShader9 **shader)
 
static HRESULT WINAPI d3d9_device_SetVertexShader (IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 *shader)
 
static HRESULT WINAPI d3d9_device_GetVertexShader (IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 **shader)
 
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF (IDirect3DDevice9Ex *iface, UINT reg_idx, const float *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF (IDirect3DDevice9Ex *iface, UINT reg_idx, float *data, UINT count)
 
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI (IDirect3DDevice9Ex *iface, UINT reg_idx, const int *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantI (IDirect3DDevice9Ex *iface, UINT reg_idx, int *data, UINT count)
 
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB (IDirect3DDevice9Ex *iface, UINT reg_idx, const BOOL *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB (IDirect3DDevice9Ex *iface, UINT reg_idx, BOOL *data, UINT count)
 
static HRESULT WINAPI d3d9_device_SetStreamSource (IDirect3DDevice9Ex *iface, UINT stream_idx, IDirect3DVertexBuffer9 *buffer, UINT offset, UINT stride)
 
static HRESULT WINAPI d3d9_device_GetStreamSource (IDirect3DDevice9Ex *iface, UINT stream_idx, IDirect3DVertexBuffer9 **buffer, UINT *offset, UINT *stride)
 
static HRESULT WINAPI d3d9_device_SetStreamSourceFreq (IDirect3DDevice9Ex *iface, UINT stream_idx, UINT freq)
 
static HRESULT WINAPI d3d9_device_GetStreamSourceFreq (IDirect3DDevice9Ex *iface, UINT stream_idx, UINT *freq)
 
static HRESULT WINAPI d3d9_device_SetIndices (IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 *buffer)
 
static HRESULT WINAPI d3d9_device_GetIndices (IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
 
static HRESULT WINAPI d3d9_device_CreatePixelShader (IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DPixelShader9 **shader)
 
static HRESULT WINAPI d3d9_device_SetPixelShader (IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 *shader)
 
static HRESULT WINAPI d3d9_device_GetPixelShader (IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **shader)
 
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantF (IDirect3DDevice9Ex *iface, UINT reg_idx, const float *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantF (IDirect3DDevice9Ex *iface, UINT reg_idx, float *data, UINT count)
 
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantI (IDirect3DDevice9Ex *iface, UINT reg_idx, const int *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantI (IDirect3DDevice9Ex *iface, UINT reg_idx, int *data, UINT count)
 
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantB (IDirect3DDevice9Ex *iface, UINT reg_idx, const BOOL *data, UINT count)
 
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantB (IDirect3DDevice9Ex *iface, UINT reg_idx, BOOL *data, UINT count)
 
static HRESULT WINAPI d3d9_device_DrawRectPatch (IDirect3DDevice9Ex *iface, UINT handle, const float *segment_count, const D3DRECTPATCH_INFO *patch_info)
 
static HRESULT WINAPI d3d9_device_DrawTriPatch (IDirect3DDevice9Ex *iface, UINT handle, const float *segment_count, const D3DTRIPATCH_INFO *patch_info)
 
static HRESULT WINAPI d3d9_device_DeletePatch (IDirect3DDevice9Ex *iface, UINT handle)
 
static HRESULT WINAPI d3d9_device_CreateQuery (IDirect3DDevice9Ex *iface, D3DQUERYTYPE type, IDirect3DQuery9 **query)
 
static HRESULT WINAPI d3d9_device_SetConvolutionMonoKernel (IDirect3DDevice9Ex *iface, UINT width, UINT height, float *rows, float *columns)
 
static HRESULT WINAPI d3d9_device_ComposeRects (IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface, IDirect3DVertexBuffer9 *src_descs, UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_PresentEx (IDirect3DDevice9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags)
 
static HRESULT WINAPI d3d9_device_GetGPUThreadPriority (IDirect3DDevice9Ex *iface, INT *priority)
 
static HRESULT WINAPI d3d9_device_SetGPUThreadPriority (IDirect3DDevice9Ex *iface, INT priority)
 
static HRESULT WINAPI d3d9_device_WaitForVBlank (IDirect3DDevice9Ex *iface, UINT swapchain_idx)
 
static HRESULT WINAPI d3d9_device_CheckResourceResidency (IDirect3DDevice9Ex *iface, IDirect3DResource9 **resources, UINT32 resource_count)
 
static HRESULT WINAPI d3d9_device_SetMaximumFrameLatency (IDirect3DDevice9Ex *iface, UINT max_latency)
 
static HRESULT WINAPI d3d9_device_GetMaximumFrameLatency (IDirect3DDevice9Ex *iface, UINT *max_latency)
 
static HRESULT WINAPI d3d9_device_CheckDeviceState (IDirect3DDevice9Ex *iface, HWND dst_window)
 
static HRESULT WINAPI d3d9_device_CreateRenderTargetEx (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
 
static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurfaceEx (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
 
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx (IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx (IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
 
static HRESULT WINAPI d3d9_device_GetDisplayModeEx (IDirect3DDevice9Ex *iface, UINT swapchain_idx, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
 
static struct d3d9_devicedevice_from_device_parent (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_wined3d_device_created (struct wined3d_device_parent *device_parent, struct wined3d_device *device)
 
static void CDECL device_parent_mode_changed (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_activate (struct wined3d_device_parent *device_parent, BOOL activate)
 
static HRESULT CDECL device_parent_texture_sub_resource_created (struct wined3d_device_parent *device_parent, enum wined3d_resource_type type, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_create_swapchain_texture (struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
 
static HRESULT CDECL device_parent_create_swapchain (struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
 
static void setup_fpu (void)
 
HRESULT device_init (struct d3d9_device *device, struct d3d9 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode)
 

Variables

const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops
 
static enum wined3d_texture_stage_state tss_lookup []
 
static const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl
 
static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops
 

Function Documentation

◆ d3d9_device_AddRef()

static ULONG WINAPI d3d9_device_AddRef ( IDirect3DDevice9Ex *  iface)
static

Definition at line 548 of file device.c.

549 {
552 
553  TRACE("%p increasing refcount to %u.\n", iface, refcount);
554 
555  return refcount;
556 }
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ d3d9_device_BeginScene()

static HRESULT WINAPI d3d9_device_BeginScene ( IDirect3DDevice9Ex *  iface)
static

Definition at line 1937 of file device.c.

1938 {
1940  HRESULT hr;
1941 
1942  TRACE("iface %p.\n", iface);
1943 
1945  if (SUCCEEDED(hr = wined3d_device_begin_scene(device->wined3d_device)))
1946  device->in_scene = TRUE;
1948 
1949  return hr;
1950 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3659
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_BeginStateBlock()

static HRESULT WINAPI d3d9_device_BeginStateBlock ( IDirect3DDevice9Ex *  iface)
static

Definition at line 2276 of file device.c.

2277 {
2279  HRESULT hr;
2280 
2281  TRACE("iface %p.\n", iface);
2282 
2284  hr = wined3d_device_begin_stateblock(device->wined3d_device);
2286 
2287  return hr;
2288 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
Definition: device.c:3612
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_CheckDeviceState()

static HRESULT WINAPI d3d9_device_CheckDeviceState ( IDirect3DDevice9Ex *  iface,
HWND  dst_window 
)
static

Definition at line 3792 of file device.c.

3793 {
3795  struct wined3d_swapchain_desc swapchain_desc;
3796 
3797  TRACE("iface %p, dst_window %p.\n", iface, dst_window);
3798 
3800  wined3d_swapchain_get_desc(device->implicit_swapchains[0]->wined3d_swapchain, &swapchain_desc);
3802 
3803  if (swapchain_desc.windowed)
3804  return D3D_OK;
3805 
3806  /* FIXME: This is actually supposed to check if any other device is in
3807  * fullscreen mode. */
3808  if (dst_window != swapchain_desc.device_window)
3809  return device->device_state == D3D9_DEVICE_STATE_OK ? S_PRESENT_OCCLUDED : D3D_OK;
3810 
3811  return device->device_state == D3D9_DEVICE_STATE_OK ? D3D_OK : S_PRESENT_OCCLUDED;
3812 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define S_PRESENT_OCCLUDED
Definition: d3d9.h:112
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:267
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_CheckResourceResidency()

static HRESULT WINAPI d3d9_device_CheckResourceResidency ( IDirect3DDevice9Ex *  iface,
IDirect3DResource9 **  resources,
UINT32  resource_count 
)
static

Definition at line 3754 of file device.c.

3756 {
3757  FIXME("iface %p, resources %p, resource_count %u stub!\n",
3758  iface, resources, resource_count);
3759 
3760  return E_NOTIMPL;
3761 }
static struct resource resources[16]
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_Clear()

static HRESULT WINAPI d3d9_device_Clear ( IDirect3DDevice9Ex *  iface,
DWORD  rect_count,
const D3DRECT rects,
DWORD  flags,
D3DCOLOR  color,
float  z,
DWORD  stencil 
)
static

Definition at line 1980 of file device.c.

1982 {
1983  const struct wined3d_color c =
1984  {
1985  ((color >> 16) & 0xff) / 255.0f,
1986  ((color >> 8) & 0xff) / 255.0f,
1987  (color & 0xff) / 255.0f,
1988  ((color >> 24) & 0xff) / 255.0f,
1989  };
1991  HRESULT hr;
1992 
1993  TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
1994  iface, rect_count, rects, flags, color, z, stencil);
1995 
1996  if (rect_count && !rects)
1997  {
1998  WARN("count %u with NULL rects.\n", rect_count);
1999  rect_count = 0;
2000  }
2001 
2003  hr = wined3d_device_clear(device->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil);
2004  if (SUCCEEDED(hr))
2007 
2008  return hr;
2009 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
Definition: device.c:3690
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLuint color
Definition: glext.h:6243
Definition: devices.h:37
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1967
GLdouble GLdouble z
Definition: glext.h:5874
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GLubyte * c
Definition: glext.h:8905
GLbitfield flags
Definition: glext.h:7161
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_ColorFill()

static HRESULT WINAPI d3d9_device_ColorFill ( IDirect3DDevice9Ex *  iface,
IDirect3DSurface9 *  surface,
const RECT rect,
D3DCOLOR  color 
)
static

Definition at line 1711 of file device.c.

1713 {
1714  const struct wined3d_color c =
1715  {
1716  ((color >> 16) & 0xff) / 255.0f,
1717  ((color >> 8) & 0xff) / 255.0f,
1718  (color & 0xff) / 255.0f,
1719  ((color >> 24) & 0xff) / 255.0f,
1720  };
1722  struct d3d9_surface *surface_impl = unsafe_impl_from_IDirect3DSurface9(surface);
1724  struct wined3d_rendertarget_view *rtv;
1725  HRESULT hr;
1726 
1727  TRACE("iface %p, surface %p, rect %p, color 0x%08x.\n", iface, surface, rect, color);
1728 
1730 
1732  surface_impl->sub_resource_idx, &desc)))
1733  {
1735  return D3DERR_INVALIDCALL;
1736  }
1737 
1738  if (desc.access & WINED3D_RESOURCE_ACCESS_CPU)
1739  {
1741  WARN("Colour fills are not allowed on surfaces with resource access %#x.\n", desc.access);
1742  return D3DERR_INVALIDCALL;
1743  }
1745  {
1747  WARN("Colorfill is not allowed on non-RT textures, returning D3DERR_INVALIDCALL.\n");
1748  return D3DERR_INVALIDCALL;
1749  }
1750  if (desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1751  {
1753  WARN("Colorfill is not allowed on depth stencil surfaces, returning D3DERR_INVALIDCALL.\n");
1754  return D3DERR_INVALIDCALL;
1755  }
1756 
1757  rtv = d3d9_surface_acquire_rendertarget_view(surface_impl);
1759  rtv, rect, WINED3DCLEAR_TARGET, &c, 0.0f, 0);
1760  d3d9_surface_release_rendertarget_view(surface_impl, rtv);
1761  if (SUCCEEDED(hr) && surface_impl->texture)
1763 
1765 
1766  return hr;
1767 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
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:3295
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:909
void d3d9_surface_release_rendertarget_view(struct d3d9_surface *surface, struct wined3d_rendertarget_view *rtv) DECLSPEC_HIDDEN
Definition: surface.c:433
& rect
Definition: startmenu.cpp:1413
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view, const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
Definition: device.c:4426
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:56
GLuint color
Definition: glext.h:6243
Definition: devices.h:37
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:161
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define WINED3DUSAGE_RENDERTARGET
Definition: wined3d.h:908
const GLubyte * c
Definition: glext.h:8905
struct wined3d_rendertarget_view * d3d9_surface_acquire_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN
Definition: surface.c:407
struct d3d9_texture * texture
Definition: d3d9_private.h:167
#define WINED3DCLEAR_TARGET
Definition: wined3d.h:999
void d3d9_texture_flag_auto_gen_mipmap(struct d3d9_texture *texture) DECLSPEC_HIDDEN
Definition: texture.c:108
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:927
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN
Definition: surface.c:440
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_ComposeRects()

static HRESULT WINAPI d3d9_device_ComposeRects ( IDirect3DDevice9Ex *  iface,
IDirect3DSurface9 *  src_surface,
IDirect3DSurface9 *  dst_surface,
IDirect3DVertexBuffer9 *  src_descs,
UINT  rect_count,
IDirect3DVertexBuffer9 *  dst_descs,
D3DCOMPOSERECTSOP  operation,
INT  offset_x,
INT  offset_y 
)
static

Definition at line 3686 of file device.c.

3689 {
3690  FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u, "
3691  "dst_descs %p, operation %#x, offset_x %u, offset_y %u stub!\n",
3692  iface, src_surface, dst_surface, src_descs, rect_count,
3693  dst_descs, operation, offset_x, offset_y);
3694 
3695  return E_NOTIMPL;
3696 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_create_surface()

static HRESULT d3d9_device_create_surface ( struct d3d9_device device,
UINT  width,
UINT  height,
D3DFORMAT  format,
DWORD  flags,
IDirect3DSurface9 **  surface,
UINT  usage,
D3DPOOL  pool,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality,
void user_mem 
)
static

Definition at line 1366 of file device.c.

1369 {
1370  struct wined3d_resource_desc desc;
1371  struct d3d9_surface *surface_impl;
1372  struct wined3d_texture *texture;
1373  HRESULT hr;
1374 
1375  TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p.\n"
1376  "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
1377  device, width, height, format, flags, surface, usage, pool,
1378  multisample_type, multisample_quality);
1379 
1380  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1382  desc.multisample_type = multisample_type;
1383  desc.multisample_quality = multisample_quality;
1384  desc.usage = usage & WINED3DUSAGE_MASK;
1385  if (pool == D3DPOOL_SCRATCH)
1386  desc.usage |= WINED3DUSAGE_SCRATCH;
1389  desc.width = width;
1390  desc.height = height;
1391  desc.depth = 1;
1392  desc.size = 0;
1393 
1394  if (is_gdi_compat_wined3dformat(desc.format))
1396 
1398 
1399  if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &desc,
1401  {
1403  WARN("Failed to create texture, hr %#x.\n", hr);
1404  if (hr == WINED3DERR_NOTAVAILABLE)
1406  return hr;
1407  }
1408 
1410  surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface;
1411  *surface = &surface_impl->IDirect3DSurface9_iface;
1412  IDirect3DSurface9_AddRef(*surface);
1413 
1414  if (user_mem)
1416  desc.format, multisample_type, multisample_quality, user_mem, 0);
1417 
1419 
1421 
1422  return D3D_OK;
1423 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
#define WINED3DUSAGE_MASK
Definition: wined3d.h:922
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_GET_DC
Definition: wined3d.h:1561
Definition: devices.h:37
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format)
Definition: device.c:1425
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3264
#define D3D_OK
Definition: d3d.h:106
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:165
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:46
const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops
Definition: device.c:30
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:924
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1219
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT multisample_quality, void *mem, UINT pitch)
Definition: texture.c:1534
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:3326
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:302

Referenced by d3d9_device_CreateDepthStencilSurface(), d3d9_device_CreateDepthStencilSurfaceEx(), d3d9_device_CreateOffscreenPlainSurface(), and d3d9_device_CreateRenderTarget().

◆ d3d9_device_CreateAdditionalSwapChain()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain ( IDirect3DDevice9Ex *  iface,
D3DPRESENT_PARAMETERS present_parameters,
IDirect3DSwapChain9 **  swapchain 
)
static

Definition at line 773 of file device.c.

775 {
778  struct d3d9_swapchain *object;
779  unsigned int swap_interval;
780  unsigned int i, count;
781  HRESULT hr;
782 
783  TRACE("iface %p, present_parameters %p, swapchain %p.\n",
784  iface, present_parameters, swapchain);
785 
786  if (!present_parameters->Windowed)
787  {
788  WARN("Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
789  return D3DERR_INVALIDCALL;
790  }
791 
794  for (i = 0; i < count; ++i)
795  {
797 
800 
801  if (!desc.windowed)
802  {
804  WARN("Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
805  return D3DERR_INVALIDCALL;
806  }
807  }
809 
810  if (!wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters,
811  device->d3d_parent->extended))
812  return D3DERR_INVALIDCALL;
815  *swapchain = (IDirect3DSwapChain9 *)&object->IDirect3DSwapChain9Ex_iface;
817  &desc, present_parameters->PresentationInterval);
818 
819  return hr;
820 }
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:531
void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
Definition: device.c:233
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters, BOOL extended)
Definition: device.c:294
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:538
unsigned int swap_interval
Definition: d3d9_private.h:151
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
Definition: devices.h:37
static enum wined3d_swap_interval wined3dswapinterval_from_d3d(DWORD interval)
Definition: device.c:273
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:267
HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc, unsigned int swap_interval, struct d3d9_swapchain **swapchain) DECLSPEC_HIDDEN
Definition: swapchain.c:395
unsigned int swap_interval
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
void * object
Definition: jmemsys.h:48
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_CreateCubeTexture()

static HRESULT WINAPI d3d9_device_CreateCubeTexture ( IDirect3DDevice9Ex *  iface,
UINT  edge_length,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DCubeTexture9 **  texture,
HANDLE shared_handle 
)
static

Definition at line 1233 of file device.c.

1236 {
1238  struct d3d9_texture *object;
1239  HRESULT hr;
1240 
1241  TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1242  iface, edge_length, levels, usage, format, pool, texture, shared_handle);
1243 
1244  *texture = NULL;
1245  if (shared_handle)
1246  {
1247  if (!device->d3d_parent->extended)
1248  {
1249  WARN("Trying to create a shared cube texture on a non-ex device.\n");
1250  return E_NOTIMPL;
1251  }
1252 
1253  if (pool != D3DPOOL_DEFAULT)
1254  {
1255  WARN("Trying to create a shared cube texture in pool %#x.\n", pool);
1256  return D3DERR_INVALIDCALL;
1257  }
1258  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1259  }
1260 
1261  if (!(object = heap_alloc_zero(sizeof(*object))))
1262  return D3DERR_OUTOFVIDEOMEMORY;
1263 
1264  hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
1265  if (FAILED(hr))
1266  {
1267  WARN("Failed to initialize cube texture, hr %#x.\n", hr);
1268  heap_free(object);
1269  return hr;
1270  }
1271 
1272  TRACE("Created cube texture %p.\n", object);
1273  *texture = (IDirect3DCubeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1274 
1275  return D3D_OK;
1276 }
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1142
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateDepthStencilSurface()

static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality,
BOOL  discard,
IDirect3DSurface9 **  surface,
HANDLE shared_handle 
)
static

Definition at line 1472 of file device.c.

1475 {
1478 
1479  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
1480  "discard %#x, surface %p, shared_handle %p.\n",
1481  iface, width, height, format, multisample_type, multisample_quality,
1482  discard, surface, shared_handle);
1483 
1484  *surface = NULL;
1485  if (shared_handle)
1486  {
1487  if (!device->d3d_parent->extended)
1488  {
1489  WARN("Trying to create a shared depth stencil on a non-ex device.\n");
1490  return E_NOTIMPL;
1491  }
1492 
1493  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1494  }
1495 
1496  if (discard)
1498 
1500  D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
1501 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define D3DUSAGE_DEPTHSTENCIL
Definition: d3d8types.h:92
#define WINED3D_TEXTURE_CREATE_DISCARD
Definition: wined3d.h:1559
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
Definition: device.c:1366
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_CreateDepthStencilSurfaceEx()

static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality,
BOOL  discard,
IDirect3DSurface9 **  surface,
HANDLE shared_handle,
DWORD  usage 
)
static

Definition at line 3840 of file device.c.

3843 {
3846 
3847  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, "
3848  "discard %#x, surface %p, shared_handle %p, usage %#x.\n",
3849  iface, width, height, format, multisample_type, multisample_quality,
3850  discard, surface, shared_handle, usage);
3851 
3853  {
3854  WARN("Invalid usage %#x.\n", usage);
3855  return D3DERR_INVALIDCALL;
3856  }
3857 
3858  if (shared_handle)
3859  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
3860 
3861  if (discard)
3863 
3864  *surface = NULL;
3866  D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
3867 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define D3DUSAGE_DEPTHSTENCIL
Definition: d3d8types.h:92
#define WINED3D_TEXTURE_CREATE_DISCARD
Definition: wined3d.h:1559
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
Definition: device.c:1366
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ d3d9_device_CreateIndexBuffer()

static HRESULT WINAPI d3d9_device_CreateIndexBuffer ( IDirect3DDevice9Ex *  iface,
UINT  size,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DIndexBuffer9 **  buffer,
HANDLE shared_handle 
)
static

Definition at line 1322 of file device.c.

1325 {
1327  struct d3d9_indexbuffer *object;
1328  HRESULT hr;
1329 
1330  TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p, shared_handle %p.\n",
1331  iface, size, usage, format, pool, buffer, shared_handle);
1332 
1333  if (shared_handle)
1334  {
1335  if (!device->d3d_parent->extended)
1336  {
1337  WARN("Trying to create a shared index buffer on a non-ex device.\n");
1338  return E_NOTIMPL;
1339  }
1340 
1341  if (pool != D3DPOOL_DEFAULT)
1342  {
1343  WARN("Trying to create a shared index buffer in pool %#x.\n", pool);
1344  return D3DERR_NOTAVAILABLE;
1345  }
1346  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1347  }
1348 
1349  if (!(object = heap_alloc_zero(sizeof(*object))))
1350  return D3DERR_OUTOFVIDEOMEMORY;
1351 
1352  hr = indexbuffer_init(object, device, size, usage, format, pool);
1353  if (FAILED(hr))
1354  {
1355  WARN("Failed to initialize index buffer, hr %#x.\n", hr);
1356  heap_free(object);
1357  return hr;
1358  }
1359 
1360  TRACE("Created index buffer %p.\n", object);
1361  *buffer = &object->IDirect3DIndexBuffer9_iface;
1362 
1363  return D3D_OK;
1364 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
GLuint buffer
Definition: glext.h:5915
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:84
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: buffer.c:570
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateOffscreenPlainSurface()

static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DSurface9 **  surface,
HANDLE shared_handle 
)
static

Definition at line 1769 of file device.c.

1772 {
1774  void *user_mem = NULL;
1775 
1776  TRACE("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p.\n",
1777  iface, width, height, format, pool, surface, shared_handle);
1778 
1779  *surface = NULL;
1780  if (pool == D3DPOOL_MANAGED)
1781  {
1782  WARN("Attempting to create a managed offscreen plain surface.\n");
1783  return D3DERR_INVALIDCALL;
1784  }
1785 
1786  if (shared_handle)
1787  {
1788  if (!device->d3d_parent->extended)
1789  {
1790  WARN("Trying to create a shared or user memory surface on a non-ex device.\n");
1791  return E_NOTIMPL;
1792  }
1793 
1794  if (pool == D3DPOOL_SYSTEMMEM)
1795  user_mem = *shared_handle;
1796  else
1797  {
1798  if (pool != D3DPOOL_DEFAULT)
1799  {
1800  WARN("Trying to create a shared surface in pool %#x.\n", pool);
1801  return D3DERR_INVALIDCALL;
1802  }
1803  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1804  }
1805  }
1806 
1807  /* FIXME: Offscreen surfaces are supposed to be always lockable,
1808  * regardless of the pool they're created in. Should we set dynamic usage
1809  * here? */
1811  WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem);
1812 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
Definition: device.c:1366
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_CreateOffscreenPlainSurfaceEx()

static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurfaceEx ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DSurface9 **  surface,
HANDLE shared_handle,
DWORD  usage 
)
static

Definition at line 3830 of file device.c.

3833 {
3834  FIXME("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p, usage %#x stub!\n",
3835  iface, width, height, format, pool, surface, shared_handle, usage);
3836 
3837  return E_NOTIMPL;
3838 }
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_CreatePixelShader()

static HRESULT WINAPI d3d9_device_CreatePixelShader ( IDirect3DDevice9Ex *  iface,
const DWORD byte_code,
IDirect3DPixelShader9 **  shader 
)
static

Definition at line 3463 of file device.c.

3465 {
3467  struct d3d9_pixelshader *object;
3468  HRESULT hr;
3469 
3470  TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
3471 
3472  if (!(object = heap_alloc_zero(sizeof(*object))))
3473  {
3474  FIXME("Failed to allocate pixel shader memory.\n");
3475  return E_OUTOFMEMORY;
3476  }
3477 
3478  hr = pixelshader_init(object, device, byte_code);
3479  if (FAILED(hr))
3480  {
3481  WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
3482  heap_free(object);
3483  return hr;
3484  }
3485 
3486  TRACE("Created pixel shader %p.\n", object);
3487  *shader = &object->IDirect3DPixelShader9_iface;
3488 
3489  return D3D_OK;
3490 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define D3D_OK
Definition: d3d.h:106
HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN
Definition: shader.c:291
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateQuery()

static HRESULT WINAPI d3d9_device_CreateQuery ( IDirect3DDevice9Ex *  iface,
D3DQUERYTYPE  type,
IDirect3DQuery9 **  query 
)
static

Definition at line 3651 of file device.c.

3652 {
3654  struct d3d9_query *object;
3655  HRESULT hr;
3656 
3657  TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
3658 
3659  if (!(object = heap_alloc_zero(sizeof(*object))))
3660  return E_OUTOFMEMORY;
3661 
3662  hr = query_init(object, device, type);
3663  if (FAILED(hr))
3664  {
3665  WARN("Failed to initialize query, hr %#x.\n", hr);
3666  heap_free(object);
3667  return hr;
3668  }
3669 
3670  TRACE("Created query %p.\n", object);
3671  if (query) *query = &object->IDirect3DQuery9_iface;
3672  else IDirect3DQuery9_Release(&object->IDirect3DQuery9_iface);
3673 
3674  return D3D_OK;
3675 }
HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type) DECLSPEC_HIDDEN
Definition: query.c:184
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DQuery9_Release(p)
Definition: d3d9.h:1343
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateRenderTarget()

static HRESULT WINAPI d3d9_device_CreateRenderTarget ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality,
BOOL  lockable,
IDirect3DSurface9 **  surface,
HANDLE shared_handle 
)
static

Definition at line 1441 of file device.c.

1444 {
1446  DWORD flags = 0;
1447 
1448  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
1449  "lockable %#x, surface %p, shared_handle %p.\n",
1450  iface, width, height, format, multisample_type, multisample_quality,
1451  lockable, surface, shared_handle);
1452 
1453  *surface = NULL;
1454  if (shared_handle)
1455  {
1456  if (!device->d3d_parent->extended)
1457  {
1458  WARN("Trying to create a shared render target on a non-ex device.\n");
1459  return E_NOTIMPL;
1460  }
1461 
1462  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1463  }
1464 
1465  if (lockable)
1467 
1469  D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
1470 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define D3DUSAGE_RENDERTARGET
Definition: d3d8types.h:91
static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
Definition: device.c:1366
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_CreateRenderTargetEx()

static HRESULT WINAPI d3d9_device_CreateRenderTargetEx ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality,
BOOL  lockable,
IDirect3DSurface9 **  surface,
HANDLE shared_handle,
DWORD  usage 
)
static

Definition at line 3814 of file device.c.

3817 {
3818  FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, "
3819  "lockable %#x, surface %p, shared_handle %p, usage %#x stub!\n",
3820  iface, width, height, format, multisample_type, multisample_quality,
3821  lockable, surface, shared_handle, usage);
3822 
3823  *surface = NULL;
3824  if (shared_handle)
3825  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
3826 
3827  return E_NOTIMPL;
3828 }
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3d9_device_CreateStateBlock()

static HRESULT WINAPI d3d9_device_CreateStateBlock ( IDirect3DDevice9Ex *  iface,
D3DSTATEBLOCKTYPE  type,
IDirect3DStateBlock9 **  stateblock 
)
static

Definition at line 2244 of file device.c.

2246 {
2248  struct d3d9_stateblock *object;
2249  HRESULT hr;
2250 
2251  TRACE("iface %p, type %#x, stateblock %p.\n", iface, type, stateblock);
2252 
2254  {
2255  WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL.\n");
2256  return D3DERR_INVALIDCALL;
2257  }
2258 
2259  if (!(object = heap_alloc_zero(sizeof(*object))))
2260  return E_OUTOFMEMORY;
2261 
2262  hr = stateblock_init(object, device, type, NULL);
2263  if (FAILED(hr))
2264  {
2265  WARN("Failed to initialize stateblock, hr %#x.\n", hr);
2266  heap_free(object);
2267  return hr;
2268  }
2269 
2270  TRACE("Created stateblock %p.\n", object);
2271  *stateblock = &object->IDirect3DStateBlock9_iface;
2272 
2273  return D3D_OK;
2274 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device *device, D3DSTATEBLOCKTYPE type, struct wined3d_stateblock *wined3d_stateblock) DECLSPEC_HIDDEN
Definition: stateblock.c:134
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateTexture()

static HRESULT WINAPI d3d9_device_CreateTexture ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DTexture9 **  texture,
HANDLE shared_handle 
)
static

Definition at line 1126 of file device.c.

1129 {
1131  struct d3d9_texture *object;
1132  BOOL set_mem = FALSE;
1133  HRESULT hr;
1134 
1135  TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1136  iface, width, height, levels, usage, format, pool, texture, shared_handle);
1137 
1138  *texture = NULL;
1139  if (shared_handle)
1140  {
1141  if (!device->d3d_parent->extended)
1142  {
1143  WARN("Trying to create a shared or user memory texture on a non-ex device.\n");
1144  return E_NOTIMPL;
1145  }
1146 
1147  if (pool == D3DPOOL_SYSTEMMEM)
1148  {
1149  if (levels != 1)
1150  return D3DERR_INVALIDCALL;
1151  set_mem = TRUE;
1152  }
1153  else
1154  {
1155  if (pool != D3DPOOL_DEFAULT)
1156  {
1157  WARN("Trying to create a shared texture in pool %#x.\n", pool);
1158  return D3DERR_INVALIDCALL;
1159  }
1160  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1161  }
1162  }
1163 
1164  if (!(object = heap_alloc_zero(sizeof(*object))))
1165  return D3DERR_OUTOFVIDEOMEMORY;
1166 
1168  if (FAILED(hr))
1169  {
1170  WARN("Failed to initialize texture, hr %#x.\n", hr);
1171  heap_free(object);
1172  return hr;
1173  }
1174 
1175  if (set_mem)
1176  wined3d_texture_update_desc(object->wined3d_texture, width, height,
1178  *shared_handle, 0);
1179 
1180  TRACE("Created texture %p.\n", object);
1181  *texture = (IDirect3DTexture9 *)&object->IDirect3DBaseTexture9_iface;
1182 
1183  return D3D_OK;
1184 }
HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1094
GLint GLint GLsizei width
Definition: gl.h:1546
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT multisample_quality, void *mem, UINT pitch)
Definition: texture.c:1534
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateVertexBuffer()

static HRESULT WINAPI d3d9_device_CreateVertexBuffer ( IDirect3DDevice9Ex *  iface,
UINT  size,
DWORD  usage,
DWORD  fvf,
D3DPOOL  pool,
IDirect3DVertexBuffer9 **  buffer,
HANDLE shared_handle 
)
static

Definition at line 1278 of file device.c.

1281 {
1283  struct d3d9_vertexbuffer *object;
1284  HRESULT hr;
1285 
1286  TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p, shared_handle %p.\n",
1287  iface, size, usage, fvf, pool, buffer, shared_handle);
1288 
1289  if (shared_handle)
1290  {
1291  if (!device->d3d_parent->extended)
1292  {
1293  WARN("Trying to create a shared vertex buffer on a non-ex device.\n");
1294  return E_NOTIMPL;
1295  }
1296 
1297  if (pool != D3DPOOL_DEFAULT)
1298  {
1299  WARN("Trying to create a shared vertex buffer in pool %#x.\n", pool);
1300  return D3DERR_NOTAVAILABLE;
1301  }
1302  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1303  }
1304 
1305  if (!(object = heap_alloc_zero(sizeof(*object))))
1306  return D3DERR_OUTOFVIDEOMEMORY;
1307 
1308  hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
1309  if (FAILED(hr))
1310  {
1311  WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
1312  heap_free(object);
1313  return hr;
1314  }
1315 
1316  TRACE("Created vertex buffer %p.\n", object);
1317  *buffer = &object->IDirect3DVertexBuffer9_iface;
1318 
1319  return D3D_OK;
1320 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
GLuint buffer
Definition: glext.h:5915
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:84
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
Definition: buffer.c:273
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateVertexDeclaration()

static HRESULT WINAPI d3d9_device_CreateVertexDeclaration ( IDirect3DDevice9Ex *  iface,
const D3DVERTEXELEMENT9 elements,
IDirect3DVertexDeclaration9 **  declaration 
)
static

Definition at line 2980 of file device.c.

2982 {
2985  HRESULT hr;
2986 
2987  TRACE("iface %p, elements %p, declaration %p.\n", iface, elements, declaration);
2988 
2989  if (!declaration)
2990  {
2991  WARN("Caller passed a NULL declaration, returning D3DERR_INVALIDCALL.\n");
2992  return D3DERR_INVALIDCALL;
2993  }
2994 
2996  *declaration = &object->IDirect3DVertexDeclaration9_iface;
2997 
2998  return hr;
2999 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
Definition: devices.h:37
D3DVERTEXELEMENT9 * elements
Definition: d3d9_private.h:242
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration) DECLSPEC_HIDDEN
void * object
Definition: jmemsys.h:48
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_CreateVertexShader()

static HRESULT WINAPI d3d9_device_CreateVertexShader ( IDirect3DDevice9Ex *  iface,
const DWORD byte_code,
IDirect3DVertexShader9 **  shader 
)
static

Definition at line 3166 of file device.c.

3168 {
3170  struct d3d9_vertexshader *object;
3171  HRESULT hr;
3172 
3173  TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
3174 
3175  if (!(object = heap_alloc_zero(sizeof(*object))))
3176  return E_OUTOFMEMORY;
3177 
3178  hr = vertexshader_init(object, device, byte_code);
3179  if (FAILED(hr))
3180  {
3181  WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
3182  heap_free(object);
3183  return hr;
3184  }
3185 
3186  TRACE("Created vertex shader %p.\n", object);
3187  *shader = &object->IDirect3DVertexShader9_iface;
3188 
3189  return D3D_OK;
3190 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define D3D_OK
Definition: d3d.h:106
HRESULT vertexshader_init(struct d3d9_vertexshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN
Definition: shader.c:137
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_CreateVolumeTexture()

static HRESULT WINAPI d3d9_device_CreateVolumeTexture ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
UINT  depth,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DVolumeTexture9 **  texture,
HANDLE shared_handle 
)
static

Definition at line 1186 of file device.c.

1189 {
1191  struct d3d9_texture *object;
1192  HRESULT hr;
1193 
1194  TRACE("iface %p, width %u, height %u, depth %u, levels %u, "
1195  "usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1196  iface, width, height, depth, levels,
1197  usage, format, pool, texture, shared_handle);
1198 
1199  *texture = NULL;
1200  if (shared_handle)
1201  {
1202  if (!device->d3d_parent->extended)
1203  {
1204  WARN("Trying to create a shared volume texture on a non-ex device.\n");
1205  return E_NOTIMPL;
1206  }
1207 
1208  if (pool != D3DPOOL_DEFAULT)
1209  {
1210  WARN("Trying to create a shared volume texture in pool %#x.\n", pool);
1211  return D3DERR_INVALIDCALL;
1212  }
1213  FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1214  }
1215 
1216  if (!(object = heap_alloc_zero(sizeof(*object))))
1217  return D3DERR_OUTOFVIDEOMEMORY;
1218 
1220  if (FAILED(hr))
1221  {
1222  WARN("Failed to initialize volume texture, hr %#x.\n", hr);
1223  heap_free(object);
1224  return hr;
1225  }
1226 
1227  TRACE("Created volume texture %p.\n", object);
1228  *texture = (IDirect3DVolumeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1229 
1230  return D3D_OK;
1231 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1190
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_DeletePatch()

static HRESULT WINAPI d3d9_device_DeletePatch ( IDirect3DDevice9Ex *  iface,
UINT  handle 
)
static

Definition at line 3645 of file device.c.

3646 {
3647  FIXME("iface %p, handle %#x unimplemented.\n", iface, handle);
3648  return D3DERR_INVALIDCALL;
3649 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d9_device_DrawIndexedPrimitive()

static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive ( IDirect3DDevice9Ex *  iface,
D3DPRIMITIVETYPE  primitive_type,
INT  base_vertex_idx,
UINT  min_vertex_idx,
UINT  vertex_count,
UINT  start_idx,
UINT  primitive_count 
)
static

Definition at line 2682 of file device.c.

2685 {
2687  HRESULT hr;
2688 
2689  TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u, "
2690  "vertex_count %u, start_idx %u, primitive_count %u.\n",
2691  iface, primitive_type, base_vertex_idx, min_vertex_idx,
2692  vertex_count, start_idx, primitive_count);
2693 
2695  if (!device->has_vertex_declaration)
2696  {
2698  WARN("Called without a valid vertex declaration set.\n");
2699  return D3DERR_INVALIDCALL;
2700  }
2702  wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx);
2703  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2704  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx,
2705  vertex_count_from_primitive_count(primitive_type, primitive_count));
2706  if (SUCCEEDED(hr))
2709 
2710  return hr;
2711 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
Definition: device.c:3826
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3774
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
int vertex_count
Definition: d3drm.c:2807
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:187
Definition: devices.h:37
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1967
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:2642
LONG HRESULT
Definition: typedefs.h:77
void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index)
Definition: device.c:1920
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_DrawIndexedPrimitiveUP()

static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP ( IDirect3DDevice9Ex *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  min_vertex_idx,
UINT  vertex_count,
UINT  primitive_count,
const void index_data,
D3DFORMAT  index_format,
const void vertex_data,
UINT  vertex_stride 
)
static

Definition at line 2855 of file device.c.

2859 {
2860  UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2862  UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
2863  UINT vtx_size = vertex_count * vertex_stride;
2864  UINT idx_size = idx_count * idx_fmt_size;
2866  struct wined3d_box wined3d_box = {0};
2867  struct wined3d_resource *ib, *vb;
2868  UINT vb_pos, ib_pos, align;
2869  HRESULT hr;
2870 
2871  TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
2872  "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
2873  iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
2874  index_data, index_format, vertex_data, vertex_stride);
2875 
2876  if (!primitive_count)
2877  {
2878  WARN("primitive_count is 0, returning D3D_OK.\n");
2879  return D3D_OK;
2880  }
2881 
2883 
2884  if (!device->has_vertex_declaration)
2885  {
2887  WARN("Called without a valid vertex declaration set.\n");
2888  return D3DERR_INVALIDCALL;
2889  }
2890 
2892  if (FAILED(hr))
2893  goto done;
2894 
2895  vb_pos = device->vertex_buffer_pos;
2896  align = vb_pos % vertex_stride;
2897  if (align) align = vertex_stride - align;
2898  if (vb_pos + vtx_size + align > device->vertex_buffer_size)
2899  vb_pos = 0;
2900  else
2901  vb_pos += align;
2902 
2903  wined3d_box.left = vb_pos;
2904  wined3d_box.right = vb_pos + vtx_size;
2905  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2908  goto done;
2909  memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
2910  wined3d_resource_unmap(vb, 0);
2911  device->vertex_buffer_pos = vb_pos + vtx_size;
2912 
2914  if (FAILED(hr))
2915  goto done;
2916 
2917  ib_pos = device->index_buffer_pos;
2918  align = ib_pos % idx_fmt_size;
2919  if (align) align = idx_fmt_size - align;
2920  if (ib_pos + idx_size + align > device->index_buffer_size)
2921  ib_pos = 0;
2922  else
2923  ib_pos += align;
2924 
2925  wined3d_box.left = ib_pos;
2926  wined3d_box.right = ib_pos + idx_size;
2927  ib = wined3d_buffer_get_resource(device->index_buffer);
2930  goto done;
2931  memcpy(wined3d_map_desc.data, index_data, idx_size);
2932  wined3d_resource_unmap(ib, 0);
2933  device->index_buffer_pos = ib_pos + idx_size;
2934 
2935  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, vertex_stride);
2936  if (FAILED(hr))
2937  goto done;
2938 
2940  wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
2941  wined3dformat_from_d3dformat(index_format), 0);
2942  wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
2943 
2944  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2945  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
2946 
2947  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2949  wined3d_device_set_base_vertex_index(device->wined3d_device, 0);
2950 
2951  if (SUCCEEDED(hr))
2953 
2954 done:
2956  return hr;
2957 }
UINT left
Definition: wined3d.h:1840
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
Definition: device.c:3826
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3774
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:372
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
int align(int length, int align)
Definition: dsound8.c:36
int vertex_count
Definition: d3drm.c:2807
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
Definition: device.c:1877
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:187
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, DWORD flags)
Definition: resource.c:334
Definition: devices.h:37
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1967
static HRESULT d3d9_device_prepare_vertex_buffer(struct d3d9_device *device, UINT min_size)
Definition: device.c:2714
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: device.c:1381
UINT right
Definition: wined3d.h:1842
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:944
#define TRACE(s)
Definition: solgame.cpp:4
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:2642
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_MAP_WRITE
Definition: wined3d.h:947
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index)
Definition: device.c:1920
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:943
#define D3D_OK
Definition: d3d.h:106
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:992
unsigned int UINT
Definition: ndis.h:50
static HRESULT d3d9_device_prepare_index_buffer(struct d3d9_device *device, UINT min_size)
Definition: device.c:2819
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_DrawPrimitive()

static HRESULT WINAPI d3d9_device_DrawPrimitive ( IDirect3DDevice9Ex *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  start_vertex,
UINT  primitive_count 
)
static

Definition at line 2655 of file device.c.

2657 {
2659  HRESULT hr;
2660 
2661  TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
2662  iface, primitive_type, start_vertex, primitive_count);
2663 
2665  if (!device->has_vertex_declaration)
2666  {
2668  WARN("Called without a valid vertex declaration set.\n");
2669  return D3DERR_INVALIDCALL;
2670  }
2672  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2673  hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex,
2674  vertex_count_from_primitive_count(primitive_type, primitive_count));
2675  if (SUCCEEDED(hr))
2678 
2679  return hr;
2680 }
HRESULT hr
Definition: shlfolder.c:183
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3774
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:187
Definition: devices.h:37
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1967
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3797
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:2642
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_DrawPrimitiveUP()

static HRESULT WINAPI d3d9_device_DrawPrimitiveUP ( IDirect3DDevice9Ex *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  primitive_count,
const void data,
UINT  stride 
)
static

Definition at line 2750 of file device.c.

2752 {
2754  HRESULT hr;
2755  UINT vtx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2757  struct wined3d_box wined3d_box = {0};
2758  UINT size = vtx_count * stride;
2759  struct wined3d_resource *vb;
2760  UINT vb_pos, align;
2761 
2762  TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
2763  iface, primitive_type, primitive_count, data, stride);
2764 
2765  if (!primitive_count)
2766  {
2767  WARN("primitive_count is 0, returning D3D_OK\n");
2768  return D3D_OK;
2769  }
2770 
2772 
2773  if (!device->has_vertex_declaration)
2774  {
2776  WARN("Called without a valid vertex declaration set.\n");
2777  return D3DERR_INVALIDCALL;
2778  }
2779 
2781  if (FAILED(hr))
2782  goto done;
2783 
2784  vb_pos = device->vertex_buffer_pos;
2785  align = vb_pos % stride;
2786  if (align) align = stride - align;
2787  if (vb_pos + size + align > device->vertex_buffer_size)
2788  vb_pos = 0;
2789  else
2790  vb_pos += align;
2791 
2792  wined3d_box.left = vb_pos;
2793  wined3d_box.right = vb_pos + size;
2794  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2797  goto done;
2799  wined3d_resource_unmap(vb, 0);
2800  device->vertex_buffer_pos = vb_pos + size;
2801 
2802  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
2803  if (FAILED(hr))
2804  goto done;
2805 
2807  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2808  hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count);
2809  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2810  if (SUCCEEDED(hr))
2812 
2813 done:
2815  return hr;
2816 }
UINT left
Definition: wined3d.h:1840
HRESULT hr
Definition: shlfolder.c:183
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3774
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:372
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
int align(int length, int align)
Definition: dsound8.c:36
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:187
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, DWORD flags)
Definition: resource.c:334
Definition: devices.h:37
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1967
static HRESULT d3d9_device_prepare_vertex_buffer(struct d3d9_device *device, UINT min_size)
Definition: device.c:2714
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3797
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: device.c:1381
UINT right
Definition: wined3d.h:1842
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:944
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
GLsizeiptr size
Definition: glext.h:5919
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:2642
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define WINED3D_MAP_WRITE
Definition: wined3d.h:947
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:943
#define D3D_OK
Definition: d3d.h:106
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:992
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_DrawRectPatch()

static HRESULT WINAPI d3d9_device_DrawRectPatch ( IDirect3DDevice9Ex *  iface,
UINT  handle,
const float *  segment_count,
const D3DRECTPATCH_INFO patch_info 
)
static

Definition at line 3629 of file device.c.

3631 {
3632  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3633  iface, handle, segment_count, patch_info);
3634  return D3D_OK;
3635 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106

◆ d3d9_device_DrawTriPatch()

static HRESULT WINAPI d3d9_device_DrawTriPatch ( IDirect3DDevice9Ex *  iface,
UINT  handle,
const float *  segment_count,
const D3DTRIPATCH_INFO patch_info 
)
static

Definition at line 3637 of file device.c.

3639 {
3640  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3641  iface, handle, segment_count, patch_info);
3642  return D3D_OK;
3643 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106

◆ d3d9_device_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_EndScene ( IDirect3DDevice9Ex *  iface)
static

Definition at line 1952 of file device.c.

1953 {
1955  HRESULT hr;
1956 
1957  TRACE("iface %p.\n", iface);
1958 
1960  if (SUCCEEDED(hr = wined3d_device_end_scene(device->wined3d_device)))
1961  device->in_scene = FALSE;
1963 
1964  return hr;
1965 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3674
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_EndStateBlock()

static HRESULT WINAPI d3d9_device_EndStateBlock ( IDirect3DDevice9Ex *  iface,
IDirect3DStateBlock9 **  stateblock 
)
static

Definition at line 2290 of file device.c.

2291 {
2294  struct d3d9_stateblock *object;
2295  HRESULT hr;
2296 
2297  TRACE("iface %p, stateblock %p.\n", iface, stateblock);
2298 
2302  if (FAILED(hr))
2303  {
2304  WARN("Failed to end the state block, hr %#x.\n", hr);
2305  return hr;
2306  }
2307 
2308  if (!(object = heap_alloc_zero(sizeof(*object))))
2309  {
2313  return E_OUTOFMEMORY;
2314  }
2315 
2317  if (FAILED(hr))
2318  {
2319  WARN("Failed to initialize stateblock, hr %#x.\n", hr);
2323  heap_free(object);
2324  return hr;
2325  }
2326 
2327  TRACE("Created stateblock %p.\n", object);
2328  *stateblock = &object->IDirect3DStateBlock9_iface;
2329 
2330  return D3D_OK;
2331 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock)
Definition: device.c:3634
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:551
LONG HRESULT
Definition: typedefs.h:77
HRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device *device, D3DSTATEBLOCKTYPE type, struct wined3d_stateblock *wined3d_stateblock) DECLSPEC_HIDDEN
Definition: stateblock.c:134
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d9_device_EvictManagedResources()

static HRESULT WINAPI d3d9_device_EvictManagedResources ( IDirect3DDevice9Ex *  iface)
static

Definition at line 639 of file device.c.

640 {
642 
643  TRACE("iface %p.\n", iface);
644 
648 
649  return D3D_OK;
650 }
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4788
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_get_swapchains()

static HRESULT d3d9_device_get_swapchains ( struct d3d9_device device)
static

Definition at line 894 of file device.c.

895 {
896  UINT i, new_swapchain_count = wined3d_device_get_swapchain_count(device->wined3d_device);
898 
899  if (!(device->implicit_swapchains = heap_alloc(new_swapchain_count * sizeof(*device->implicit_swapchains))))
900  return E_OUTOFMEMORY;
901 
902  for (i = 0; i < new_swapchain_count; ++i)
903  {
905  device->implicit_swapchains[i] = wined3d_swapchain_get_parent(wined3d_swapchain);
906  }
907  device->implicit_swapchain_count = new_swapchain_count;
908 
909  return D3D_OK;
910 }
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:531
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:538
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
void *CDECL wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain)
Definition: swapchain.c:133
#define D3D_OK
Definition: d3d.h:106
unsigned int UINT
Definition: ndis.h:50

Referenced by d3d9_device_reset(), and device_init().

◆ d3d9_device_GetAvailableTextureMem()

static UINT WINAPI d3d9_device_GetAvailableTextureMem ( IDirect3DDevice9Ex *  iface)
static

Definition at line 625 of file device.c.

626 {
628  UINT ret;
629 
630  TRACE("iface %p.\n", iface);
631 
635 
636  return ret;
637 }
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1301
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
int ret
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetBackBuffer()

static HRESULT WINAPI d3d9_device_GetBackBuffer ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
UINT  backbuffer_idx,
D3DBACKBUFFER_TYPE  backbuffer_type,
IDirect3DSurface9 **  backbuffer 
)
static

Definition at line 1042 of file device.c.

1044 {
1046  HRESULT hr;
1047 
1048  TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
1049  iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer);
1050 
1051  /* backbuffer_type is ignored by native. */
1052 
1053  /* No need to check for backbuffer == NULL, Windows crashes in that case. */
1054  *backbuffer = NULL;
1055 
1057  if (swapchain >= device->implicit_swapchain_count)
1058  {
1060  WARN("Swapchain index %u is out of range, returning D3DERR_INVALIDCALL.\n", swapchain);
1061  return D3DERR_INVALIDCALL;
1062  }
1063 
1064  hr = IDirect3DSwapChain9Ex_GetBackBuffer(&device->implicit_swapchains[swapchain]->IDirect3DSwapChain9Ex_iface,
1065  backbuffer_idx, backbuffer_type, backbuffer);
1067 
1068  return hr;
1069 }
#define IDirect3DSwapChain9Ex_GetBackBuffer(p, a, b, c)
Definition: d3d9.h:501
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetClipPlane()

static HRESULT WINAPI d3d9_device_GetClipPlane ( IDirect3DDevice9Ex *  iface,
DWORD  index,
float *  plane 
)
static

Definition at line 2200 of file device.c.

2201 {
2203  HRESULT hr;
2204 
2205  TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
2206 
2207  index = min(index, device->max_user_clip_planes - 1);
2208 
2210  hr = wined3d_device_get_clip_plane(device->wined3d_device, index, (struct wined3d_vec4 *)plane);
2212 
2213  return hr;
2214 }
HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane)
Definition: device.c:1814
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
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define min(a, b)
Definition: monoChain.cc:55
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetClipStatus()

static HRESULT WINAPI d3d9_device_GetClipStatus ( IDirect3DDevice9Ex *  iface,
D3DCLIPSTATUS9 clip_status 
)
static

Definition at line 2347 of file device.c.

2348 {
2350  HRESULT hr;
2351 
2352  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2353 
2355  hr = wined3d_device_get_clip_status(device->wined3d_device, (struct wined3d_clip_status *)clip_status);
2357 
2358  return hr;
2359 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device, struct wined3d_clip_status *clip_status)
Definition: device.c:1841
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetCreationParameters()

static HRESULT WINAPI d3d9_device_GetCreationParameters ( IDirect3DDevice9Ex *  iface,
D3DDEVICE_CREATION_PARAMETERS parameters 
)
static

Definition at line 709 of file device.c.

711 {
713 
714  TRACE("iface %p, parameters %p.\n", iface, parameters);
715 
718  (struct wined3d_device_creation_parameters *)parameters);
720 
721  return D3D_OK;
722 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
void CDECL wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *parameters)
Definition: device.c:5076
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetCurrentTexturePalette()

static HRESULT WINAPI d3d9_device_GetCurrentTexturePalette ( IDirect3DDevice9Ex *  iface,
UINT palette_idx 
)
static

Definition at line 2553 of file device.c.

2554 {
2555  FIXME("iface %p, palette_idx %p.\n", iface, palette_idx);
2556 
2557  return D3DERR_INVALIDCALL;
2558 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d9_device_GetDepthStencilSurface()

static HRESULT WINAPI d3d9_device_GetDepthStencilSurface ( IDirect3DDevice9Ex *  iface,
IDirect3DSurface9 **  depth_stencil 
)
static

Definition at line 1906 of file device.c.

1907 {
1909  struct wined3d_rendertarget_view *wined3d_dsv;
1910  struct d3d9_surface *surface_impl;
1911  HRESULT hr = D3D_OK;
1912 
1913  TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
1914 
1915  if (!depth_stencil)
1916  return D3DERR_INVALIDCALL;
1917 
1919  if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
1920  {
1921  /* We want the sub resource parent here, since the view itself may be
1922  * internal to wined3d and may not have a parent. */
1923  surface_impl = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
1924  *depth_stencil = &surface_impl->IDirect3DSurface9_iface;
1925  IDirect3DSurface9_AddRef(*depth_stencil);
1926  }
1927  else
1928  {
1929  hr = D3DERR_NOTFOUND;
1930  *depth_stencil = NULL;
1931  }
1933 
1934  return hr;
1935 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
struct wined3d_rendertarget_view *CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
Definition: device.c:4495
#define D3DERR_NOTFOUND
Definition: d3d8.h:80
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define D3D_OK
Definition: d3d.h:106
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetDeviceCaps()

static HRESULT WINAPI d3d9_device_GetDeviceCaps ( IDirect3DDevice9Ex *  iface,
D3DCAPS9 caps 
)
static

Definition at line 664 of file device.c.

665 {
667  WINED3DCAPS wined3d_caps;
668  HRESULT hr;
669 
670  TRACE("iface %p, caps %p.\n", iface, caps);
671 
672  if (!caps)
673  return D3DERR_INVALIDCALL;
674 
675  memset(caps, 0, sizeof(*caps));
676 
678  hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps);
680 
681  d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
682 
683  return hr;
684 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3583
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps)
Definition: device.c:324
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define memset(x, y, z)
Definition: compat.h:39

◆ d3d9_device_GetDirect3D()

static HRESULT WINAPI d3d9_device_GetDirect3D ( IDirect3DDevice9Ex *  iface,
IDirect3D9 **  d3d9 
)
static

Definition at line 652 of file device.c.

653 {
655 
656  TRACE("iface %p, d3d9 %p.\n", iface, d3d9);
657 
658  if (!d3d9)
659  return D3DERR_INVALIDCALL;
660 
661  return IDirect3D9Ex_QueryInterface(&device->d3d_parent->IDirect3D9Ex_iface, &IID_IDirect3D9, (void **)d3d9);
662 }
#define IDirect3D9Ex_QueryInterface(p, a, b)
Definition: d3d9.h:307
#define D3DERR_INVALIDCALL
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_device_GetDisplayMode()

static HRESULT WINAPI d3d9_device_GetDisplayMode ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
D3DDISPLAYMODE mode 
)
static

Definition at line 686 of file device.c.

687 {
689  struct wined3d_display_mode wined3d_mode;
690  HRESULT hr;
691 
692  TRACE("iface %p, swapchain %u, mode %p.\n", iface, swapchain, mode);
693 
695  hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain, &wined3d_mode, NULL);
697 
698  if (SUCCEEDED(hr))
699  {
700  mode->Width = wined3d_mode.width;
701  mode->Height = wined3d_mode.height;
702  mode->RefreshRate = wined3d_mode.refresh_rate;
703  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
704  }
705 
706  return hr;
707 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: device.c:3598
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLenum mode
Definition: glext.h:6217
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_GetDisplayModeEx()

static HRESULT WINAPI d3d9_device_GetDisplayModeEx ( IDirect3DDevice9Ex *  iface,
UINT  swapchain_idx,
D3DDISPLAYMODEEX mode,
D3DDISPLAYROTATION rotation 
)
static

Definition at line 3894 of file device.c.

3896 {
3898  struct wined3d_display_mode wined3d_mode;
3899  HRESULT hr;
3900 
3901  TRACE("iface %p, swapchain_idx %u, mode %p, rotation %p.\n",
3902  iface, swapchain_idx, mode, rotation);
3903 
3904  if (mode->Size != sizeof(*mode))
3905  return D3DERR_INVALIDCALL;
3906 
3908  hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain_idx, &wined3d_mode,
3909  (enum wined3d_display_rotation *)rotation);
3911 
3912  if (SUCCEEDED(hr))
3913  {
3914  mode->Width = wined3d_mode.width;
3915  mode->Height = wined3d_mode.height;
3916  mode->RefreshRate = wined3d_mode.refresh_rate;
3917  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
3918  mode->ScanLineOrdering = wined3d_mode.scanline_ordering;
3919  }
3920 
3921  return hr;
3922 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: device.c:3598
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
wined3d_display_rotation
Definition: wined3d.h:846
GLenum mode
Definition: glext.h:6217
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d9_device_GetFrontBufferData()

static HRESULT WINAPI d3d9_device_GetFrontBufferData ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
IDirect3DSurface9 *  dst_surface 
)
static

Definition at line 1605 of file device.c.

1607 {
1609  struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1611 
1612  TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, swapchain, dst_surface);
1613 
1615  if (swapchain < device->implicit_swapchain_count)
1616  hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchains[swapchain]->wined3d_swapchain,
1617  dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
1619 
1620  return hr;
1621 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
Definition: devices.h:37
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:161
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN
Definition: surface.c:440
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, struct wined3d_texture *dst_texture, unsigned int sub_resource_idx)
Definition: swapchain.c:190
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetFVF()

static HRESULT WINAPI d3d9_device_GetFVF ( IDirect3DDevice9Ex *  iface,
DWORD fvf 
)
static

Definition at line 3141 of file device.c.

3142 {
3144  struct wined3d_vertex_declaration *wined3d_declaration;
3145  struct d3d9_vertex_declaration *d3d9_declaration;
3146 
3147  TRACE("iface %p, fvf %p.\n", iface, fvf);
3148 
3151  {
3153  *fvf = d3d9_declaration->fvf;
3154  }
3155  else
3156  {
3157  *fvf = 0;
3158  }
3160 
3161  TRACE("Returning FVF %#x.\n", *fvf);
3162 
3163  return D3D_OK;
3164 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_vertex_declaration *CDECL wined3d_device_get_vertex_declaration(const struct wined3d_device *device)
Definition: device.c:2219
#define D3D_OK
Definition: d3d.h:106
struct wined3d_vertex_declaration * wined3d_declaration
Definition: d3d9_private.h:244
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
void *CDECL wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration)

◆ d3d9_device_GetGammaRamp()

static void WINAPI d3d9_device_GetGammaRamp ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
D3DGAMMARAMP ramp 
)
static

Definition at line 1114 of file device.c.

1115 {
1117 
1118  TRACE("iface %p, swapchain %u, ramp %p.\n", iface, swapchain, ramp);
1119 
1120  /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
1122  wined3d_device_get_gamma_ramp(device->wined3d_device, swapchain, (struct wined3d_gamma_ramp *)ramp);
1124 }
void CDECL wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp)
Definition: device.c:5103
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
static const BYTE ramp[17]
Definition: dib.c:2709
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetGPUThreadPriority()

static HRESULT WINAPI d3d9_device_GetGPUThreadPriority ( IDirect3DDevice9Ex *  iface,
INT priority 
)
static

Definition at line 3733 of file device.c.

3734 {
3735  FIXME("iface %p, priority %p stub!\n", iface, priority);
3736 
3737  return E_NOTIMPL;
3738 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static int priority
Definition: timer.c:163

◆ d3d9_device_GetIndices()

static HRESULT WINAPI d3d9_device_GetIndices ( IDirect3DDevice9Ex *  iface,
IDirect3DIndexBuffer9 **  buffer 
)
static

Definition at line 3435 of file device.c.

3436 {
3440  struct d3d9_indexbuffer *buffer_impl;
3441 
3442  TRACE("iface %p, buffer %p.\n", iface, buffer);
3443 
3444  if (!buffer)
3445  return D3DERR_INVALIDCALL;
3446 
3449  {
3451  *buffer = &buffer_impl->IDirect3DIndexBuffer9_iface;
3453  }
3454  else
3455  {
3456  *buffer = NULL;
3457  }
3459 
3460  return D3D_OK;
3461 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:804
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_buffer *CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, enum wined3d_format_id *format, unsigned int *offset)
Definition: device.c:1909
IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface
Definition: d3d9_private.h:193
wined3d_format_id
Definition: wined3d.h:105
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DIndexBuffer9_AddRef(p)
Definition: d3d9.h:763
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetLight()

static HRESULT WINAPI d3d9_device_GetLight ( IDirect3DDevice9Ex *  iface,
DWORD  index,
D3DLIGHT9 light 
)
static

Definition at line 2141 of file device.c.

2142 {
2144  HRESULT hr;
2145 
2146  TRACE("iface %p, index %u, light %p.\n", iface, index, light);
2147 
2148  /* Note: D3DLIGHT9 is compatible with struct wined3d_light. */
2150  hr = wined3d_device_get_light(device->wined3d_device, index, (struct wined3d_light *)light);
2152 
2153  return hr;
2154 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, struct wined3d_light *light)
Definition: device.c:1727
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetLightEnable()

static HRESULT WINAPI d3d9_device_GetLightEnable ( IDirect3DDevice9Ex *  iface,
DWORD  index,
BOOL enable 
)
static

Definition at line 2170 of file device.c.

2171 {
2173  HRESULT hr;
2174 
2175  TRACE("iface %p, index %u, enable %p.\n", iface, index, enable);
2176 
2178  hr = wined3d_device_get_light_enable(device->wined3d_device, index, enable);
2180 
2181  return hr;
2182 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
HRESULT CDECL wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable)
Definition: device.c:1770
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLboolean enable
Definition: glext.h:11120
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetMaterial()

static HRESULT WINAPI d3d9_device_GetMaterial ( IDirect3DDevice9Ex *  iface,
D3DMATERIAL9 material 
)
static

Definition at line 2112 of file device.c.

2113 {
2115 
2116  TRACE("iface %p, material %p.\n", iface, material);
2117 
2118  /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
2120  wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
2122 
2123  return D3D_OK;
2124 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
Definition: device.c:1864
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetMaximumFrameLatency()

static HRESULT WINAPI d3d9_device_GetMaximumFrameLatency ( IDirect3DDevice9Ex *  iface,
UINT max_latency 
)
static

Definition at line 3779 of file device.c.

3780 {
3782 
3783  TRACE("iface %p, max_latency %p.\n", iface, max_latency);
3784 
3786  *max_latency = wined3d_device_get_max_frame_latency(device->wined3d_device);
3788 
3789  return S_OK;
3790 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
unsigned int CDECL wined3d_device_get_max_frame_latency(const struct wined3d_device *device)
Definition: device.c:3120
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetNPatchMode()

static float WINAPI d3d9_device_GetNPatchMode ( IDirect3DDevice9Ex *  iface)
static

Definition at line 2627 of file device.c.

2628 {
2630  float ret;
2631 
2632  TRACE("iface %p.\n", iface);
2633 
2635  ret = wined3d_device_get_npatch_mode(device->wined3d_device);
2637 
2638  return ret;
2639 }
float CDECL wined3d_device_get_npatch_mode(const struct wined3d_device *device)
Definition: device.c:4067
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetNumberOfSwapChains()

static UINT WINAPI d3d9_device_GetNumberOfSwapChains ( IDirect3DDevice9Ex *  iface)
static

Definition at line 847 of file device.c.

848 {
850  UINT count;
851 
852  TRACE("iface %p.\n", iface);
853 
857 
858  return count;
859 }
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:531
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetPaletteEntries()

static HRESULT WINAPI d3d9_device_GetPaletteEntries ( IDirect3DDevice9Ex *  iface,
UINT  palette_idx,
PALETTEENTRY entries 
)
static

Definition at line 2538 of file device.c.

2540 {
2541  FIXME("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2542 
2543  return D3DERR_INVALIDCALL;
2544 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d9_device_GetPixelShader()

static HRESULT WINAPI d3d9_device_GetPixelShader ( IDirect3DDevice9Ex *  iface,
IDirect3DPixelShader9 **  shader 
)
static

Definition at line 3507 of file device.c.

3508 {
3510  struct d3d9_pixelshader *shader_impl;
3512 
3513  TRACE("iface %p, shader %p.\n", iface, shader);
3514 
3515  if (!shader) return D3DERR_INVALIDCALL;
3516 
3518  if ((wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device)))
3519  {
3521  *shader = &shader_impl->IDirect3DPixelShader9_iface;
3523  }
3524  else
3525  {
3526  *shader = NULL;
3527  }
3529 
3530  TRACE("Returning %p.\n", *shader);
3531 
3532  return D3D_OK;
3533 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
#define IDirect3DPixelShader9_AddRef(p)
Definition: d3d9.h:1260
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
IDirect3DPixelShader9 IDirect3DPixelShader9_iface
Definition: d3d9_private.h:268
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void *CDECL wined3d_shader_get_parent(const struct wined3d_shader *shader)
Definition: shader.c:3436
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
struct wined3d_shader *CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
Definition: device.c:2570

◆ d3d9_device_GetPixelShaderConstantB()

static HRESULT WINAPI d3d9_device_GetPixelShaderConstantB ( IDirect3DDevice9Ex *  iface,
UINT  reg_idx,
BOOL data,
UINT  count 
)
static

Definition at line 3614 of file device.c.

3616 {
3618  HRESULT hr;
3619 
3620  TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3621 
3623  hr = wined3d_device_get_ps_consts_b(device->wined3d_device, reg_idx, count, data);
3625 
3626  return hr;
3627 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT CDECL wined3d_device_get_ps_consts_b(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, BOOL *constants)
Definition: device.c:2654
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetPixelShaderConstantF()

static HRESULT WINAPI d3d9_device_GetPixelShaderConstantF ( IDirect3DDevice9Ex *  iface,
UINT  reg_idx,
float *  data,
UINT  count 
)
static

Definition at line 3551 of file device.c.

3553 {
3555  HRESULT hr;
3556 
3557  TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3558 
3560  hr = wined3d_device_get_ps_consts_f(device->wined3d_device,
3561  reg_idx, count, (struct wined3d_vec4 *)data);
3563 
3564  return hr;
3565 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
HRESULT CDECL wined3d_device_get_ps_consts_f(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: device.c:2748

◆ d3d9_device_GetPixelShaderConstantI()

static HRESULT WINAPI d3d9_device_GetPixelShaderConstantI ( IDirect3DDevice9Ex *  iface,
UINT  reg_idx,
int data,
UINT  count 
)
static

Definition at line 3583 of file device.c.

3585 {
3587  HRESULT hr;
3588 
3589  TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3590 
3592  hr = wined3d_device_get_ps_consts_i(device->wined3d_device,
3593  reg_idx, count, (struct wined3d_ivec4 *)data);
3595 
3596  return hr;
3597 }
HRESULT CDECL wined3d_device_get_ps_consts_i(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants)
Definition: device.c:2703
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetRasterStatus()

static HRESULT WINAPI d3d9_device_GetRasterStatus ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
D3DRASTER_STATUS raster_status 
)
static

Definition at line 1071 of file device.c.

1073 {
1075  HRESULT hr;
1076 
1077  TRACE("iface %p, swapchain %u, raster_status %p.\n", iface, swapchain, raster_status);
1078 
1080  hr = wined3d_device_get_raster_status(device->wined3d_device,
1081  swapchain, (struct wined3d_raster_status *)raster_status);
1083 
1084  return hr;
1085 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status)
Definition: device.c:4035
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetRenderState()

static HRESULT WINAPI d3d9_device_GetRenderState ( IDirect3DDevice9Ex *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2230 of file device.c.

2232 {
2234 
2235  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2236 
2238  *value = wined3d_device_get_render_state(device->wined3d_device, state);
2240 
2241  return D3D_OK;
2242 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2085

◆ d3d9_device_GetRenderTarget()

static HRESULT WINAPI d3d9_device_GetRenderTarget ( IDirect3DDevice9Ex *  iface,
DWORD  idx,
IDirect3DSurface9 **  surface 
)
static

Definition at line 1852 of file device.c.

1853 {
1855  struct wined3d_rendertarget_view *wined3d_rtv;
1856  struct d3d9_surface *surface_impl;
1857  HRESULT hr = D3D_OK;
1858 
1859  TRACE("iface %p, idx %u, surface %p.\n", iface, idx, surface);
1860 
1861  if (!surface)
1862  return D3DERR_INVALIDCALL;
1863 
1865  {
1866  WARN("Invalid index %u specified.\n", idx);
1867  return D3DERR_INVALIDCALL;
1868  }
1869 
1871  if ((wined3d_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, idx)))
1872  {
1873  /* We want the sub resource parent here, since the view itself may be
1874  * internal to wined3d and may not have a parent. */
1876  *surface = &surface_impl->IDirect3DSurface9_iface;
1877  IDirect3DSurface9_AddRef(*surface);
1878  }
1879  else
1880  {
1881  hr = D3DERR_NOTFOUND;
1882  *surface = NULL;
1883  }
1885 
1886  return hr;
1887 }
HRESULT hr
Definition: shlfolder.c:183
struct wined3d_rendertarget_view *CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, unsigned int view_idx)
Definition: device.c:4481
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
#define D3DERR_NOTFOUND
Definition: d3d8.h:80
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164
Definition: devices.h:37
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define D3D_OK
Definition: d3d.h:106
#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS
Definition: d3d9types.h:184
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d9_device_GetRenderTargetData()

static HRESULT WINAPI d3d9_device_GetRenderTargetData ( IDirect3DDevice9Ex *  iface,
IDirect3DSurface9 *  render_target,
IDirect3DSurface9 *  dst_surface 
)
static

Definition at line 1573 of file device.c.

1575 {
1576  struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target);
1577  struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1578  struct wined3d_sub_resource_desc wined3d_desc;
1579  RECT dst_rect, src_rect;
1580  HRESULT hr;
1581 
1582  TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface);
1583 
1584  if (!render_target || !dst_surface)
1585  return D3DERR_INVALIDCALL;
1586 
1588  wined3d_texture_get_sub_resource_desc(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &wined3d_desc);
1589  SetRect(&dst_rect, 0, 0, wined3d_desc.width, wined3d_desc.height);
1590 
1591  wined3d_texture_get_sub_resource_desc(rt_impl->wined3d_texture, rt_impl->sub_resource_idx, &wined3d_desc);