ReactOS 0.4.15-dev-8100-g1887773
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)
 
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect (D3DSWAPEFFECT effect)
 
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_surface_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_volume_created (struct wined3d_device_parent *device_parent, 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 515 of file device.c.

516{
519
520 TRACE("%p increasing refcount to %u.\n", iface, refcount);
521
522 return refcount;
523}
#define InterlockedIncrement
Definition: armddk.h:53
#define TRACE(s)
Definition: solgame.cpp:4
Definition: devices.h:37
uint32_t ULONG
Definition: typedefs.h:59
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:289

◆ d3d9_device_BeginScene()

static HRESULT WINAPI d3d9_device_BeginScene ( IDirect3DDevice9Ex *  iface)
static

Definition at line 1901 of file device.c.

1902{
1904 HRESULT hr;
1905
1906 TRACE("iface %p.\n", iface);
1907
1909 if (SUCCEEDED(hr = wined3d_device_begin_scene(device->wined3d_device)))
1910 device->in_scene = TRUE;
1912
1913 return hr;
1914}
#define TRUE
Definition: types.h:120
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3602
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

◆ d3d9_device_BeginStateBlock()

static HRESULT WINAPI d3d9_device_BeginStateBlock ( IDirect3DDevice9Ex *  iface)
static

Definition at line 2240 of file device.c.

2241{
2243 HRESULT hr;
2244
2245 TRACE("iface %p.\n", iface);
2246
2248 hr = wined3d_device_begin_stateblock(device->wined3d_device);
2250
2251 return hr;
2252}
HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
Definition: device.c:3555

◆ d3d9_device_CheckDeviceState()

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

Definition at line 3747 of file device.c.

3748{
3750 struct wined3d_swapchain_desc swapchain_desc;
3751
3752 TRACE("iface %p, dst_window %p.\n", iface, dst_window);
3753
3755 wined3d_swapchain_get_desc(device->implicit_swapchains[0]->wined3d_swapchain, &swapchain_desc);
3757
3758 if (swapchain_desc.windowed)
3759 return D3D_OK;
3760
3761 /* FIXME: This is actually supposed to check if any other device is in
3762 * fullscreen mode. */
3763 if (dst_window != swapchain_desc.device_window)
3764 return device->device_state == D3D9_DEVICE_STATE_OK ? S_PRESENT_OCCLUDED : D3D_OK;
3765
3766 return device->device_state == D3D9_DEVICE_STATE_OK ? D3D_OK : S_PRESENT_OCCLUDED;
3767}
#define S_PRESENT_OCCLUDED
Definition: d3d9.h:112
#define D3D_OK
Definition: d3d.h:106
@ D3D9_DEVICE_STATE_OK
Definition: d3d9_private.h:79
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:271

◆ d3d9_device_CheckResourceResidency()

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

Definition at line 3719 of file device.c.

3721{
3722 FIXME("iface %p, resources %p, resource_count %u stub!\n",
3723 iface, resources, resource_count);
3724
3725 return E_NOTIMPL;
3726}
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99
FxCmResList * resources

◆ 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 1944 of file device.c.

1946{
1947 const struct wined3d_color c =
1948 {
1949 ((color >> 16) & 0xff) / 255.0f,
1950 ((color >> 8) & 0xff) / 255.0f,
1951 (color & 0xff) / 255.0f,
1952 ((color >> 24) & 0xff) / 255.0f,
1953 };
1955 HRESULT hr;
1956
1957 TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
1958 iface, rect_count, rects, flags, color, z, stencil);
1959
1960 if (rect_count && !rects)
1961 {
1962 WARN("count %u with NULL rects.\n", rect_count);
1963 rect_count = 0;
1964 }
1965
1967 hr = wined3d_device_clear(device->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil);
1968 if (SUCCEEDED(hr))
1971
1972 return hr;
1973}
#define WARN(fmt,...)
Definition: debug.h:115
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:1931
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:3633
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLbitfield flags
Definition: glext.h:7161
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLdouble GLdouble z
Definition: glext.h:5874

◆ d3d9_device_ColorFill()

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

Definition at line 1675 of file device.c.

1677{
1678 const struct wined3d_color c =
1679 {
1680 ((color >> 16) & 0xff) / 255.0f,
1681 ((color >> 8) & 0xff) / 255.0f,
1682 (color & 0xff) / 255.0f,
1683 ((color >> 24) & 0xff) / 255.0f,
1684 };
1686 struct d3d9_surface *surface_impl = unsafe_impl_from_IDirect3DSurface9(surface);
1688 struct wined3d_rendertarget_view *rtv;
1689 HRESULT hr;
1690
1691 TRACE("iface %p, surface %p, rect %p, color 0x%08x.\n", iface, surface, rect, color);
1692
1694
1696 surface_impl->sub_resource_idx, &desc)))
1697 {
1699 return D3DERR_INVALIDCALL;
1700 }
1701
1702 if (desc.access & WINED3D_RESOURCE_ACCESS_CPU)
1703 {
1705 WARN("Colour fills are not allowed on surfaces with resource access %#x.\n", desc.access);
1706 return D3DERR_INVALIDCALL;
1707 }
1709 {
1711 WARN("Colorfill is not allowed on non-RT textures, returning D3DERR_INVALIDCALL.\n");
1712 return D3DERR_INVALIDCALL;
1713 }
1714 if (desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1715 {
1717 WARN("Colorfill is not allowed on depth stencil surfaces, returning D3DERR_INVALIDCALL.\n");
1718 return D3DERR_INVALIDCALL;
1719 }
1720
1721 rtv = d3d9_surface_acquire_rendertarget_view(surface_impl);
1723 rtv, rect, WINED3DCLEAR_TARGET, &c, 0.0f, 0);
1724 d3d9_surface_release_rendertarget_view(surface_impl, rtv);
1725 if (SUCCEEDED(hr) && surface_impl->texture)
1727
1729
1730 return hr;
1731}
#define D3DERR_INVALIDCALL
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:4392
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:3480
#define FAILED(hr)
Definition: intsafe.h:51
static const WCHAR desc[]
Definition: protectdata.c:36
& rect
Definition: startmenu.cpp:1413
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:161
struct d3d9_texture * texture
Definition: d3d9_private.h:167
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
void d3d9_surface_release_rendertarget_view(struct d3d9_surface *surface, struct wined3d_rendertarget_view *rtv) DECLSPEC_HIDDEN
Definition: surface.c:433
struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN
Definition: surface.c:440
void d3d9_texture_flag_auto_gen_mipmap(struct d3d9_texture *texture) DECLSPEC_HIDDEN
Definition: texture.c:108
struct wined3d_rendertarget_view * d3d9_surface_acquire_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN
Definition: surface.c:407
#define WINED3DCLEAR_TARGET
Definition: wined3d.h:997
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:56
#define WINED3DUSAGE_RENDERTARGET
Definition: wined3d.h:899
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900

◆ 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 3653 of file device.c.

3656{
3657 FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u, "
3658 "dst_descs %p, operation %#x, offset_x %u, offset_y %u stub!\n",
3659 iface, src_surface, dst_surface, src_descs, rect_count,
3660 dst_descs, operation, offset_x, offset_y);
3661
3662 return E_NOTIMPL;
3663}
operation
Definition: copy.c:29

◆ 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 1330 of file device.c.

1333{
1335 struct d3d9_surface *surface_impl;
1336 struct wined3d_texture *texture;
1337 HRESULT hr;
1338
1339 TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p.\n"
1340 "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
1341 device, width, height, format, flags, surface, usage, pool,
1342 multisample_type, multisample_quality);
1343
1344 desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1346 desc.multisample_type = multisample_type;
1347 desc.multisample_quality = multisample_quality;
1348 desc.usage = usage & WINED3DUSAGE_MASK;
1349 if (pool == D3DPOOL_SCRATCH)
1350 desc.usage |= WINED3DUSAGE_SCRATCH;
1353 desc.width = width;
1354 desc.height = height;
1355 desc.depth = 1;
1356 desc.size = 0;
1357
1360
1362
1363 if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &desc,
1365 {
1367 WARN("Failed to create texture, hr %#x.\n", hr);
1370 return hr;
1371 }
1372
1374 surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface;
1375 *surface = &surface_impl->IDirect3DSurface9_iface;
1376 IDirect3DSurface9_AddRef(*surface);
1377
1378 if (user_mem)
1380 desc.format, multisample_type, multisample_quality, user_mem, 0);
1381
1383
1385
1386 return D3D_OK;
1387}
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301
@ D3DPOOL_SCRATCH
Definition: d3d8types.h:712
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define NULL
Definition: types.h:112
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format)
Definition: device.c:1389
const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops
Definition: device.c:30
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:3511
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
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:1356
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLuint texture
Definition: glext.h:6295
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:165
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:46
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
#define WINED3D_TEXTURE_CREATE_GET_DC
Definition: wined3d.h:1561
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58

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 740 of file device.c.

742{
745 struct d3d9_swapchain *object;
746 UINT i, count;
747 HRESULT hr;
748
749 TRACE("iface %p, present_parameters %p, swapchain %p.\n",
750 iface, present_parameters, swapchain);
751
752 if (!present_parameters->Windowed)
753 {
754 WARN("Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
755 return D3DERR_INVALIDCALL;
756 }
757
760 for (i = 0; i < count; ++i)
761 {
763
766
767 if (!desc.windowed)
768 {
770 WARN("Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
771 return D3DERR_INVALIDCALL;
772 }
773 }
775
777 device->d3d_parent->extended))
778 return D3DERR_INVALIDCALL;
779 if (SUCCEEDED(hr = d3d9_swapchain_create(device, &desc, &object)))
780 *swapchain = (IDirect3DSwapChain9 *)&object->IDirect3DSwapChain9Ex_iface;
782
783 return hr;
784}
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc)
Definition: device.c:211
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters)
Definition: device.c:248
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:533
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:526
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
unsigned int UINT
Definition: ndis.h:50
HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc, struct d3d9_swapchain **swapchain) DECLSPEC_HIDDEN
Definition: swapchain.c:371

◆ 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 1197 of file device.c.

1200{
1202 struct d3d9_texture *object;
1203 HRESULT hr;
1204
1205 TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1206 iface, edge_length, levels, usage, format, pool, texture, shared_handle);
1207
1208 *texture = NULL;
1209 if (shared_handle)
1210 {
1211 if (!device->d3d_parent->extended)
1212 {
1213 WARN("Trying to create a shared cube texture on a non-ex device.\n");
1214 return E_NOTIMPL;
1215 }
1216
1217 if (pool != D3DPOOL_DEFAULT)
1218 {
1219 WARN("Trying to create a shared cube texture in pool %#x.\n", pool);
1220 return D3DERR_INVALIDCALL;
1221 }
1222 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1223 }
1224
1225 if (!(object = heap_alloc_zero(sizeof(*object))))
1227
1228 hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
1229 if (FAILED(hr))
1230 {
1231 WARN("Failed to initialize cube texture, hr %#x.\n", hr);
1232 heap_free(object);
1233 return hr;
1234 }
1235
1236 TRACE("Created cube texture %p.\n", object);
1237 *texture = (IDirect3DCubeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1238
1239 return D3D_OK;
1240}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
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
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
GLsizei levels
Definition: glext.h:7884
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85

◆ 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 1436 of file device.c.

1439{
1442
1443 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
1444 "discard %#x, surface %p, shared_handle %p.\n",
1445 iface, width, height, format, multisample_type, multisample_quality,
1446 discard, surface, shared_handle);
1447
1448 *surface = NULL;
1449 if (shared_handle)
1450 {
1451 if (!device->d3d_parent->extended)
1452 {
1453 WARN("Trying to create a shared depth stencil on a non-ex device.\n");
1454 return E_NOTIMPL;
1455 }
1456
1457 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1458 }
1459
1460 if (discard)
1462
1464 D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
1465}
#define D3DUSAGE_DEPTHSTENCIL
Definition: d3d8types.h:92
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:1330
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_TEXTURE_CREATE_DISCARD
Definition: wined3d.h:1559
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ 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 3795 of file device.c.

3798{
3801
3802 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, "
3803 "discard %#x, surface %p, shared_handle %p, usage %#x.\n",
3804 iface, width, height, format, multisample_type, multisample_quality,
3805 discard, surface, shared_handle, usage);
3806
3808 {
3809 WARN("Invalid usage %#x.\n", usage);
3810 return D3DERR_INVALIDCALL;
3811 }
3812
3813 if (shared_handle)
3814 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
3815
3816 if (discard)
3818
3819 *surface = NULL;
3821 D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
3822}

◆ 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 1286 of file device.c.

1289{
1291 struct d3d9_indexbuffer *object;
1292 HRESULT hr;
1293
1294 TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p, shared_handle %p.\n",
1295 iface, size, usage, format, pool, buffer, shared_handle);
1296
1297 if (shared_handle)
1298 {
1299 if (!device->d3d_parent->extended)
1300 {
1301 WARN("Trying to create a shared index buffer on a non-ex device.\n");
1302 return E_NOTIMPL;
1303 }
1304
1305 if (pool != D3DPOOL_DEFAULT)
1306 {
1307 WARN("Trying to create a shared index buffer in pool %#x.\n", pool);
1308 return D3DERR_NOTAVAILABLE;
1309 }
1310 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1311 }
1312
1313 if (!(object = heap_alloc_zero(sizeof(*object))))
1315
1317 if (FAILED(hr))
1318 {
1319 WARN("Failed to initialize index buffer, hr %#x.\n", hr);
1320 heap_free(object);
1321 return hr;
1322 }
1323
1324 TRACE("Created index buffer %p.\n", object);
1325 *buffer = &object->IDirect3DIndexBuffer9_iface;
1326
1327 return D3D_OK;
1328}
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: buffer.c:570
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:84

◆ 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 1733 of file device.c.

1736{
1738 void *user_mem = NULL;
1739
1740 TRACE("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p.\n",
1741 iface, width, height, format, pool, surface, shared_handle);
1742
1743 *surface = NULL;
1744 if (pool == D3DPOOL_MANAGED)
1745 {
1746 WARN("Attempting to create a managed offscreen plain surface.\n");
1747 return D3DERR_INVALIDCALL;
1748 }
1749
1750 if (shared_handle)
1751 {
1752 if (!device->d3d_parent->extended)
1753 {
1754 WARN("Trying to create a shared or user memory surface on a non-ex device.\n");
1755 return E_NOTIMPL;
1756 }
1757
1758 if (pool == D3DPOOL_SYSTEMMEM)
1759 user_mem = *shared_handle;
1760 else
1761 {
1762 if (pool != D3DPOOL_DEFAULT)
1763 {
1764 WARN("Trying to create a shared surface in pool %#x.\n", pool);
1765 return D3DERR_INVALIDCALL;
1766 }
1767 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1768 }
1769 }
1770
1771 /* FIXME: Offscreen surfaces are supposed to be always lockable,
1772 * regardless of the pool they're created in. Should we set dynamic usage
1773 * here? */
1775 WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem);
1776}
@ D3DMULTISAMPLE_NONE
Definition: d3d8types.h:672
@ D3DPOOL_SYSTEMMEM
Definition: d3d8types.h:711
@ D3DPOOL_MANAGED
Definition: d3d8types.h:710

◆ 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 3785 of file device.c.

3788{
3789 FIXME("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p, usage %#x stub!\n",
3790 iface, width, height, format, pool, surface, shared_handle, usage);
3791
3792 return E_NOTIMPL;
3793}

◆ d3d9_device_CreatePixelShader()

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

Definition at line 3430 of file device.c.

3432{
3434 struct d3d9_pixelshader *object;
3435 HRESULT hr;
3436
3437 TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
3438
3439 if (!(object = heap_alloc_zero(sizeof(*object))))
3440 {
3441 FIXME("Failed to allocate pixel shader memory.\n");
3442 return E_OUTOFMEMORY;
3443 }
3444
3445 hr = pixelshader_init(object, device, byte_code);
3446 if (FAILED(hr))
3447 {
3448 WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
3449 heap_free(object);
3450 return hr;
3451 }
3452
3453 TRACE("Created pixel shader %p.\n", object);
3454 *shader = &object->IDirect3DPixelShader9_iface;
3455
3456 return D3D_OK;
3457}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLuint shader
Definition: glext.h:6030
HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN
Definition: shader.c:291

◆ d3d9_device_CreateQuery()

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

Definition at line 3618 of file device.c.

3619{
3621 struct d3d9_query *object;
3622 HRESULT hr;
3623
3624 TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
3625
3626 if (!(object = heap_alloc_zero(sizeof(*object))))
3627 return E_OUTOFMEMORY;
3628
3629 hr = query_init(object, device, type);
3630 if (FAILED(hr))
3631 {
3632 WARN("Failed to initialize query, hr %#x.\n", hr);
3633 heap_free(object);
3634 return hr;
3635 }
3636
3637 TRACE("Created query %p.\n", object);
3638 if (query) *query = &object->IDirect3DQuery9_iface;
3639 else IDirect3DQuery9_Release(&object->IDirect3DQuery9_iface);
3640
3641 return D3D_OK;
3642}
#define IDirect3DQuery9_Release(p)
Definition: d3d9.h:1343
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type) DECLSPEC_HIDDEN
Definition: query.c:184

◆ 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 1405 of file device.c.

1408{
1410 DWORD flags = 0;
1411
1412 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n"
1413 "lockable %#x, surface %p, shared_handle %p.\n",
1414 iface, width, height, format, multisample_type, multisample_quality,
1415 lockable, surface, shared_handle);
1416
1417 *surface = NULL;
1418 if (shared_handle)
1419 {
1420 if (!device->d3d_parent->extended)
1421 {
1422 WARN("Trying to create a shared render target on a non-ex device.\n");
1423 return E_NOTIMPL;
1424 }
1425
1426 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1427 }
1428
1429 if (lockable)
1431
1433 D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
1434}
#define D3DUSAGE_RENDERTARGET
Definition: d3d8types.h:91

◆ 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 3769 of file device.c.

3772{
3773 FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, "
3774 "lockable %#x, surface %p, shared_handle %p, usage %#x stub!\n",
3775 iface, width, height, format, multisample_type, multisample_quality,
3776 lockable, surface, shared_handle, usage);
3777
3778 *surface = NULL;
3779 if (shared_handle)
3780 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
3781
3782 return E_NOTIMPL;
3783}

◆ d3d9_device_CreateStateBlock()

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

Definition at line 2208 of file device.c.

2210{
2212 struct d3d9_stateblock *object;
2213 HRESULT hr;
2214
2215 TRACE("iface %p, type %#x, stateblock %p.\n", iface, type, stateblock);
2216
2218 {
2219 WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL.\n");
2220 return D3DERR_INVALIDCALL;
2221 }
2222
2223 if (!(object = heap_alloc_zero(sizeof(*object))))
2224 return E_OUTOFMEMORY;
2225
2226 hr = stateblock_init(object, device, type, NULL);
2227 if (FAILED(hr))
2228 {
2229 WARN("Failed to initialize stateblock, hr %#x.\n", hr);
2230 heap_free(object);
2231 return hr;
2232 }
2233
2234 TRACE("Created stateblock %p.\n", object);
2235 *stateblock = &object->IDirect3DStateBlock9_iface;
2236
2237 return D3D_OK;
2238}
@ D3DSBT_PIXELSTATE
Definition: d3d8types.h:831
@ D3DSBT_ALL
Definition: d3d8types.h:830
@ D3DSBT_VERTEXSTATE
Definition: d3d8types.h:832
HRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device *device, D3DSTATEBLOCKTYPE type, struct wined3d_stateblock *wined3d_stateblock) DECLSPEC_HIDDEN
Definition: stateblock.c:134

◆ 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 1090 of file device.c.

1093{
1095 struct d3d9_texture *object;
1096 BOOL set_mem = FALSE;
1097 HRESULT hr;
1098
1099 TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1100 iface, width, height, levels, usage, format, pool, texture, shared_handle);
1101
1102 *texture = NULL;
1103 if (shared_handle)
1104 {
1105 if (!device->d3d_parent->extended)
1106 {
1107 WARN("Trying to create a shared or user memory texture on a non-ex device.\n");
1108 return E_NOTIMPL;
1109 }
1110
1111 if (pool == D3DPOOL_SYSTEMMEM)
1112 {
1113 if (levels != 1)
1114 return D3DERR_INVALIDCALL;
1115 set_mem = TRUE;
1116 }
1117 else
1118 {
1119 if (pool != D3DPOOL_DEFAULT)
1120 {
1121 WARN("Trying to create a shared texture in pool %#x.\n", pool);
1122 return D3DERR_INVALIDCALL;
1123 }
1124 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1125 }
1126 }
1127
1128 if (!(object = heap_alloc_zero(sizeof(*object))))
1130
1132 if (FAILED(hr))
1133 {
1134 WARN("Failed to initialize texture, hr %#x.\n", hr);
1135 heap_free(object);
1136 return hr;
1137 }
1138
1139 if (set_mem)
1142 *shared_handle, 0);
1143
1144 TRACE("Created texture %p.\n", object);
1145 *texture = (IDirect3DTexture9 *)&object->IDirect3DBaseTexture9_iface;
1146
1147 return D3D_OK;
1148}
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
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:554

◆ 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 1242 of file device.c.

1245{
1247 struct d3d9_vertexbuffer *object;
1248 HRESULT hr;
1249
1250 TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p, shared_handle %p.\n",
1251 iface, size, usage, fvf, pool, buffer, shared_handle);
1252
1253 if (shared_handle)
1254 {
1255 if (!device->d3d_parent->extended)
1256 {
1257 WARN("Trying to create a shared vertex buffer on a non-ex device.\n");
1258 return E_NOTIMPL;
1259 }
1260
1261 if (pool != D3DPOOL_DEFAULT)
1262 {
1263 WARN("Trying to create a shared vertex buffer in pool %#x.\n", pool);
1264 return D3DERR_NOTAVAILABLE;
1265 }
1266 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1267 }
1268
1269 if (!(object = heap_alloc_zero(sizeof(*object))))
1271
1272 hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
1273 if (FAILED(hr))
1274 {
1275 WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
1276 heap_free(object);
1277 return hr;
1278 }
1279
1280 TRACE("Created vertex buffer %p.\n", object);
1281 *buffer = &object->IDirect3DVertexBuffer9_iface;
1282
1283 return D3D_OK;
1284}
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
Definition: buffer.c:273

◆ d3d9_device_CreateVertexDeclaration()

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

Definition at line 2947 of file device.c.

2949{
2952 HRESULT hr;
2953
2954 TRACE("iface %p, elements %p, declaration %p.\n", iface, elements, declaration);
2955
2956 if (!declaration)
2957 {
2958 WARN("Caller passed a NULL declaration, returning D3DERR_INVALIDCALL.\n");
2959 return D3DERR_INVALIDCALL;
2960 }
2961
2963 *declaration = &object->IDirect3DVertexDeclaration9_iface;
2964
2965 return hr;
2966}
D3DVERTEXELEMENT9 * elements
Definition: d3d9_private.h:242
HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration) DECLSPEC_HIDDEN

◆ d3d9_device_CreateVertexShader()

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

Definition at line 3133 of file device.c.

3135{
3137 struct d3d9_vertexshader *object;
3138 HRESULT hr;
3139
3140 TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
3141
3142 if (!(object = heap_alloc_zero(sizeof(*object))))
3143 return E_OUTOFMEMORY;
3144
3145 hr = vertexshader_init(object, device, byte_code);
3146 if (FAILED(hr))
3147 {
3148 WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
3149 heap_free(object);
3150 return hr;
3151 }
3152
3153 TRACE("Created vertex shader %p.\n", object);
3154 *shader = &object->IDirect3DVertexShader9_iface;
3155
3156 return D3D_OK;
3157}
HRESULT vertexshader_init(struct d3d9_vertexshader *shader, struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN
Definition: shader.c:137

◆ 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 1150 of file device.c.

1153{
1155 struct d3d9_texture *object;
1156 HRESULT hr;
1157
1158 TRACE("iface %p, width %u, height %u, depth %u, levels %u, "
1159 "usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1160 iface, width, height, depth, levels,
1161 usage, format, pool, texture, shared_handle);
1162
1163 *texture = NULL;
1164 if (shared_handle)
1165 {
1166 if (!device->d3d_parent->extended)
1167 {
1168 WARN("Trying to create a shared volume texture on a non-ex device.\n");
1169 return E_NOTIMPL;
1170 }
1171
1172 if (pool != D3DPOOL_DEFAULT)
1173 {
1174 WARN("Trying to create a shared volume texture in pool %#x.\n", pool);
1175 return D3DERR_INVALIDCALL;
1176 }
1177 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1178 }
1179
1180 if (!(object = heap_alloc_zero(sizeof(*object))))
1182
1184 if (FAILED(hr))
1185 {
1186 WARN("Failed to initialize volume texture, hr %#x.\n", hr);
1187 heap_free(object);
1188 return hr;
1189 }
1190
1191 TRACE("Created volume texture %p.\n", object);
1192 *texture = (IDirect3DVolumeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1193
1194 return D3D_OK;
1195}
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 depth
Definition: gl.h:1546

◆ d3d9_device_DeletePatch()

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

Definition at line 3612 of file device.c.

3613{
3614 FIXME("iface %p, handle %#x unimplemented.\n", iface, handle);
3615 return D3DERR_INVALIDCALL;
3616}

◆ 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 2649 of file device.c.

2652{
2654 HRESULT hr;
2655
2656 TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u, "
2657 "vertex_count %u, start_idx %u, primitive_count %u.\n",
2658 iface, primitive_type, base_vertex_idx, min_vertex_idx,
2659 vertex_count, start_idx, primitive_count);
2660
2662 if (!device->has_vertex_declaration)
2663 {
2665 WARN("Called without a valid vertex declaration set.\n");
2666 return D3DERR_INVALIDCALL;
2667 }
2669 wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx);
2670 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2671 hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx,
2672 vertex_count_from_primitive_count(primitive_type, primitive_count));
2673 if (SUCCEEDED(hr))
2676
2677 return hr;
2678}
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:167
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:2613
void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index)
Definition: device.c:1917
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
Definition: device.c:3769
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:3717
int vertex_count
Definition: d3drm.c:3367

◆ 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 2822 of file device.c.

2826{
2827 UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2829 UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
2830 UINT vtx_size = vertex_count * vertex_stride;
2831 UINT idx_size = idx_count * idx_fmt_size;
2833 struct wined3d_box wined3d_box = {0};
2834 struct wined3d_resource *ib, *vb;
2835 UINT vb_pos, ib_pos, align;
2836 HRESULT hr;
2837
2838 TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
2839 "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
2840 iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
2841 index_data, index_format, vertex_data, vertex_stride);
2842
2843 if (!primitive_count)
2844 {
2845 WARN("primitive_count is 0, returning D3D_OK.\n");
2846 return D3D_OK;
2847 }
2848
2850
2851 if (!device->has_vertex_declaration)
2852 {
2854 WARN("Called without a valid vertex declaration set.\n");
2855 return D3DERR_INVALIDCALL;
2856 }
2857
2859 if (FAILED(hr))
2860 goto done;
2861
2862 vb_pos = device->vertex_buffer_pos;
2863 align = vb_pos % vertex_stride;
2864 if (align) align = vertex_stride - align;
2865 if (vb_pos + vtx_size + align > device->vertex_buffer_size)
2866 vb_pos = 0;
2867 else
2868 vb_pos += align;
2869
2870 wined3d_box.left = vb_pos;
2871 wined3d_box.right = vb_pos + vtx_size;
2872 vb = wined3d_buffer_get_resource(device->vertex_buffer);
2875 goto done;
2876 memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
2878 device->vertex_buffer_pos = vb_pos + vtx_size;
2879
2881 if (FAILED(hr))
2882 goto done;
2883
2884 ib_pos = device->index_buffer_pos;
2885 align = ib_pos % idx_fmt_size;
2886 if (align) align = idx_fmt_size - align;
2887 if (ib_pos + idx_size + align > device->index_buffer_size)
2888 ib_pos = 0;
2889 else
2890 ib_pos += align;
2891
2892 wined3d_box.left = ib_pos;
2893 wined3d_box.right = ib_pos + idx_size;
2894 ib = wined3d_buffer_get_resource(device->index_buffer);
2897 goto done;
2900 device->index_buffer_pos = ib_pos + idx_size;
2901
2902 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, vertex_stride);
2903 if (FAILED(hr))
2904 goto done;
2905
2907 wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
2908 wined3dformat_from_d3dformat(index_format), 0);
2909 wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
2910
2911 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2912 hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
2913
2914 wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2916 wined3d_device_set_base_vertex_index(device->wined3d_device, 0);
2917
2918 if (SUCCEEDED(hr))
2920
2921done:
2923 return hr;
2924}
@ D3DFMT_INDEX16
Definition: d3d8types.h:649
static HRESULT d3d9_device_prepare_index_buffer(struct d3d9_device *device, UINT min_size)
Definition: device.c:2786
static HRESULT d3d9_device_prepare_vertex_buffer(struct d3d9_device *device, UINT min_size)
Definition: device.c:2681
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
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:1874
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:1378
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
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:344
int align(int length, int align)
Definition: dsound8.c:36
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT left
Definition: wined3d.h:1839
UINT right
Definition: wined3d.h:1841
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:107
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:935
#define WINED3D_MAP_WRITE
Definition: wined3d.h:938
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:934

◆ d3d9_device_DrawPrimitive()

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

Definition at line 2622 of file device.c.

2624{
2626 HRESULT hr;
2627
2628 TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
2629 iface, primitive_type, start_vertex, primitive_count);
2630
2632 if (!device->has_vertex_declaration)
2633 {
2635 WARN("Called without a valid vertex declaration set.\n");
2636 return D3DERR_INVALIDCALL;
2637 }
2639 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2640 hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex,
2641 vertex_count_from_primitive_count(primitive_type, primitive_count));
2642 if (SUCCEEDED(hr))
2645
2646 return hr;
2647}
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3740

◆ 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 2717 of file device.c.

2719{
2721 HRESULT hr;
2722 UINT vtx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2724 struct wined3d_box wined3d_box = {0};
2725 UINT size = vtx_count * stride;
2726 struct wined3d_resource *vb;
2727 UINT vb_pos, align;
2728
2729 TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
2730 iface, primitive_type, primitive_count, data, stride);
2731
2732 if (!primitive_count)
2733 {
2734 WARN("primitive_count is 0, returning D3D_OK\n");
2735 return D3D_OK;
2736 }
2737
2739
2740 if (!device->has_vertex_declaration)
2741 {
2743 WARN("Called without a valid vertex declaration set.\n");
2744 return D3DERR_INVALIDCALL;
2745 }
2746
2748 if (FAILED(hr))
2749 goto done;
2750
2751 vb_pos = device->vertex_buffer_pos;
2752 align = vb_pos % stride;
2753 if (align) align = stride - align;
2754 if (vb_pos + size + align > device->vertex_buffer_size)
2755 vb_pos = 0;
2756 else
2757 vb_pos += align;
2758
2759 wined3d_box.left = vb_pos;
2760 wined3d_box.right = vb_pos + size;
2761 vb = wined3d_buffer_get_resource(device->vertex_buffer);
2764 goto done;
2767 device->vertex_buffer_pos = vb_pos + size;
2768
2769 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
2770 if (FAILED(hr))
2771 goto done;
2772
2774 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2775 hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count);
2776 wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2777 if (SUCCEEDED(hr))
2779
2780done:
2782 return hr;
2783}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei stride
Definition: glext.h:5848

◆ 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 3596 of file device.c.

3598{
3599 FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3600 iface, handle, segment_count, patch_info);
3601 return D3D_OK;
3602}

◆ 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 3604 of file device.c.

3606{
3607 FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3608 iface, handle, segment_count, patch_info);
3609 return D3D_OK;
3610}

◆ d3d9_device_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_EndScene ( IDirect3DDevice9Ex *  iface)
static

Definition at line 1916 of file device.c.

1917{
1919 HRESULT hr;
1920
1921 TRACE("iface %p.\n", iface);
1922
1924 if (SUCCEEDED(hr = wined3d_device_end_scene(device->wined3d_device)))
1925 device->in_scene = FALSE;
1927
1928 return hr;
1929}
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3617

◆ d3d9_device_EndStateBlock()

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

Definition at line 2254 of file device.c.

2255{
2258 struct d3d9_stateblock *object;
2259 HRESULT hr;
2260
2261 TRACE("iface %p, stateblock %p.\n", iface, stateblock);
2262
2266 if (FAILED(hr))
2267 {
2268 WARN("Failed to end the state block, hr %#x.\n", hr);
2269 return hr;
2270 }
2271
2272 if (!(object = heap_alloc_zero(sizeof(*object))))
2273 {
2277 return E_OUTOFMEMORY;
2278 }
2279
2281 if (FAILED(hr))
2282 {
2283 WARN("Failed to initialize stateblock, hr %#x.\n", hr);
2287 heap_free(object);
2288 return hr;
2289 }
2290
2291 TRACE("Created stateblock %p.\n", object);
2292 *stateblock = &object->IDirect3DStateBlock9_iface;
2293
2294 return D3D_OK;
2295}
HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock)
Definition: device.c:3577
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552

◆ d3d9_device_EvictManagedResources()

static HRESULT WINAPI d3d9_device_EvictManagedResources ( IDirect3DDevice9Ex *  iface)
static

Definition at line 606 of file device.c.

607{
609
610 TRACE("iface %p.\n", iface);
611
615
616 return D3D_OK;
617}
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4753

◆ d3d9_device_get_swapchains()

static HRESULT d3d9_device_get_swapchains ( struct d3d9_device device)
static

Definition at line 858 of file device.c.

859{
860 UINT i, new_swapchain_count = wined3d_device_get_swapchain_count(device->wined3d_device);
862
863 if (!(device->implicit_swapchains = heap_alloc(new_swapchain_count * sizeof(*device->implicit_swapchains))))
864 return E_OUTOFMEMORY;
865
866 for (i = 0; i < new_swapchain_count; ++i)
867 {
870 }
871 device->implicit_swapchain_count = new_swapchain_count;
872
873 return D3D_OK;
874}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
void *CDECL wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain)
Definition: swapchain.c:133

Referenced by d3d9_device_reset(), and device_init().

◆ d3d9_device_GetAvailableTextureMem()

static UINT WINAPI d3d9_device_GetAvailableTextureMem ( IDirect3DDevice9Ex *  iface)
static

Definition at line 592 of file device.c.

593{
595 UINT ret;
596
597 TRACE("iface %p.\n", iface);
598
602
603 return ret;
604}
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1298
int ret

◆ 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 1006 of file device.c.

1008{
1010 HRESULT hr;
1011
1012 TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
1013 iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer);
1014
1015 /* backbuffer_type is ignored by native. */
1016
1017 /* No need to check for backbuffer == NULL, Windows crashes in that case. */
1018 *backbuffer = NULL;
1019
1021 if (swapchain >= device->implicit_swapchain_count)
1022 {
1024 WARN("Swapchain index %u is out of range, returning D3DERR_INVALIDCALL.\n", swapchain);
1025 return D3DERR_INVALIDCALL;
1026 }
1027
1028 hr = IDirect3DSwapChain9Ex_GetBackBuffer(&device->implicit_swapchains[swapchain]->IDirect3DSwapChain9Ex_iface,
1029 backbuffer_idx, backbuffer_type, backbuffer);
1031
1032 return hr;
1033}
#define IDirect3DSwapChain9Ex_GetBackBuffer(p, a, b, c)
Definition: d3d9.h:501

◆ d3d9_device_GetClipPlane()

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

Definition at line 2164 of file device.c.

2165{
2167 HRESULT hr;
2168
2169 TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
2170
2171 index = min(index, device->max_user_clip_planes - 1);
2172
2174 hr = wined3d_device_get_clip_plane(device->wined3d_device, index, (struct wined3d_vec4 *)plane);
2176
2177 return hr;
2178}
HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane)
Definition: device.c:1811
GLuint index
Definition: glext.h:6031
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
#define min(a, b)
Definition: monoChain.cc:55

◆ d3d9_device_GetClipStatus()

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

Definition at line 2311 of file device.c.

2312{
2314 HRESULT hr;
2315
2316 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2317
2319 hr = wined3d_device_get_clip_status(device->wined3d_device, (struct wined3d_clip_status *)clip_status);
2321
2322 return hr;
2323}
HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device, struct wined3d_clip_status *clip_status)
Definition: device.c:1838

◆ d3d9_device_GetCreationParameters()

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

Definition at line 676 of file device.c.

678{
680
681 TRACE("iface %p, parameters %p.\n", iface, parameters);
682
685 (struct wined3d_device_creation_parameters *)parameters);
687
688 return D3D_OK;
689}
void CDECL wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *parameters)
Definition: device.c:5042

◆ d3d9_device_GetCurrentTexturePalette()

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

Definition at line 2524 of file device.c.

2525{
2526 FIXME("iface %p, palette_idx %p.\n", iface, palette_idx);
2527
2528 return D3DERR_INVALIDCALL;
2529}

◆ d3d9_device_GetDepthStencilSurface()

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

Definition at line 1870 of file device.c.

1871{
1873 struct wined3d_rendertarget_view *wined3d_dsv;
1874 struct d3d9_surface *surface_impl;
1875 HRESULT hr = D3D_OK;
1876
1877 TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
1878
1879 if (!depth_stencil)
1880 return D3DERR_INVALIDCALL;
1881
1883 if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
1884 {
1885 /* We want the sub resource parent here, since the view itself may be
1886 * internal to wined3d and may not have a parent. */
1887 surface_impl = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
1888 *depth_stencil = &surface_impl->IDirect3DSurface9_iface;
1889 IDirect3DSurface9_AddRef(*depth_stencil);
1890 }
1891 else
1892 {
1894 *depth_stencil = NULL;
1895 }
1897
1898 return hr;
1899}
struct wined3d_rendertarget_view *CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
Definition: device.c:4461
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
#define D3DERR_NOTFOUND
Definition: d3d8.h:80

◆ d3d9_device_GetDeviceCaps()

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

Definition at line 631 of file device.c.

632{
634 WINED3DCAPS wined3d_caps;
635 HRESULT hr;
636
637 TRACE("iface %p, caps %p.\n", iface, caps);
638
639 if (!caps)
640 return D3DERR_INVALIDCALL;
641
642 memset(caps, 0, sizeof(*caps));
643
645 hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps);
647
648 d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
649
650 return hr;
651}
void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps)
Definition: device.c:290
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3526
#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 619 of file device.c.

620{
622
623 TRACE("iface %p, d3d9 %p.\n", iface, d3d9);
624
625 if (!d3d9)
626 return D3DERR_INVALIDCALL;
627
628 return IDirect3D9Ex_QueryInterface(&device->d3d_parent->IDirect3D9Ex_iface, &IID_IDirect3D9, (void **)d3d9);
629}
#define IDirect3D9Ex_QueryInterface(p, a, b)
Definition: d3d9.h:307

◆ d3d9_device_GetDisplayMode()

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

Definition at line 653 of file device.c.

654{
656 struct wined3d_display_mode wined3d_mode;
657 HRESULT hr;
658
659 TRACE("iface %p, swapchain %u, mode %p.\n", iface, swapchain, mode);
660
662 hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain, &wined3d_mode, NULL);
664
665 if (SUCCEEDED(hr))
666 {
667 mode->Width = wined3d_mode.width;
668 mode->Height = wined3d_mode.height;
669 mode->RefreshRate = wined3d_mode.refresh_rate;
670 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
671 }
672
673 return hr;
674}
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:44
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:3541
GLenum mode
Definition: glext.h:6217

◆ d3d9_device_GetDisplayModeEx()

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

Definition at line 3849 of file device.c.

3851{
3853 struct wined3d_display_mode wined3d_mode;
3854 HRESULT hr;
3855
3856 TRACE("iface %p, swapchain_idx %u, mode %p, rotation %p.\n",
3857 iface, swapchain_idx, mode, rotation);
3858
3859 if (mode->Size != sizeof(*mode))
3860 return D3DERR_INVALIDCALL;
3861
3863 hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain_idx, &wined3d_mode,
3864 (enum wined3d_display_rotation *)rotation);
3866
3867 if (SUCCEEDED(hr))
3868 {
3869 mode->Width = wined3d_mode.width;
3870 mode->Height = wined3d_mode.height;
3871 mode->RefreshRate = wined3d_mode.refresh_rate;
3872 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
3873 mode->ScanLineOrdering = wined3d_mode.scanline_ordering;
3874 }
3875
3876 return hr;
3877}
wined3d_display_rotation
Definition: wined3d.h:838

◆ d3d9_device_GetFrontBufferData()

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

Definition at line 1569 of file device.c.

1571{
1573 struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1575
1576 TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, swapchain, dst_surface);
1577
1579 if (swapchain < device->implicit_swapchain_count)
1580 hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchains[swapchain]->wined3d_swapchain,
1581 dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
1583
1584 return hr;
1585}
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:194

◆ d3d9_device_GetFVF()

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

Definition at line 3108 of file device.c.

3109{
3111 struct wined3d_vertex_declaration *wined3d_declaration;
3112 struct d3d9_vertex_declaration *d3d9_declaration;
3113
3114 TRACE("iface %p, fvf %p.\n", iface, fvf);
3115
3118 {
3120 *fvf = d3d9_declaration->fvf;
3121 }
3122 else
3123 {
3124 *fvf = 0;
3125 }
3127
3128 TRACE("Returning FVF %#x.\n", *fvf);
3129
3130 return D3D_OK;
3131}
struct wined3d_vertex_declaration *CDECL wined3d_device_get_vertex_declaration(const struct wined3d_device *device)
Definition: device.c:2179
struct wined3d_vertex_declaration * wined3d_declaration
Definition: d3d9_private.h:244
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 1078 of file device.c.

1079{
1081
1082 TRACE("iface %p, swapchain %u, ramp %p.\n", iface, swapchain, ramp);
1083
1084 /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
1086 wined3d_device_get_gamma_ramp(device->wined3d_device, swapchain, (struct wined3d_gamma_ramp *)ramp);
1088}
void CDECL wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp)
Definition: device.c:5069
static const BYTE ramp[17]
Definition: dib.c:2709

◆ d3d9_device_GetGPUThreadPriority()

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

Definition at line 3698 of file device.c.

3699{
3700 FIXME("iface %p, priority %p stub!\n", iface, priority);
3701
3702 return E_NOTIMPL;
3703}
static int priority
Definition: timer.c:163

◆ d3d9_device_GetIndices()

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

Definition at line 3402 of file device.c.

3403{
3407 struct d3d9_indexbuffer *buffer_impl;
3408
3409 TRACE("iface %p, buffer %p.\n", iface, buffer);
3410
3411 if (!buffer)
3412 return D3DERR_INVALIDCALL;
3413
3416 {
3418 *buffer = &buffer_impl->IDirect3DIndexBuffer9_iface;
3420 }
3421 else
3422 {
3423 *buffer = NULL;
3424 }
3426
3427 return D3D_OK;
3428}
#define IDirect3DIndexBuffer9_AddRef(p)
Definition: d3d9.h:763
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:807
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:1906
IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface
Definition: d3d9_private.h:193
wined3d_format_id
Definition: wined3d.h:106

◆ d3d9_device_GetLight()

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

Definition at line 2105 of file device.c.

2106{
2108 HRESULT hr;
2109
2110 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
2111
2112 /* Note: D3DLIGHT9 is compatible with struct wined3d_light. */
2114 hr = wined3d_device_get_light(device->wined3d_device, index, (struct wined3d_light *)light);
2116
2117 return hr;
2118}
HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, struct wined3d_light *light)
Definition: device.c:1724
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

◆ d3d9_device_GetLightEnable()

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

Definition at line 2134 of file device.c.

2135{
2137 HRESULT hr;
2138
2139 TRACE("iface %p, index %u, enable %p.\n", iface, index, enable);
2140
2144
2145 return hr;
2146}
HRESULT CDECL wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable)
Definition: device.c:1767
GLboolean enable
Definition: glext.h:11120

◆ d3d9_device_GetMaterial()

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

Definition at line 2076 of file device.c.

2077{
2079
2080 TRACE("iface %p, material %p.\n", iface, material);
2081
2082 /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
2084 wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
2086
2087 return D3D_OK;
2088}
void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
Definition: device.c:1861

◆ d3d9_device_GetMaximumFrameLatency()

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

Definition at line 3738 of file device.c.

3739{
3740 FIXME("iface %p, max_latency %p stub!\n", iface, max_latency);
3741
3742 *max_latency = 2;
3743
3744 return E_NOTIMPL;
3745}

◆ d3d9_device_GetNPatchMode()

static float WINAPI d3d9_device_GetNPatchMode ( IDirect3DDevice9Ex *  iface)
static

Definition at line 2598 of file device.c.

2599{
2601 float ret;
2602
2603 TRACE("iface %p.\n", iface);
2604
2606 ret = wined3d_device_get_npatch_mode(device->wined3d_device);
2608
2609 return ret;
2610}
float CDECL wined3d_device_get_npatch_mode(const struct wined3d_device *device)
Definition: device.c:4013

◆ d3d9_device_GetNumberOfSwapChains()

static UINT WINAPI d3d9_device_GetNumberOfSwapChains ( IDirect3DDevice9Ex *  iface)
static

Definition at line 811 of file device.c.

812{
814 UINT count;
815
816 TRACE("iface %p.\n", iface);
817
821
822 return count;
823}

◆ d3d9_device_GetPaletteEntries()

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

Definition at line 2509 of file device.c.

2511{
2512 FIXME("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2513
2514 return D3DERR_INVALIDCALL;
2515}

◆ d3d9_device_GetPixelShader()

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

Definition at line 3474 of file device.c.

3475{
3477 struct d3d9_pixelshader *shader_impl;
3479
3480 TRACE("iface %p, shader %p.\n", iface, shader);
3481
3482 if (!shader) return D3DERR_INVALIDCALL;
3483
3485 if ((wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device)))
3486 {
3488 *shader = &shader_impl->IDirect3DPixelShader9_iface;
3490 }
3491 else
3492 {
3493 *shader = NULL;
3494 }
3496
3497 TRACE("Returning %p.\n", *shader);
3498
3499 return D3D_OK;
3500}
#define IDirect3DPixelShader9_AddRef(p)
Definition: d3d9.h:1260
struct wined3d_shader *CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
Definition: device.c:2530
void *CDECL wined3d_shader_get_parent(const struct wined3d_shader *shader)
Definition: shader.c:3379
IDirect3DPixelShader9 IDirect3DPixelShader9_iface
Definition: d3d9_private.h:268

◆ d3d9_device_GetPixelShaderConstantB()

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

Definition at line 3581 of file device.c.

3583{
3585 HRESULT hr;
3586
3587 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3588
3590 hr = wined3d_device_get_ps_consts_b(device->wined3d_device, reg_idx, count, data);
3592
3593 return hr;
3594}
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:2614

◆ d3d9_device_GetPixelShaderConstantF()

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

Definition at line 3518 of file device.c.

3520{
3522 HRESULT hr;
3523
3524 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3525
3527 hr = wined3d_device_get_ps_consts_f(device->wined3d_device,
3528 reg_idx, count, (struct wined3d_vec4 *)data);
3530
3531 return hr;
3532}
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:2708

◆ d3d9_device_GetPixelShaderConstantI()

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

Definition at line 3550 of file device.c.

3552{
3554 HRESULT hr;
3555
3556 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3557
3559 hr = wined3d_device_get_ps_consts_i(device->wined3d_device,
3560 reg_idx, count, (struct wined3d_ivec4 *)data);
3562
3563 return hr;
3564}
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:2663

◆ d3d9_device_GetRasterStatus()

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

Definition at line 1035 of file device.c.

1037{
1039 HRESULT hr;
1040
1041 TRACE("iface %p, swapchain %u, raster_status %p.\n", iface, swapchain, raster_status);
1042
1044 hr = wined3d_device_get_raster_status(device->wined3d_device,
1045 swapchain, (struct wined3d_raster_status *)raster_status);
1047
1048 return hr;
1049}
HRESULT CDECL wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status)
Definition: device.c:3981

◆ d3d9_device_GetRenderState()

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

Definition at line 2194 of file device.c.

2196{
2198
2199 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2200
2204
2205 return D3D_OK;
2206}
static int state
Definition: maze.c:121
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2064
Definition: pdh_main.c:94

◆ d3d9_device_GetRenderTarget()

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

Definition at line 1816 of file device.c.

1817{
1819 struct wined3d_rendertarget_view *wined3d_rtv;
1820 struct d3d9_surface *surface_impl;
1821 HRESULT hr = D3D_OK;
1822
1823 TRACE("iface %p, idx %u, surface %p.\n", iface, idx, surface);
1824
1825 if (!surface)
1826 return D3DERR_INVALIDCALL;
1827
1829 {
1830 WARN("Invalid index %u specified.\n", idx);
1831 return D3DERR_INVALIDCALL;
1832 }
1833
1836 {
1837 /* We want the sub resource parent here, since the view itself may be
1838 * internal to wined3d and may not have a parent. */
1840 *surface = &surface_impl->IDirect3DSurface9_iface;
1841 IDirect3DSurface9_AddRef(*surface);
1842 }
1843 else
1844 {
1846 *surface = NULL;
1847 }
1849
1850 return hr;
1851}
#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS
Definition: d3d9types.h:184
struct wined3d_rendertarget_view *CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, unsigned int view_idx)
Definition: device.c:4447
unsigned int idx
Definition: utils.c:41
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164

◆ d3d9_device_GetRenderTargetData()

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

Definition at line 1537 of file device.c.

1539{
1540 struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target);
1541 struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1542 struct wined3d_sub_resource_desc wined3d_desc;
1543 RECT dst_rect, src_rect;
1544 HRESULT hr;
1545
1546 TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface);
1547
1548 if (!render_target || !dst_surface)
1549 return D3DERR_INVALIDCALL;
1550
1552 wined3d_texture_get_sub_resource_desc(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &wined3d_desc);
1553 SetRect(&dst_rect, 0, 0, wined3d_desc.width, wined3d_desc.height);
1554
1556 SetRect(&src_rect, 0, 0, wined3d_desc.width, wined3d_desc.height);
1557
1558 /* TODO: Check surface sizes, pools, etc. */
1559 if (wined3d_desc.multisample_type)
1561 else
1562 hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect,
1563 rt_impl->wined3d_texture, rt_impl->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT);
1565
1566 return hr;
1567}
HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: texture.c:3262
@ WINED3D_TEXF_POINT
Definition: wined3d.h:686
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ d3d9_device_GetSamplerState()

static HRESULT WINAPI d3d9_device_GetSamplerState ( IDirect3DDevice9Ex *  iface,
DWORD  sampler,
D3DSAMPLERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2454 of file device.c.

2456{
2458
2459 TRACE("iface %p, sampler %u, state %#x, value %p.\n", iface, sampler, state, value);
2460
2464
2465 return D3D_OK;
2466}
DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state)
Definition: device.c:2108
GLuint sampler
Definition: glext.h:7283

◆ d3d9_device_GetScissorRect()

static HRESULT WINAPI d3d9_device_GetScissorRect ( IDirect3DDevice9Ex *  iface,
RECT rect 
)
static

Definition at line 2544 of file device.c.

2545{
2547
2548 TRACE("iface %p, rect %p.\n", iface, rect);
2549
2553
2554 return D3D_OK;
2555}
void CDECL wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect)
Definition: device.c:2149

◆ d3d9_device_GetSoftwareVertexProcessing()

static BOOL WINAPI d3d9_device_GetSoftwareVertexProcessing ( IDirect3DDevice9Ex *  iface)
static

Definition at line 2570 of file device.c.

2571{
2573 BOOL ret;
2574
2575 TRACE("iface %p.\n", iface);
2576
2580
2581 return ret;
2582}
BOOL CDECL wined3d_device_get_software_vertex_processing(const struct wined3d_device *device)
Definition: device.c:3974

◆ d3d9_device_GetStreamSource()

static HRESULT WINAPI d3d9_device_GetStreamSource ( IDirect3DDevice9Ex *  iface,
UINT  stream_idx,
IDirect3DVertexBuffer9 **  buffer,
UINT offset,
UINT stride 
)
static

Definition at line 3326 of file device.c.

3328{
3330 struct d3d9_vertexbuffer *buffer_impl;
3332 HRESULT hr;
3333
3334 TRACE("iface %p, stream_idx %u, buffer %p, offset %p, stride %p.\n",
3335 iface, stream_idx, buffer, offset, stride);
3336
3337 if (!buffer)
3338 return D3DERR_INVALIDCALL;
3339
3341 hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, offset, stride);
3342 if (SUCCEEDED(hr) && wined3d_buffer)
3343 {
3345 *buffer = &buffer_impl->IDirect3DVertexBuffer9_iface;
3347 }
3348 else
3349 {
3350 if (FAILED(hr))
3351 FIXME("Call to GetStreamSource failed %p %p\n", offset, stride);
3352 *buffer = NULL;
3353 }
3355
3356 return hr;
3357}
#define IDirect3DVertexBuffer9_AddRef(p)
Definition: d3d9.h:695
HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride)
Definition: device.c:1428
GLintptr offset
Definition: glext.h:5920
IDirect3DVertexBuffer9 IDirect3DVertexBuffer9_iface
Definition: d3d9_private.h:180

◆ d3d9_device_GetStreamSourceFreq()

static HRESULT WINAPI d3d9_device_GetStreamSourceFreq ( IDirect3DDevice9Ex *  iface,
UINT  stream_idx,
UINT freq 
)
static

Definition at line 3373 of file device.c.

3374{
3376 HRESULT hr;
3377
3378 TRACE("iface %p, stream_idx %u, freq %p.\n", iface, stream_idx, freq);
3379
3381 hr = wined3d_device_get_stream_source_freq(device->wined3d_device, stream_idx, freq);
3383
3384 return hr;
3385}
HRESULT CDECL wined3d_device_get_stream_source_freq(const struct wined3d_device *device, UINT stream_idx, UINT *divider)
Definition: device.c:1490

◆ d3d9_device_GetSwapChain()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_GetSwapChain ( IDirect3DDevice9Ex *  iface,
UINT  swapchain_idx,
IDirect3DSwapChain9 **  swapchain 
)
static

Definition at line 786 of file device.c.

788{
790 HRESULT hr;
791
792 TRACE("iface %p, swapchain_idx %u, swapchain %p.\n", iface, swapchain_idx, swapchain);
793
795 if (swapchain_idx < device->implicit_swapchain_count)
796 {
797 *swapchain = (IDirect3DSwapChain9 *)&device->implicit_swapchains[swapchain_idx]->IDirect3DSwapChain9Ex_iface;
799 hr = D3D_OK;
800 }
801 else
802 {
803 *swapchain = NULL;
805 }
807
808 return hr;
809}
#define IDirect3DSwapChain9Ex_AddRef(p)
Definition: d3d9.h:496
UINT implicit_swapchain_count
Definition: d3d9_private.h:112

◆ d3d9_device_GetTexture()

static HRESULT WINAPI d3d9_device_GetTexture ( IDirect3DDevice9Ex *  iface,
DWORD  stage,
IDirect3DBaseTexture9 **  texture 
)
static

Definition at line 2325 of file device.c.

2326{
2329 struct d3d9_texture *texture_impl;
2330
2331 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
2332
2333 if (!texture)
2334 return D3DERR_INVALIDCALL;
2335
2337 if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage)))
2338 {
2340 *texture = &texture_impl->IDirect3DBaseTexture9_iface;
2342 }
2343 else
2344 {
2345 *texture = NULL;
2346 }
2348
2349 return D3D_OK;
2350}
#define IDirect3DBaseTexture9_AddRef(p)
Definition: d3d9.h:834
struct wined3d_texture *CDECL wined3d_device_get_texture(const struct wined3d_device *device, UINT stage)
Definition: device.c:3510
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface
Definition: d3d9_private.h:206

◆ d3d9_device_GetTextureStageState()

static HRESULT WINAPI d3d9_device_GetTextureStageState ( IDirect3DDevice9Ex *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD value 
)
static

Definition at line 2414 of file device.c.

2416{
2418
2419 TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, state, value);
2420
2421 if (state >= ARRAY_SIZE(tss_lookup))
2422 {
2423 WARN("Invalid state %#x passed.\n", state);
2424 return D3D_OK;
2425 }
2426
2430
2431 return D3D_OK;
2432}
#define ARRAY_SIZE(A)
Definition: main.h:33
DWORD CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device, UINT stage, enum wined3d_texture_stage_state state)
Definition: device.c:3447

◆ d3d9_device_GetTransform()

static HRESULT WINAPI d3d9_device_GetTransform ( IDirect3DDevice9Ex *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 1990 of file device.c.

1992{
1994
1995 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
1996
1997 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
1999 wined3d_device_get_transform(device->wined3d_device, state, (struct wined3d_matrix *)matrix);
2001
2002 return D3D_OK;
2003}
void CDECL wined3d_device_get_transform(const struct wined3d_device *device, enum wined3d_transform_state state, struct wined3d_matrix *matrix)
Definition: device.c:1540
GLuint GLenum matrix
Definition: glext.h:9407

◆ d3d9_device_GetVertexDeclaration()

static HRESULT WINAPI d3d9_device_GetVertexDeclaration ( IDirect3DDevice9Ex *  iface,
IDirect3DVertexDeclaration9 **  declaration 
)
static

Definition at line 2985 of file device.c.

2987{
2989 struct wined3d_vertex_declaration *wined3d_declaration;
2990 struct d3d9_vertex_declaration *declaration_impl;
2991
2992 TRACE("iface %p, declaration %p.\n", iface, declaration);
2993
2994 if (!declaration) return D3DERR_INVALIDCALL;
2995
2998 {
3000 *declaration = &declaration_impl->IDirect3DVertexDeclaration9_iface;
3002 }
3003 else
3004 {
3005 *declaration = NULL;
3006 }
3008
3009 TRACE("Returning %p.\n", *declaration);
3010 return D3D_OK;
3011}
#define IDirect3DVertexDeclaration9_AddRef(p)
Definition: d3d9.h:1184
IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9_iface
Definition: d3d9_private.h:240

◆ d3d9_device_GetVertexShader()

static HRESULT WINAPI d3d9_device_GetVertexShader ( IDirect3DDevice9Ex *  iface,
IDirect3DVertexShader9 **  shader 
)
static

Definition at line 3174 of file device.c.

3175{
3177 struct d3d9_vertexshader *shader_impl;
3179
3180 TRACE("iface %p, shader %p.\n", iface, shader);
3181
3184 {
3186 *shader = &shader_impl->IDirect3DVertexShader9_iface;
3188 }
3189 else
3190 {
3191 *shader = NULL;
3192 }
3194
3195 TRACE("Returning %p.\n", *shader);
3196
3197 return D3D_OK;
3198}
#define IDirect3DVertexShader9_AddRef(p)
Definition: d3d9.h:1222
struct wined3d_shader *CDECL wined3d_device_get_vertex_shader(const struct wined3d_device *device)
Definition: device.c:2207
IDirect3DVertexShader9 IDirect3DVertexShader9_iface
Definition: d3d9_private.h:256

◆ d3d9_device_GetVertexShaderConstantB()

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

Definition at line 3293 of file device.c.

3295{
3297 HRESULT hr;
3298
3299 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3300
3302 hr = wined3d_device_get_vs_consts_b(device->wined3d_device, reg_idx, count, data);
3304
3305 return hr;
3306}
HRESULT CDECL wined3d_device_get_vs_consts_b(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, BOOL *constants)
Definition: device.c:2399

◆ d3d9_device_GetVertexShaderConstantF()

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

Definition at line 3223 of file device.c.

3225{
3227 HRESULT hr;
3228
3229 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3230
3232 {
3233 WARN("Trying to access %u constants, but d3d9 only supports %u\n",
3235 return D3DERR_INVALIDCALL;
3236 }
3237
3239 hr = wined3d_device_get_vs_consts_f(device->wined3d_device,
3240 reg_idx, count, (struct wined3d_vec4 *)data);
3242
3243 return hr;
3244}
HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: device.c:2492
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF
Definition: d3d9_private.h:43

◆ d3d9_device_GetVertexShaderConstantI()

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

Definition at line 3262 of file device.c.

3264{
3266 HRESULT hr;
3267
3268 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3269
3271 hr = wined3d_device_get_vs_consts_i(device->wined3d_device,
3272 reg_idx, count, (struct wined3d_ivec4 *)data);
3274
3275 return hr;
3276}
HRESULT CDECL wined3d_device_get_vs_consts_i(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants)
Definition: device.c:2448

◆ d3d9_device_GetViewport()

static HRESULT WINAPI d3d9_device_GetViewport ( IDirect3DDevice9Ex *  iface,
D3DVIEWPORT9 viewport 
)
static

Definition at line 2041 of file device.c.

2042{
2045
2046 TRACE("iface %p, viewport %p.\n", iface, viewport);
2047
2051
2052 viewport->X = wined3d_viewport.x;
2053 viewport->Y = wined3d_viewport.y;
2054 viewport->Width = wined3d_viewport.width;
2055 viewport->Height = wined3d_viewport.height;
2056 viewport->MinZ = wined3d_viewport.min_z;
2057 viewport->MaxZ = wined3d_viewport.max_z;
2058
2059 return D3D_OK;
2060}
void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
Definition: device.c:1950

◆ d3d9_device_LightEnable()

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

Definition at line 2120 of file device.c.

2121{
2123 HRESULT hr;
2124
2125 TRACE("iface %p, index %u, enable %#x.\n", iface, index, enable);
2126
2130
2131 return hr;
2132}
HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable)
Definition: device.c:1741

◆ d3d9_device_MultiplyTransform()

static HRESULT WINAPI d3d9_device_MultiplyTransform ( IDirect3DDevice9Ex *  iface,
D3DTRANSFORMSTATETYPE  state,
const D3DMATRIX matrix 
)
static

Definition at line 2005 of file device.c.

2007{
2009
2010 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
2011
2012 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
2014 wined3d_device_multiply_transform(device->wined3d_device, state, (const struct wined3d_matrix *)matrix);
2016
2017 return D3D_OK;
2018}
void CDECL wined3d_device_multiply_transform(struct wined3d_device *device, enum wined3d_transform_state state, const struct wined3d_matrix *matrix)
Definition: device.c:1548

◆ d3d9_device_prepare_index_buffer()

static HRESULT d3d9_device_prepare_index_buffer ( struct d3d9_device device,
UINT  min_size 
)
static

Definition at line 2786 of file device.c.

2787{
2788 HRESULT hr;
2789
2790 if (device->index_buffer_size < min_size || !device->index_buffer)
2791 {
2792 UINT size = max(device->index_buffer_size * 2, min_size);
2794 struct wined3d_buffer *buffer;
2795
2796 TRACE("Growing index buffer to %u bytes.\n", size);
2797
2798 desc.byte_width = size;
2800 desc.bind_flags = WINED3D_BIND_INDEX_BUFFER;
2802 desc.misc_flags = 0;
2803 desc.structure_byte_stride = 0;
2804
2805 if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &desc,
2807 {
2808 ERR("Failed to create index buffer, hr %#x.\n", hr);
2809 return hr;
2810 }
2811
2812 if (device->index_buffer)
2813 wined3d_buffer_decref(device->index_buffer);
2814
2815 device->index_buffer = buffer;
2816 device->index_buffer_size = size;
2817 device->index_buffer_pos = 0;
2818 }
2819 return D3D_OK;
2820}
#define ERR(fmt,...)
Definition: debug.h:113
HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
Definition: buffer.c:1436
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:791
#define max(a, b)
Definition: svc.c:63
#define WINED3DUSAGE_WRITEONLY
Definition: wined3d.h:901
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:907
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:920
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:891

Referenced by d3d9_device_DrawIndexedPrimitiveUP().

◆ d3d9_device_prepare_vertex_buffer()

static HRESULT d3d9_device_prepare_vertex_buffer ( struct d3d9_device device,
UINT  min_size 
)
static

Definition at line 2681 of file device.c.

2682{
2683 HRESULT hr;
2684
2685 if (device->vertex_buffer_size < min_size || !device->vertex_buffer)
2686 {
2687 UINT size = max(device->vertex_buffer_size * 2, min_size);
2689 struct wined3d_buffer *buffer;
2690
2691 TRACE("Growing vertex buffer to %u bytes.\n", size);
2692
2693 desc.byte_width = size;
2695 desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
2697 desc.misc_flags = 0;
2698 desc.structure_byte_stride = 0;
2699
2700 if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &desc,
2702 {
2703 ERR("Failed to create vertex buffer, hr %#x.\n", hr);
2704 return hr;
2705 }
2706
2707 if (device->vertex_buffer)
2708 wined3d_buffer_decref(device->vertex_buffer);
2709
2710 device->vertex_buffer = buffer;
2711 device->vertex_buffer_size = size;
2712 device->vertex_buffer_pos = 0;
2713 }
2714 return D3D_OK;
2715}
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:890

Referenced by d3d9_device_DrawIndexedPrimitiveUP(), and d3d9_device_DrawPrimitiveUP().

◆ d3d9_device_Present()

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

Definition at line 975 of file device.c.

977{
979 UINT i;
980 HRESULT hr;
981
982 TRACE("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p.\n",
983 iface, src_rect, dst_rect, dst_window_override, dirty_region);
984
985 if (device->device_state != D3D9_DEVICE_STATE_OK)
986 return device->d3d_parent->extended ? S_PRESENT_OCCLUDED : D3DERR_DEVICELOST;
987
988 if (dirty_region)
989 FIXME("Ignoring dirty_region %p.\n", dirty_region);
990
992 for (i = 0; i < device->implicit_swapchain_count; ++i)
993 {
994 if (FAILED(hr = wined3d_swapchain_present(device->implicit_swapchains[i]->wined3d_swapchain,
995 src_rect, dst_rect, dst_window_override, 0, 0)))
996 {
998 return hr;
999 }
1000 }
1002
1003 return D3D_OK;
1004}
#define D3DERR_DEVICELOST
Definition: d3d8.h:82
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD swap_interval, DWORD flags)
Definition: swapchain.c:152

◆ d3d9_device_PresentEx()

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

Definition at line 3665 of file device.c.

3668{
3670 UINT i;
3671 HRESULT hr;
3672
3673 TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n",
3674 iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect),
3675 dst_window_override, dirty_region, flags);
3676
3677 if (device->device_state != D3D9_DEVICE_STATE_OK)
3678 return S_PRESENT_OCCLUDED;
3679
3680 if (dirty_region)
3681 FIXME("Ignoring dirty_region %p.\n", dirty_region);
3682
3684 for (i = 0; i < device->implicit_swapchain_count; ++i)
3685 {
3686 if (FAILED(hr = wined3d_swapchain_present(device->implicit_swapchains[i]->wined3d_swapchain,
3687 src_rect, dst_rect, dst_window_override, 0, flags)))
3688 {
3690 return hr;
3691 }
3692 }
3694
3695 return D3D_OK;
3696}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160

◆ d3d9_device_ProcessVertices()

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

Definition at line 2926 of file device.c.

2929{
2931 struct d3d9_vertexbuffer *dst_impl = unsafe_impl_from_IDirect3DVertexBuffer9(dst_buffer);
2933 HRESULT hr;
2934
2935 TRACE("iface %p, src_start_idx %u, dst_idx %u, vertex_count %u, dst_buffer %p, declaration %p, flags %#x.\n",
2936 iface, src_start_idx, dst_idx, vertex_count, dst_buffer, declaration, flags);
2937
2939 hr = wined3d_device_process_vertices(device->wined3d_device, src_start_idx, dst_idx, vertex_count,
2940 dst_impl->wined3d_buffer, decl_impl ? decl_impl->wined3d_declaration : NULL,
2941 flags, dst_impl->fvf);
2943
2944 return hr;
2945}
struct d3d9_vertexbuffer * unsafe_impl_from_IDirect3DVertexBuffer9(IDirect3DVertexBuffer9 *iface)
Definition: buffer.c:314
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
Definition: device.c:3340
struct wined3d_buffer * wined3d_buffer
Definition: d3d9_private.h:182
struct d3d9_vertex_declaration * unsafe_impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface) DECLSPEC_HIDDEN

◆ d3d9_device_QueryInterface()

static HRESULT WINAPI d3d9_device_QueryInterface ( IDirect3DDevice9Ex *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 479 of file device.c.

480{
481 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
482
483 if (IsEqualGUID(riid, &IID_IDirect3DDevice9)
485 {
487 *out = iface;
488 return S_OK;
489 }
490
491 if (IsEqualGUID(riid, &IID_IDirect3DDevice9Ex))
492 {
494
495 /* Find out if the creating d3d9 interface was created with Direct3DCreate9Ex.
496 * It doesn't matter with which function the device was created. */
497 if (!device->d3d_parent->extended)
498 {
499 WARN("IDirect3D9 instance wasn't created with CreateDirect3D9Ex, returning E_NOINTERFACE.\n");
500 *out = NULL;
501 return E_NOINTERFACE;
502 }
503
505 *out = iface;
506 return S_OK;
507 }
508
509 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
510
511 *out = NULL;
512 return E_NOINTERFACE;
513}
const GUID IID_IUnknown
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static FILE * out
Definition: regtests2xml.c:44
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3d9_device_Release()

static ULONG WINAPI DECLSPEC_HOTPATCH d3d9_device_Release ( IDirect3DDevice9Ex *  iface)
static

Definition at line 525 of file device.c.

526{
529
530 if (device->in_destruction)
531 return 0;
532
534
535 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
536
537 if (!refcount)
538 {
539 unsigned i;
540 device->in_destruction = TRUE;
541
543 for (i = 0; i < device->fvf_decl_count; ++i)
544 {
546 }
547 heap_free(device->fvf_decls);
548
549 if (device->vertex_buffer)
550 wined3d_buffer_decref(device->vertex_buffer);
551 if (device->index_buffer)
552 wined3d_buffer_decref(device->index_buffer);
553
554 heap_free(device->implicit_swapchains);
555
556 wined3d_device_uninit_3d(device->wined3d_device);
558 wined3d_device_decref(device->wined3d_device);
560
561 IDirect3D9Ex_Release(&device->d3d_parent->IDirect3D9Ex_iface);
562
564 }
565
566 return refcount;
567}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3D9Ex_Release(p)
Definition: d3d9.h:309
HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
Definition: device.c:1195
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:472
void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
Definition: device.c:954
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)

◆ d3d9_device_Reset()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset ( IDirect3DDevice9Ex *  iface,
D3DPRESENT_PARAMETERS present_parameters 
)
static

Definition at line 965 of file device.c.

967{
969
970 TRACE("iface %p, present_parameters %p.\n", iface, present_parameters);
971
972 return d3d9_device_reset(device, present_parameters, NULL);
973}
static HRESULT d3d9_device_reset(struct d3d9_device *device, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
Definition: device.c:876

◆ d3d9_device_reset()

static HRESULT d3d9_device_reset ( struct d3d9_device device,
D3DPRESENT_PARAMETERS present_parameters,
D3DDISPLAYMODEEX mode 
)
static

Definition at line 876 of file device.c.

878{
879 BOOL extended = device->d3d_parent->extended;
880 struct wined3d_swapchain_desc swapchain_desc;
881 struct wined3d_display_mode wined3d_mode;
882 struct wined3d_rendertarget_view *rtv;
883 unsigned int i;
884 HRESULT hr;
885
886 if (!extended && device->device_state == D3D9_DEVICE_STATE_LOST)
887 {
888 WARN("App not active, returning D3DERR_DEVICELOST.\n");
889 return D3DERR_DEVICELOST;
890 }
891
892 if (mode)
893 {
894 wined3d_mode.width = mode->Width;
895 wined3d_mode.height = mode->Height;
896 wined3d_mode.refresh_rate = mode->RefreshRate;
897 wined3d_mode.format_id = wined3dformat_from_d3dformat(mode->Format);
898 wined3d_mode.scanline_ordering = mode->ScanLineOrdering;
899 }
900
901 if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, extended))
902 return D3DERR_INVALIDCALL;
903
905
906 if (device->vertex_buffer)
907 {
908 wined3d_buffer_decref(device->vertex_buffer);
909 device->vertex_buffer = NULL;
910 device->vertex_buffer_size = 0;
911 }
912
913 if (device->index_buffer)
914 {
915 wined3d_buffer_decref(device->index_buffer);
916 device->index_buffer = NULL;
917 device->index_buffer_size = 0;
918 }
919
920 if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc,
921 mode ? &wined3d_mode : NULL, reset_enum_callback, !extended)))
922 {
923 heap_free(device->implicit_swapchains);
924
925 if (!extended)
926 {
928 !!swapchain_desc.enable_auto_depth_stencil);
929 }
930
932 {
933 device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
934 }
935 else
936 {
937 wined3d_swapchain_get_desc(device->implicit_swapchains[0]->wined3d_swapchain, &swapchain_desc);
938 present_parameters->BackBufferWidth = swapchain_desc.backbuffer_width;
939 present_parameters->BackBufferHeight = swapchain_desc.backbuffer_height;
940 present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc.backbuffer_format);
941 present_parameters->BackBufferCount = swapchain_desc.backbuffer_count;
942
943 device->device_state = D3D9_DEVICE_STATE_OK;
944 }
945
946 if (!device->d3d_parent->extended)
947 for (i = 0; i < ARRAY_SIZE(device->textures); ++i)
948 device->textures[i] = NULL;
949
950 rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0);
952 for (i = 1; i < ARRAY_SIZE(device->render_targets); ++i)
953 device->render_targets[i] = NULL;
954 }
955 else if (!extended)
956 {
957 device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
958 }
959
961
962 return hr;
963}
static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource)
Definition: device.c:740
static HRESULT d3d9_device_get_swapchains(struct d3d9_device *device)
Definition: device.c:858
HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode, wined3d_device_reset_cb callback, BOOL reset_state)
Definition: device.c:4771
void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value)
Definition: device.c:2027
D3DFORMAT BackBufferFormat
Definition: d3d8types.h:1123
@ D3D9_DEVICE_STATE_NOT_RESET
Definition: d3d9_private.h:81
@ D3D9_DEVICE_STATE_LOST
Definition: d3d9_private.h:80
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:269

Referenced by d3d9_device_Reset(), and d3d9_device_ResetEx().

◆ d3d9_device_ResetEx()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx ( IDirect3DDevice9Ex *  iface,
D3DPRESENT_PARAMETERS present_parameters,
D3DDISPLAYMODEEX mode 
)
static

Definition at line 3824 of file device.c.

3826{
3828
3829 TRACE("iface %p, present_parameters %p, mode %p.\n", iface, present_parameters, mode);
3830
3831 if (!present_parameters->Windowed == !mode)
3832 {
3833 WARN("Mode can be passed if and only if Windowed is FALSE.\n");
3834 return D3DERR_INVALIDCALL;
3835 }
3836
3837 if (mode && (mode->Width != present_parameters->BackBufferWidth
3838 || mode->Height != present_parameters->BackBufferHeight))
3839 {
3840 WARN("Mode and back buffer mismatch (mode %ux%u, backbuffer %ux%u).\n",
3841 mode->Width, mode->Height,
3842 present_parameters->BackBufferWidth, present_parameters->BackBufferHeight);
3843 return D3DERR_INVALIDCALL;
3844 }
3845
3846 return d3d9_device_reset(device, present_parameters, mode);
3847}

◆ d3d9_device_SetClipPlane()

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

Definition at line 2148 of file device.c.

2149{
2151 HRESULT hr;
2152
2153 TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
2154
2155 index = min(index, device->max_user_clip_planes - 1);
2156
2158 hr = wined3d_device_set_clip_plane(device->wined3d_device, index, (const struct wined3d_vec4 *)plane);
2160
2161 return hr;
2162}
HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device, UINT plane_idx, const struct wined3d_vec4 *plane)
Definition: device.c:1783

◆ d3d9_device_SetClipStatus()

static HRESULT WINAPI d3d9_device_SetClipStatus ( IDirect3DDevice9Ex *  iface,
const D3DCLIPSTATUS9 clip_status 
)
static

Definition at line 2297 of file device.c.

2298{
2300 HRESULT hr;
2301
2302 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2303
2305 hr = wined3d_device_set_clip_status(device->wined3d_device, (const struct wined3d_clip_status *)clip_status);
2307
2308 return hr;
2309}
HRESULT CDECL wined3d_device_set_clip_status(struct wined3d_device *device, const struct wined3d_clip_status *clip_status)
Definition: device.c:1827

◆ d3d9_device_SetConvolutionMonoKernel()

static HRESULT WINAPI d3d9_device_SetConvolutionMonoKernel ( IDirect3DDevice9Ex *  iface,
UINT  width,
UINT  height,
float rows,
float columns 
)
static

Definition at line 3644 of file device.c.

3646{
3647 FIXME("iface %p, width %u, height %u, rows %p, columns %p stub!\n",
3648 iface, width, height, rows, columns);
3649
3650 return E_NOTIMPL;
3651}

◆ d3d9_device_SetCurrentTexturePalette()

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

Definition at line 2517 of file device.c.

2518{
2519 WARN("iface %p, palette_idx %u unimplemented.\n", iface, palette_idx);
2520
2521 return D3D_OK;
2522}

◆ d3d9_device_SetCursorPosition()

static void WINAPI d3d9_device_SetCursorPosition ( IDirect3DDevice9Ex *  iface,
int  x,
int  y,
DWORD  flags 
)
static

Definition at line 715 of file device.c.

716{
718
719 TRACE("iface %p, x %u, y %u, flags %#x.\n", iface, x, y, flags);
720
724}
void CDECL wined3d_device_set_cursor_position(struct wined3d_device *device, int x_screen_space, int y_screen_space, DWORD flags)
Definition: device.c:4690
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ d3d9_device_SetCursorProperties()

static HRESULT WINAPI d3d9_device_SetCursorProperties ( IDirect3DDevice9Ex *  iface,
UINT  hotspot_x,
UINT  hotspot_y,
IDirect3DSurface9 *  bitmap 
)
static

Definition at line 691 of file device.c.

693{
696 HRESULT hr;
697
698 TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
699 iface, hotspot_x, hotspot_y, bitmap);
700
701 if (!bitmap)
702 {
703 WARN("No cursor bitmap, returning D3DERR_INVALIDCALL.\n");
704 return D3DERR_INVALIDCALL;
705 }
706
709 hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx);
711
712 return hr;
713}
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: device.c:4587
Definition: uimain.c:89

◆ d3d9_device_SetDepthStencilSurface()

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

Definition at line 1853 of file device.c.

1854{
1856 struct d3d9_surface *ds_impl = unsafe_impl_from_IDirect3DSurface9(depth_stencil);
1857 struct wined3d_rendertarget_view *rtv;
1858
1859 TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
1860
1862 rtv = ds_impl ? d3d9_surface_acquire_rendertarget_view(ds_impl) : NULL;
1863 wined3d_device_set_depth_stencil_view(device->wined3d_device, rtv);
1866
1867 return D3D_OK;
1868}
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
Definition: device.c:4524

◆ d3d9_device_SetDialogBoxMode()

static HRESULT WINAPI d3d9_device_SetDialogBoxMode ( IDirect3DDevice9Ex *  iface,
BOOL  enable 
)
static

Definition at line 1051 of file device.c.

1052{
1054 HRESULT hr;
1055
1056 TRACE("iface %p, enable %#x.\n", iface, enable);
1057
1061
1062 return hr;
1063}
HRESULT CDECL wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs)
Definition: device.c:5032

◆ d3d9_device_SetFVF()

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

Definition at line 3080 of file device.c.

3081{
3083 struct wined3d_vertex_declaration *decl;
3084
3085 TRACE("iface %p, fvf %#x.\n", iface, fvf);
3086
3087 if (!fvf)
3088 {
3089 WARN("%#x is not a valid FVF.\n", fvf);
3090 return D3D_OK;
3091 }
3092
3094 if (!(decl = device_get_fvf_declaration(device, fvf)))
3095 {
3097 ERR("Failed to create a vertex declaration for fvf %#x.\n", fvf);
3099 }
3100
3101 wined3d_device_set_vertex_declaration(device->wined3d_device, decl);
3102 device->has_vertex_declaration = TRUE;
3104
3105 return D3D_OK;
3106}
static struct wined3d_vertex_declaration * device_get_fvf_declaration(struct d3d9_device *device, DWORD fvf)
Definition: device.c:3013
void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration *declaration)
Definition: device.c:2157
#define D3DERR_DRIVERINTERNALERROR
Definition: d3d8.h:78

◆ d3d9_device_SetGammaRamp()

static void WINAPI d3d9_device_SetGammaRamp ( IDirect3DDevice9Ex *  iface,
UINT  swapchain,
DWORD  flags,
const D3DGAMMARAMP ramp 
)
static

Definition at line 1065 of file device.c.

1067{
1069
1070 TRACE("iface %p, swapchain %u, flags %#x, ramp %p.\n", iface, swapchain, flags, ramp);
1071
1072 /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
1074 wined3d_device_set_gamma_ramp(device->wined3d_device, swapchain, flags, (const struct wined3d_gamma_ramp *)ramp);
1076}
void CDECL wined3d_device_set_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp)
Definition: device.c:5057

◆ d3d9_device_SetGPUThreadPriority()

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

Definition at line 3705 of file device.c.

3706{
3707 FIXME("iface %p, priority %d stub!\n", iface, priority);
3708
3709 return E_NOTIMPL;
3710}

◆ d3d9_device_SetIndices()

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

Definition at line 3387 of file device.c.

3388{
3391
3392 TRACE("iface %p, buffer %p.\n", iface, buffer);
3393
3396 ib ? ib->wined3d_buffer : NULL, ib ? ib->format : WINED3DFMT_UNKNOWN, 0);
3398
3399 return D3D_OK;
3400}
struct d3d9_indexbuffer * unsafe_impl_from_IDirect3DIndexBuffer9(IDirect3DIndexBuffer9 *iface)
Definition: buffer.c:605
enum wined3d_format_id format
Definition: d3d9_private.h:197
struct wined3d_buffer * wined3d_buffer
Definition: d3d9_private.h:195

◆ d3d9_device_SetLight()

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

Definition at line 2090 of file device.c.

2091{
2093 HRESULT hr;
2094
2095 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
2096
2097 /* Note: D3DLIGHT9 is compatible with struct wined3d_light. */
2099 hr = wined3d_device_set_light(device->wined3d_device, index, (const struct wined3d_light *)light);
2101
2102 return hr;
2103}
HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light_idx, const struct wined3d_light *light)
Definition: device.c:1580

◆ d3d9_device_SetMaterial()

static HRESULT WINAPI d3d9_device_SetMaterial ( IDirect3DDevice9Ex *  iface,
const D3DMATERIAL9 material 
)
static

Definition at line 2062 of file device.c.

2063{
2065
2066 TRACE("iface %p, material %p.\n", iface, material);
2067
2068 /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
2070 wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material);
2072
2073 return D3D_OK;
2074}
void CDECL wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material)
Definition: device.c:1849

◆ d3d9_device_SetMaximumFrameLatency()

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

Definition at line 3728 of file device.c.

3729{
3730 TRACE("iface %p, max_latency %u.\n", iface, max_latency);
3731
3732 if (max_latency)
3733 FIXME("Ignoring max_latency %u.\n", max_latency);
3734
3735 return S_OK;
3736}

◆ d3d9_device_SetNPatchMode()

static HRESULT WINAPI d3d9_device_SetNPatchMode ( IDirect3DDevice9Ex *  iface,
float  segment_count 
)
static

Definition at line 2584 of file device.c.

2585{
2587 HRESULT hr;
2588
2589 TRACE("iface %p, segment_count %.8e.\n", iface, segment_count);
2590
2592 hr = wined3d_device_set_npatch_mode(device->wined3d_device, segment_count);
2594
2595 return hr;
2596}
HRESULT CDECL wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments)
Definition: device.c:3995

◆ d3d9_device_SetPaletteEntries()

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

Definition at line 2496 of file device.c.

2498{
2499 WARN("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2500
2501 /* The d3d9 palette API is non-functional on Windows. Getters and setters are implemented,
2502 * and some drivers allow the creation of P8 surfaces. These surfaces can be copied to
2503 * other P8 surfaces with StretchRect, but cannot be converted to (A)RGB.
2504 *
2505 * Some older(dx7) cards may have support for P8 textures, but games cannot rely on this. */
2506 return D3D_OK;
2507}

◆ d3d9_device_SetPixelShader()

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

Definition at line 3459 of file device.c.

3460{
3463
3464 TRACE("iface %p, shader %p.\n", iface, shader);
3465
3468 shader_obj ? shader_obj->wined3d_shader : NULL);
3470
3471 return D3D_OK;
3472}
void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader)
Definition: device.c:2509
struct wined3d_shader * wined3d_shader
Definition: d3d9_private.h:270
struct d3d9_pixelshader * unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) DECLSPEC_HIDDEN
Definition: shader.c:323

◆ d3d9_device_SetPixelShaderConstantB()

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

Definition at line 3566 of file device.c.

3568{
3570 HRESULT hr;
3571
3572 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3573
3575 hr = wined3d_device_set_ps_consts_b(device->wined3d_device, reg_idx, count, data);
3577
3578 return hr;
3579}
HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const BOOL *constants)
Definition: device.c:2581

◆ d3d9_device_SetPixelShaderConstantF()

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

Definition at line 3502 of file device.c.

3504{
3506 HRESULT hr;
3507
3508 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3509
3511 hr = wined3d_device_set_ps_consts_f(device->wined3d_device,
3512 reg_idx, count, (const struct wined3d_vec4 *)data);
3514
3515 return hr;
3516}
HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
Definition: device.c:2679

◆ d3d9_device_SetPixelShaderConstantI()

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

Definition at line 3534 of file device.c.

3536{
3538 HRESULT hr;
3539
3540 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3541
3543 hr = wined3d_device_set_ps_consts_i(device->wined3d_device,
3544 reg_idx, count, (const struct wined3d_ivec4 *)data);
3546
3547 return hr;
3548}
HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants)
Definition: device.c:2630

◆ d3d9_device_SetRenderState()

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

Definition at line 2180 of file device.c.

2182{
2184
2185 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2186
2190
2191 return D3D_OK;
2192}

◆ d3d9_device_SetRenderTarget()

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

Definition at line 1778 of file device.c.

1779{
1781 struct d3d9_surface *surface_impl = unsafe_impl_from_IDirect3DSurface9(surface);
1782 struct wined3d_rendertarget_view *rtv;
1783 HRESULT hr;
1784
1785 TRACE("iface %p, idx %u, surface %p.\n", iface, idx, surface);
1786
1788 {
1789 WARN("Invalid index %u specified.\n", idx);
1790 return D3DERR_INVALIDCALL;
1791 }
1792
1793 if (!idx && !surface_impl)
1794 {
1795 WARN("Trying to set render target 0 to NULL.\n");
1796 return D3DERR_INVALIDCALL;
1797 }
1798
1799 if (surface_impl && d3d9_surface_get_device(surface_impl) != device)
1800 {
1801 WARN("Render target surface does not match device.\n");
1802 return D3DERR_INVALIDCALL;
1803 }
1804
1806 rtv = surface_impl ? d3d9_surface_acquire_rendertarget_view(surface_impl) : NULL;
1807 hr = wined3d_device_set_rendertarget_view(device->wined3d_device, idx, rtv, TRUE);
1808 d3d9_surface_release_rendertarget_view(surface_impl, rtv);
1809 if (SUCCEEDED(hr))
1810 device->render_targets[idx] = surface_impl;
1812
1813 return hr;
1814}
HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport)
Definition: device.c:4468
struct d3d9_device * d3d9_surface_get_device(const struct d3d9_surface *surface) DECLSPEC_HIDDEN
Definition: surface.c:400

◆ d3d9_device_SetSamplerState()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState ( IDirect3DDevice9Ex *  iface,
DWORD  sampler,
D3DSAMPLERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2468 of file device.c.

2470{
2472
2473 TRACE("iface %p, sampler %u, state %#x, value %#x.\n", iface, sampler, state, value);
2474
2478
2479 return D3D_OK;
2480}
void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
Definition: device.c:2071

◆ d3d9_device_SetScissorRect()

static HRESULT WINAPI d3d9_device_SetScissorRect ( IDirect3DDevice9Ex *  iface,
const RECT rect 
)
static

Definition at line 2531 of file device.c.

2532{
2534
2535 TRACE("iface %p, rect %p.\n", iface, rect);
2536
2540
2541 return D3D_OK;
2542}
void CDECL wined3d_device_set_scissor_rect(struct wined3d_device *device, const RECT *rect)
Definition: device.c:2126

◆ d3d9_device_SetSoftwareVertexProcessing()

static HRESULT WINAPI d3d9_device_SetSoftwareVertexProcessing ( IDirect3DDevice9Ex *  iface,
BOOL  software 
)
static

Definition at line 2557 of file device.c.

2558{
2560
2561 TRACE("iface %p, software %#x.\n", iface, software);
2562
2564 wined3d_device_set_software_vertex_processing(device->wined3d_device, software);
2566
2567 return D3D_OK;
2568}
void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software)
Definition: device.c:3967

◆ d3d9_device_SetStreamSource()

static HRESULT WINAPI d3d9_device_SetStreamSource ( IDirect3DDevice9Ex *  iface,
UINT  stream_idx,
IDirect3DVertexBuffer9 *  buffer,
UINT  offset,
UINT  stride 
)
static

Definition at line 3308 of file device.c.

3310{
3313 HRESULT hr;
3314
3315 TRACE("iface %p, stream_idx %u, buffer %p, offset %u, stride %u.\n",
3316 iface, stream_idx, buffer, offset, stride);
3317
3319 hr = wined3d_device_set_stream_source(device->wined3d_device, stream_idx,
3320 buffer_impl ? buffer_impl->wined3d_buffer : NULL, offset, stride);
3322
3323 return hr;
3324}

◆ d3d9_device_SetStreamSourceFreq()

static HRESULT WINAPI d3d9_device_SetStreamSourceFreq ( IDirect3DDevice9Ex *  iface,
UINT  stream_idx,
UINT  freq 
)
static

Definition at line 3359 of file device.c.

3360{
3362 HRESULT hr;
3363
3364 TRACE("iface %p, stream_idx %u, freq %u.\n", iface, stream_idx, freq);
3365
3367 hr = wined3d_device_set_stream_source_freq(device->wined3d_device, stream_idx, freq);
3369
3370 return hr;
3371}
HRESULT CDECL wined3d_device_set_stream_source_freq(struct wined3d_device *device, UINT stream_idx, UINT divider)
Definition: device.c:1451

◆ d3d9_device_SetTexture()

static HRESULT WINAPI d3d9_device_SetTexture ( IDirect3DDevice9Ex *  iface,
DWORD  stage,
IDirect3DBaseTexture9 *  texture 
)
static

Definition at line 2352 of file device.c.

2353{
2355 struct d3d9_texture *texture_impl;
2356 HRESULT hr;
2357
2358 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
2359
2361
2363 hr = wined3d_device_set_texture(device->wined3d_device, stage,
2364 texture_impl ? texture_impl->wined3d_texture : NULL);
2365 if (SUCCEEDED(hr))
2366 {
2367 unsigned int i = stage >= D3DVERTEXTEXTURESAMPLER0 ? stage - D3DVERTEXTEXTURESAMPLER0 + 16 : stage;
2368
2369 if (stage < ARRAY_SIZE(device->textures))
2370 device->textures[i] = texture_impl;
2371 }
2373
2374 return hr;
2375}
#define D3DVERTEXTEXTURESAMPLER0
Definition: d3d9types.h:193
HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture)
Definition: device.c:3462
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:208
struct d3d9_texture * unsafe_impl_from_IDirect3DBaseTexture9(IDirect3DBaseTexture9 *iface) DECLSPEC_HIDDEN
Definition: texture.c:1269

◆ d3d9_device_SetTextureStageState()

static HRESULT WINAPI d3d9_device_SetTextureStageState ( IDirect3DDevice9Ex *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 2434 of file device.c.

2436{
2438
2439 TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, state, value);
2440
2441 if (state >= ARRAY_SIZE(tss_lookup))
2442 {
2443 WARN("Invalid state %#x passed.\n", state);
2444 return D3D_OK;
2445 }
2446
2450
2451 return D3D_OK;
2452}
void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device, UINT stage, enum wined3d_texture_stage_state state, DWORD value)
Definition: device.c:3405

◆ d3d9_device_SetTransform()

static HRESULT WINAPI d3d9_device_SetTransform ( IDirect3DDevice9Ex *  iface,
D3DTRANSFORMSTATETYPE  state,
const D3DMATRIX matrix 
)
static

Definition at line 1975 of file device.c.

1977{
1979
1980 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
1981
1982 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
1984 wined3d_device_set_transform(device->wined3d_device, state, (const struct wined3d_matrix *)matrix);
1986
1987 return D3D_OK;
1988}
void CDECL wined3d_device_set_transform(struct wined3d_device *device, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: device.c:1505

◆ d3d9_device_SetVertexDeclaration()

static HRESULT WINAPI d3d9_device_SetVertexDeclaration ( IDirect3DDevice9Ex *  iface,
IDirect3DVertexDeclaration9 *  declaration 
)
static

Definition at line 2968 of file device.c.

2970{
2973
2974 TRACE("iface %p, declaration %p.\n", iface, declaration);
2975
2978 decl_impl ? decl_impl->wined3d_declaration : NULL);
2979 device->has_vertex_declaration = !!decl_impl;
2981
2982 return D3D_OK;
2983}

◆ d3d9_device_SetVertexShader()

static HRESULT WINAPI d3d9_device_SetVertexShader ( IDirect3DDevice9Ex *  iface,
IDirect3DVertexShader9 *  shader 
)
static

Definition at line 3159 of file device.c.

3160{
3163
3164 TRACE("iface %p, shader %p.\n", iface, shader);
3165
3168 shader_obj ? shader_obj->wined3d_shader : NULL);
3170
3171 return D3D_OK;
3172}
void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader)
Definition: device.c:2186
struct wined3d_shader * wined3d_shader
Definition: d3d9_private.h:258
struct d3d9_vertexshader * unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) DECLSPEC_HIDDEN
Definition: shader.c:169

◆ d3d9_device_SetVertexShaderConstantB()

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

Definition at line 3278 of file device.c.

3280{
3282 HRESULT hr;
3283
3284 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3285
3287 hr = wined3d_device_set_vs_consts_b(device->wined3d_device, reg_idx, count, data);
3289
3290 return hr;
3291}
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const BOOL *constants)
Definition: device.c:2366

◆ d3d9_device_SetVertexShaderConstantF()

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

Definition at line 3200 of file device.c.

3202{
3204 HRESULT hr;
3205
3206 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3207
3209 {
3210 WARN("Trying to access %u constants, but d3d9 only supports %u\n",
3212 return D3DERR_INVALIDCALL;
3213 }
3214
3216 hr = wined3d_device_set_vs_consts_f(device->wined3d_device,
3217 reg_idx, count, (const struct wined3d_vec4 *)data);
3219
3220 return hr;
3221}
HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
Definition: device.c:2463

◆ d3d9_device_SetVertexShaderConstantI()

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

Definition at line 3246 of file device.c.

3248{
3250 HRESULT hr;
3251
3252 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3253
3255 hr = wined3d_device_set_vs_consts_i(device->wined3d_device,
3256 reg_idx, count, (const struct wined3d_ivec4 *)data);
3258
3259 return hr;
3260}
HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants)
Definition: device.c:2415

◆ d3d9_device_SetViewport()

static HRESULT WINAPI d3d9_device_SetViewport ( IDirect3DDevice9Ex *  iface,
const D3DVIEWPORT9 viewport 
)
static

Definition at line 2020 of file device.c.

2021{
2023 struct wined3d_viewport vp;
2024
2025 TRACE("iface %p, viewport %p.\n", iface, viewport);
2026
2027 vp.x = viewport->X;
2028 vp.y = viewport->Y;
2029 vp.width = viewport->Width;
2030 vp.height = viewport->Height;
2031 vp.min_z = viewport->MinZ;
2032 vp.max_z = viewport->MaxZ;
2033
2035 wined3d_device_set_viewport(device->wined3d_device, &vp);
2037
2038 return D3D_OK;
2039}
void CDECL wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport)
Definition: device.c:1931

◆ d3d9_device_ShowCursor()

static BOOL WINAPI d3d9_device_ShowCursor ( IDirect3DDevice9Ex *  iface,
BOOL  show 
)
static

Definition at line 726 of file device.c.

727{
729 BOOL ret;
730
731 TRACE("iface %p, show %#x.\n", iface, show);
732
734 ret = wined3d_device_show_cursor(device->wined3d_device, show);
736
737 return ret;
738}
BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
Definition: device.c:4719

◆ d3d9_device_StretchRect()

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

Definition at line 1587 of file device.c.

1589{
1593 struct wined3d_sub_resource_desc src_desc, dst_desc;
1595 RECT d, s;
1596
1597 TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.\n",
1598 iface, src_surface, src_rect, dst_surface, dst_rect, filter);
1599
1601 wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &dst_desc);
1602 if (!dst_rect)
1603 {
1604 SetRect(&d, 0, 0, dst_desc.width, dst_desc.height);
1605 dst_rect = &d;
1606 }
1607
1608 wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &src_desc);
1609 if (!src_rect)
1610 {
1611 SetRect(&s, 0, 0, src_desc.width, src_desc.height);
1612 src_rect = &s;
1613 }
1614
1615 if (dst_desc.access & WINED3D_RESOURCE_ACCESS_CPU)
1616 {
1617 WARN("Destination resource is not in DEFAULT pool.\n");
1618 goto done;
1619 }
1620 if (src_desc.access & WINED3D_RESOURCE_ACCESS_CPU)
1621 {
1622 WARN("Source resource is not in DEFAULT pool.\n");
1623 goto done;
1624 }
1625
1626 if (dst->texture && !(dst_desc.usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL)))
1627 {
1628 WARN("Destination is a regular texture.\n");
1629 goto done;
1630 }
1631
1632 if (src_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1633 {
1634 if (device->in_scene)
1635 {
1636 WARN("Rejecting depth / stencil blit while in scene.\n");
1637 goto done;
1638 }
1639
1640 if (src_rect->left || src_rect->top || src_rect->right != src_desc.width
1641 || src_rect->bottom != src_desc.height)
1642 {
1643 WARN("Rejecting depth / stencil blit with invalid source rect %s.\n",
1644 wine_dbgstr_rect(src_rect));
1645 goto done;
1646 }
1647
1648 if (dst_rect->left || dst_rect->top || dst_rect->right != dst_desc.width
1649 || dst_rect->bottom != dst_desc.height)
1650 {
1651 WARN("Rejecting depth / stencil blit with invalid destination rect %s.\n",
1652 wine_dbgstr_rect(dst_rect));
1653 goto done;
1654 }
1655
1656 if (src_desc.width != dst_desc.width || src_desc.height != dst_desc.height)
1657 {
1658 WARN("Rejecting depth / stencil blit with mismatched surface sizes.\n");
1659 goto done;
1660 }
1661 }
1662
1663 hr = wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, dst_rect,
1664 src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, filter);
1667 if (SUCCEEDED(hr) && dst->texture)
1669
1670done:
1672 return hr;
1673}
GLdouble s
Definition: gl.h:2039
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
#define d
Definition: ke_i.h:81
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define WINEDDERR_INVALIDRECT
Definition: wined3d.h:52

◆ d3d9_device_TestCooperativeLevel()

static HRESULT WINAPI d3d9_device_TestCooperativeLevel ( IDirect3DDevice9Ex *  iface)
static

Definition at line 569 of file device.c.

570{
572
573 TRACE("iface %p.\n", iface);
574
575 TRACE("device state: %#x.\n", device->device_state);
576
577 if (device->d3d_parent->extended)
578 return D3D_OK;
579
580 switch (device->device_state)
581 {
582 default:
584 return D3D_OK;
586 return D3DERR_DEVICELOST;
589 }
590}
#define D3DERR_DEVICENOTRESET
Definition: d3d8.h:83

◆ d3d9_device_UpdateSurface()

static HRESULT WINAPI d3d9_device_UpdateSurface ( IDirect3DDevice9Ex *  iface,
IDirect3DSurface9 *  src_surface,
const RECT src_rect,
IDirect3DSurface9 *  dst_surface,
const POINT dst_point 
)
static

Definition at line 1468 of file device.c.

1471{
1475 struct wined3d_sub_resource_desc src_desc, dst_desc;
1476 struct wined3d_box src_box;
1477 HRESULT hr;
1478
1479 TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.\n",
1480 iface, src_surface, src_rect, dst_surface, dst_point);
1481
1483
1484 wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &src_desc);
1485 wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &dst_desc);
1486 if (src_desc.format != dst_desc.format)
1487 {
1489 WARN("Surface formats (%#x/%#x) don't match.\n",
1490 d3dformat_from_wined3dformat(src_desc.format),
1491 d3dformat_from_wined3dformat(dst_desc.format));
1492 return D3DERR_INVALIDCALL;
1493 }
1494
1495 if (src_rect)
1496 wined3d_box_set(&src_box, src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1);
1497 else
1498 wined3d_box_set(&src_box, 0, 0, src_desc.width, src_desc.height, 0, 1);
1499
1501 wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0,
1502 dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture),
1503 src->sub_resource_idx, &src_box);
1504 if (SUCCEEDED(hr) && dst->texture)
1506
1508
1509 if (FAILED(hr))
1510 return D3DERR_INVALIDCALL;
1511
1512 return hr;
1513}
HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
Definition: device.c:4121
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
Definition: wined3d.h:2789

◆ d3d9_device_UpdateTexture()

static HRESULT WINAPI d3d9_device_UpdateTexture ( IDirect3DDevice9Ex *  iface,
IDirect3DBaseTexture9 *  src_texture,
IDirect3DBaseTexture9 *  dst_texture 
)
static

Definition at line 1515 of file device.c.

1517{
1519 struct d3d9_texture *src_impl, *dst_impl;
1520 HRESULT hr;
1521
1522 TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, src_texture, dst_texture);
1523
1524 src_impl = unsafe_impl_from_IDirect3DBaseTexture9(src_texture);
1525 dst_impl = unsafe_impl_from_IDirect3DBaseTexture9(dst_texture);
1526
1528 hr = wined3d_device_update_texture(device->wined3d_device,
1529 src_impl->wined3d_texture, dst_impl->wined3d_texture);
1530 if (SUCCEEDED(hr))
1533
1534 return hr;
1535}
HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
Definition: device.c:3808

◆ d3d9_device_ValidateDevice()

static HRESULT WINAPI d3d9_device_ValidateDevice ( IDirect3DDevice9Ex *  iface,
DWORD pass_count 
)
static

Definition at line 2482 of file device.c.

2483{
2485 HRESULT hr;
2486
2487 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
2488
2490 hr = wined3d_device_validate_device(device->wined3d_device, pass_count);
2492
2493 return hr;
2494}
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
Definition: device.c:3905

◆ d3d9_device_WaitForVBlank()

static HRESULT WINAPI d3d9_device_WaitForVBlank ( IDirect3DDevice9Ex *  iface,
UINT  swapchain_idx 
)
static

Definition at line 3712 of file device.c.

3713{
3714 FIXME("iface %p, swapchain_idx %u stub!\n", iface, swapchain_idx);
3715
3716 return E_NOTIMPL;
3717}

◆ d3d9_generate_auto_mipmaps()

static void d3d9_generate_auto_mipmaps ( struct d3d9_device device)
static

Definition at line 2613 of file device.c.

2614{
2615 unsigned int i;
2616
2617 for (i = 0; i < ARRAY_SIZE(device->textures); ++i)
2618 if (device->textures[i])
2620}
void d3d9_texture_gen_auto_mipmap(struct d3d9_texture *texture) DECLSPEC_HIDDEN
Definition: texture.c:99

Referenced by d3d9_device_DrawIndexedPrimitive(), d3d9_device_DrawIndexedPrimitiveUP(), d3d9_device_DrawPrimitive(), and d3d9_device_DrawPrimitiveUP().

◆ d3d9_null_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d9_null_wined3d_object_destroyed ( void parent)
static

Definition at line 28 of file device.c.

28{}

◆ d3d9_rts_flag_auto_gen_mipmap()

static void d3d9_rts_flag_auto_gen_mipmap ( struct d3d9_device device)
static

Definition at line 1931 of file device.c.

1932{
1933 unsigned int i;
1934
1935 for (i = 0; i < ARRAY_SIZE(device->render_targets); ++i)
1936 {
1937 struct d3d9_surface *surface = device->render_targets[i];
1938
1939 if (surface && surface->texture)
1941 }
1942}

Referenced by d3d9_device_Clear(), d3d9_device_DrawIndexedPrimitive(), d3d9_device_DrawIndexedPrimitiveUP(), d3d9_device_DrawPrimitive(), and d3d9_device_DrawPrimitiveUP().

◆ d3dcaps_from_wined3dcaps()

void d3dcaps_from_wined3dcaps ( D3DCAPS9 caps,
const WINED3DCAPS wined3d_caps 
)

Definition at line 317 of file device.c.

318{
319 static const DWORD ps_minor_version[] = {0, 4, 0, 0};
320 static const DWORD vs_minor_version[] = {0, 1, 0, 0};
321 static const DWORD texture_filter_caps =
327
328 caps->DeviceType = (D3DDEVTYPE)wined3d_caps->DeviceType;
329 caps->AdapterOrdinal = wined3d_caps->AdapterOrdinal;
330 caps->Caps = wined3d_caps->Caps;
331 caps->Caps2 = wined3d_caps->Caps2;
332 caps->Caps3 = wined3d_caps->Caps3;
333 caps->PresentationIntervals = wined3d_caps->PresentationIntervals;
334 caps->CursorCaps = wined3d_caps->CursorCaps;
335 caps->DevCaps = wined3d_caps->DevCaps;
336 caps->PrimitiveMiscCaps = wined3d_caps->PrimitiveMiscCaps;
337 caps->RasterCaps = wined3d_caps->RasterCaps;
338 caps->ZCmpCaps = wined3d_caps->ZCmpCaps;
339 caps->SrcBlendCaps = wined3d_caps->SrcBlendCaps;
340 caps->DestBlendCaps = wined3d_caps->DestBlendCaps;
341 caps->AlphaCmpCaps = wined3d_caps->AlphaCmpCaps;
342 caps->ShadeCaps = wined3d_caps->ShadeCaps;
343 caps->TextureCaps = wined3d_caps->TextureCaps;
344 caps->TextureFilterCaps = wined3d_caps->TextureFilterCaps;
345 caps->CubeTextureFilterCaps = wined3d_caps->CubeTextureFilterCaps;
347 caps->TextureAddressCaps = wined3d_caps->TextureAddressCaps;
349 caps->LineCaps = wined3d_caps->LineCaps;
350 caps->MaxTextureWidth = wined3d_caps->MaxTextureWidth;
351 caps->MaxTextureHeight = wined3d_caps->MaxTextureHeight;
352 caps->MaxVolumeExtent = wined3d_caps->MaxVolumeExtent;
353 caps->MaxTextureRepeat = wined3d_caps->MaxTextureRepeat;
354 caps->MaxTextureAspectRatio = wined3d_caps->MaxTextureAspectRatio;
355 caps->MaxAnisotropy = wined3d_caps->MaxAnisotropy;
356 caps->MaxVertexW = wined3d_caps->MaxVertexW;
357 caps->GuardBandLeft = wined3d_caps->GuardBandLeft;
358 caps->GuardBandTop = wined3d_caps->GuardBandTop;
359 caps->GuardBandRight = wined3d_caps->GuardBandRight;
360 caps->GuardBandBottom = wined3d_caps->GuardBandBottom;
361 caps->ExtentsAdjust = wined3d_caps->ExtentsAdjust;
362 caps->StencilCaps = wined3d_caps->StencilCaps;
363 caps->FVFCaps = wined3d_caps->FVFCaps;
364 caps->TextureOpCaps = wined3d_caps->TextureOpCaps;
365 caps->MaxTextureBlendStages = wined3d_caps->MaxTextureBlendStages;
367 caps->VertexProcessingCaps = wined3d_caps->VertexProcessingCaps;
368 caps->MaxActiveLights = wined3d_caps->MaxActiveLights;
369 caps->MaxUserClipPlanes = wined3d_caps->MaxUserClipPlanes;
372 caps->MaxPointSize = wined3d_caps->MaxPointSize;
373 caps->MaxPrimitiveCount = wined3d_caps->MaxPrimitiveCount;
374 caps->MaxVertexIndex = wined3d_caps->MaxVertexIndex;
375 caps->MaxStreams = wined3d_caps->MaxStreams;
376 caps->MaxStreamStride = wined3d_caps->MaxStreamStride;
377 caps->VertexShaderVersion = wined3d_caps->VertexShaderVersion;
378 caps->MaxVertexShaderConst = wined3d_caps->MaxVertexShaderConst;
379 caps->PixelShaderVersion = wined3d_caps->PixelShaderVersion;
380 caps->PixelShader1xMaxValue = wined3d_caps->PixelShader1xMaxValue;
381 caps->DevCaps2 = wined3d_caps->DevCaps2;
383 caps->MasterAdapterOrdinal = wined3d_caps->MasterAdapterOrdinal;
384 caps->AdapterOrdinalInGroup = wined3d_caps->AdapterOrdinalInGroup;
386 caps->DeclTypes = wined3d_caps->DeclTypes;
387 caps->NumSimultaneousRTs = wined3d_caps->NumSimultaneousRTs;
388 caps->StretchRectFilterCaps = wined3d_caps->StretchRectFilterCaps;
389 caps->VS20Caps.Caps = wined3d_caps->VS20Caps.caps;
390 caps->VS20Caps.DynamicFlowControlDepth = wined3d_caps->VS20Caps.dynamic_flow_control_depth;
391 caps->VS20Caps.NumTemps = wined3d_caps->VS20Caps.temp_count;
392 caps->VS20Caps.StaticFlowControlDepth = wined3d_caps->VS20Caps.static_flow_control_depth;
393 caps->PS20Caps.Caps = wined3d_caps->PS20Caps.caps;
394 caps->PS20Caps.DynamicFlowControlDepth = wined3d_caps->PS20Caps.dynamic_flow_control_depth;
395 caps->PS20Caps.NumTemps = wined3d_caps->PS20Caps.temp_count;
396 caps->PS20Caps.StaticFlowControlDepth = wined3d_caps->PS20Caps.static_flow_control_depth;
397 caps->PS20Caps.NumInstructionSlots = wined3d_caps->PS20Caps.instruction_slot_count;
403
404 /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps. */
406
407 /* Filter wined3d caps. */
408 caps->TextureFilterCaps &= texture_filter_caps;
409 caps->CubeTextureFilterCaps &= texture_filter_caps;
410 caps->VolumeTextureFilterCaps &= texture_filter_caps;
411
412 caps->DevCaps &=
420
421 caps->ShadeCaps &=
424
425 caps->RasterCaps &=
432
433 caps->DevCaps2 &=
437
438 caps->Caps2 &=
441
442 caps->VertexProcessingCaps &=
446
447 caps->TextureCaps &=
454
457
458 if (caps->PixelShaderVersion > 3)
459 {
460 caps->PixelShaderVersion = D3DPS_VERSION(3, 0);
461 }
462 else
463 {
465 caps->PixelShaderVersion = D3DPS_VERSION(major, ps_minor_version[major]);
466 }
467
468 if (caps->VertexShaderVersion > 3)
469 {
471 }
472 else
473 {
475 caps->VertexShaderVersion = D3DVS_VERSION(major, vs_minor_version[major]);
476 }
477}
#define D3DCAPS2_RESERVED
Definition: d3d8caps.h:23
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY
Definition: d3d8caps.h:36
#define D3DPTEXTURECAPS_CUBEMAP_POW2
Definition: d3d8caps.h:126
#define D3DDEVCAPS_CANRENDERAFTERFLIP
Definition: d3d8caps.h:43
#define D3DVTXPCAPS_LOCALVIEWER
Definition: d3d8caps.h:185
#define D3DPTEXTURECAPS_PROJECTED
Definition: d3d8caps.h:120
#define D3DPRASTERCAPS_WBUFFER
Definition: d3d8caps.h:83
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT
Definition: d3d8caps.h:48
#define D3DPTFILTERCAPS_MIPFLINEAR
Definition: d3d8caps.h:132
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY
Definition: d3d8caps.h:41
#define D3DDEVCAPS_DRAWPRIMITIVES2
Definition: d3d8caps.h:45
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY
Definition: d3d8caps.h:40
#define D3DPTFILTERCAPS_MINFANISOTROPIC
Definition: d3d8caps.h:130
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE
Definition: d3d8caps.h:117
#define D3DDEVCAPS_QUINTICRTPATCHES
Definition: d3d8caps.h:52
#define D3DVTXPCAPS_MATERIALSOURCE7
Definition: d3d8caps.h:182
#define D3DPTFILTERCAPS_MINFLINEAR
Definition: d3d8caps.h:129
#define D3DPTEXTURECAPS_SQUAREONLY
Definition: d3d8caps.h:116
#define D3DDEVCAPS_DRAWPRIMITIVES2EX
Definition: d3d8caps.h:47
#define D3DPTFILTERCAPS_MAGFANISOTROPIC
Definition: d3d8caps.h:135
#define D3DPTEXTURECAPS_ALPHAPALETTE
Definition: d3d8caps.h:118
#define D3DPSHADECAPS_COLORGOURAUDRGB
Definition: d3d8caps.h:109
#define D3DPRASTERCAPS_ZBUFFERLESSHSR
Definition: d3d8caps.h:80
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY
Definition: d3d8caps.h:37
#define D3DPRASTERCAPS_WFOG
Definition: d3d8caps.h:84
#define D3DPSHADECAPS_FOGGOURAUD
Definition: d3d8caps.h:112
#define D3DPTEXTURECAPS_ALPHA
Definition: d3d8caps.h:115
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES
Definition: d3d8caps.h:46
#define D3DPSHADECAPS_SPECULARGOURAUDRGB
Definition: d3d8caps.h:110
#define D3DPTEXTURECAPS_VOLUMEMAP
Definition: d3d8caps.h:122
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2
Definition: d3d8caps.h:127
#define D3DDEVCAPS_DRAWPRIMTLVERTEX
Definition: d3d8caps.h:42
#define D3DPRASTERCAPS_ANISOTROPY
Definition: d3d8caps.h:82
#define D3DVTXPCAPS_DIRECTIONALLIGHTS
Definition: d3d8caps.h:183
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY
Definition: d3d8caps.h:38
#define D3DPRASTERCAPS_COLORPERSPECTIVE
Definition: d3d8caps.h:86
#define D3DDEVCAPS_RTPATCHES
Definition: d3d8caps.h:53
#define D3DCAPS2_CANCALIBRATEGAMMA
Definition: d3d8caps.h:22
#define D3DDEVCAPS_NPATCHES
Definition: d3d8caps.h:55
#define D3DPRASTERCAPS_ZFOG
Definition: d3d8caps.h:85
#define D3DDEVCAPS_RTPATCHHANDLEZERO
Definition: d3d8caps.h:54
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: d3d8caps.h:119
#define D3DPRASTERCAPS_FOGRANGE
Definition: d3d8caps.h:81
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND
Definition: d3d8caps.h:111
#define D3DPTEXTURECAPS_PERSPECTIVE
Definition: d3d8caps.h:113
#define D3DDEVCAPS_HWRASTERIZATION
Definition: d3d8caps.h:50
#define D3DVTXPCAPS_TWEENING
Definition: d3d8caps.h:186
#define D3DPRASTERCAPS_FOGVERTEX
Definition: d3d8caps.h:75
#define D3DPTFILTERCAPS_MAGFLINEAR
Definition: d3d8caps.h:134
#define D3DPTFILTERCAPS_MINFPOINT
Definition: d3d8caps.h:128
#define D3DPTEXTURECAPS_CUBEMAP
Definition: d3d8caps.h:121
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM
Definition: d3d8caps.h:44
#define D3DVTXPCAPS_TEXGEN
Definition: d3d8caps.h:181
#define D3DCAPS2_DYNAMICTEXTURES
Definition: d3d8caps.h:25
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL
Definition: d3d8caps.h:49
#define D3DPRASTERCAPS_FOGTABLE
Definition: d3d8caps.h:76
#define D3DCAPS2_CANMANAGERESOURCE
Definition: d3d8caps.h:24
#define D3DPTEXTURECAPS_MIPCUBEMAP
Definition: d3d8caps.h:125
#define D3DPTFILTERCAPS_MIPFPOINT
Definition: d3d8caps.h:131
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY
Definition: d3d8caps.h:39
#define D3DPRASTERCAPS_ZTEST
Definition: d3d8caps.h:74
#define D3DVTXPCAPS_POSITIONALLIGHTS
Definition: d3d8caps.h:184
#define D3DDEVCAPS_PUREDEVICE
Definition: d3d8caps.h:51
#define D3DCAPS2_FULLSCREENGAMMA
Definition: d3d8caps.h:20
#define D3DPTEXTURECAPS_MIPMAP
Definition: d3d8caps.h:123
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
#define D3DPTFILTERCAPS_MAGFPOINT
Definition: d3d8caps.h:133
#define D3DPRASTERCAPS_MIPMAPLODBIAS
Definition: d3d8caps.h:78
#define D3DPTEXTURECAPS_MIPVOLUMEMAP
Definition: d3d8caps.h:124
#define D3DPRASTERCAPS_DITHER
Definition: d3d8caps.h:72
#define D3DPS_VERSION(major, minor)
Definition: d3d8types.h:474
enum _D3DDEVTYPE D3DDEVTYPE
#define D3DVS_VERSION(major, minor)
Definition: d3d8types.h:475
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER
Definition: d3d9caps.h:200
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH
Definition: d3d9caps.h:204
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH
Definition: d3d9caps.h:203
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
Definition: d3d9caps.h:92
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV
Definition: d3d9caps.h:136
#define D3DDEVCAPS2_DMAPNPATCH
Definition: d3d9caps.h:202
#define D3DPRASTERCAPS_SCISSORTEST
Definition: d3d9caps.h:91
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES
Definition: d3d9caps.h:205
#define D3DPRASTERCAPS_DEPTHBIAS
Definition: d3d9caps.h:93
#define D3DDEVCAPS2_STREAMOFFSET
Definition: d3d9caps.h:201
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH
Definition: d3d9caps.h:206
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD
Definition: d3d9caps.h:141
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD
Definition: d3d9caps.h:140
#define D3DCAPS2_CANAUTOGENMIPMAP
Definition: d3d9caps.h:22
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE
Definition: d3d9caps.h:94
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD
Definition: d3d9caps.h:148
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP
Definition: d3d9caps.h:199
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET
Definition: d3d9caps.h:207
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD
Definition: d3d9caps.h:147
#define major(rdev)
Definition: propsheet.cpp:928
D3DDEVTYPE DeviceType
Definition: d3d9caps.h:264
float MaxVertexW
Definition: d3d9caps.h:292
DWORD TextureOpCaps
Definition: d3d9caps.h:300
DWORD DevCaps2
Definition: d3d9caps.h:317
DWORD MaxTextureWidth
Definition: d3d9caps.h:286
DWORD Caps3
Definition: d3d9caps.h:268
DWORD MaxVertexBlendMatrixIndex
Definition: d3d9caps.h:307
DWORD MaxTextureHeight
Definition: d3d9caps.h:287
DWORD VertexProcessingCaps
Definition: d3d9caps.h:303
DWORD DevCaps
Definition: d3d9caps.h:271
float GuardBandBottom
Definition: d3d9caps.h:296
DWORD DestBlendCaps
Definition: d3d9caps.h:276
DWORD RasterCaps
Definition: d3d9caps.h:273
DWORD MaxUserClipPlanes
Definition: d3d9caps.h:305
UINT MasterAdapterOrdinal
Definition: d3d9caps.h:320
DWORD Caps2
Definition: d3d9caps.h:267
DWORD MaxVertexIndex
Definition: d3d9caps.h:310
DWORD TextureFilterCaps
Definition: d3d9caps.h:280
DWORD MaxAnisotropy
Definition: d3d9caps.h:291
DWORD PixelShaderVersion
Definition: d3d9caps.h:315
DWORD ShadeCaps
Definition: d3d9caps.h:278
DWORD StretchRectFilterCaps
Definition: d3d9caps.h:325
DWORD PrimitiveMiscCaps
Definition: d3d9caps.h:272
DWORD LineCaps
Definition: d3d9caps.h:285
DWORD MaxPShaderInstructionsExecuted
Definition: d3d9caps.h:330
UINT AdapterOrdinalInGroup
Definition: d3d9caps.h:321
D3DVSHADERCAPS2_0 VS20Caps
Definition: d3d9caps.h:326
float GuardBandRight
Definition: d3d9caps.h:295
DWORD VolumeTextureAddressCaps
Definition: d3d9caps.h:284
DWORD MaxVolumeExtent
Definition: d3d9caps.h:288
DWORD MaxTextureAspectRatio
Definition: d3d9caps.h:290
DWORD FVFCaps
Definition: d3d9caps.h:299
DWORD ZCmpCaps
Definition: d3d9caps.h:274
float PixelShader1xMaxValue
Definition: d3d9caps.h:316
UINT AdapterOrdinal
Definition: d3d9caps.h:265
DWORD CursorCaps
Definition: d3d9caps.h:270
DWORD VertexShaderVersion
Definition: d3d9caps.h:313
DWORD MaxTextureRepeat
Definition: d3d9caps.h:289
DWORD Caps
Definition: d3d9caps.h:266
DWORD MaxVertexBlendMatrices
Definition: d3d9caps.h:306
float GuardBandLeft
Definition: d3d9caps.h:293
float MaxPointSize
Definition: d3d9caps.h:308
float ExtentsAdjust
Definition: d3d9caps.h:297
DWORD MaxPrimitiveCount
Definition: d3d9caps.h:309
DWORD CubeTextureFilterCaps
Definition: d3d9caps.h:281
DWORD MaxPixelShader30InstructionSlots
Definition: d3d9caps.h:332
DWORD MaxTextureBlendStages
Definition: d3d9caps.h:301
DWORD PresentationIntervals
Definition: d3d9caps.h:269
UINT NumberOfAdaptersInGroup
Definition: d3d9caps.h:322
D3DPSHADERCAPS2_0 PS20Caps
Definition: d3d9caps.h:327
DWORD MaxVertexShader30InstructionSlots
Definition: d3d9caps.h:331
DWORD TextureAddressCaps
Definition: d3d9caps.h:283
DWORD MaxSimultaneousTextures
Definition: d3d9caps.h:302
DWORD MaxVertexShaderConst
Definition: d3d9caps.h:314
DWORD MaxActiveLights
Definition: d3d9caps.h:304
float GuardBandTop
Definition: d3d9caps.h:294
DWORD MaxStreams
Definition: d3d9caps.h:311
float MaxNpatchTessellationLevel
Definition: d3d9caps.h:318
DWORD MaxVShaderInstructionsExecuted
Definition: d3d9caps.h:329
DWORD SrcBlendCaps
Definition: d3d9caps.h:275
DWORD NumSimultaneousRTs
Definition: d3d9caps.h:324
DWORD AlphaCmpCaps
Definition: d3d9caps.h:277
DWORD StencilCaps
Definition: d3d9caps.h:298
DWORD TextureCaps
Definition: d3d9caps.h:279
DWORD VertexTextureFilterCaps
Definition: d3d9caps.h:328
DWORD DeclTypes
Definition: d3d9caps.h:323
DWORD VolumeTextureFilterCaps
Definition: d3d9caps.h:282
DWORD MaxStreamStride
Definition: d3d9caps.h:312
INT StaticFlowControlDepth
Definition: d3d9caps.h:257
INT DynamicFlowControlDepth
Definition: d3d9caps.h:255
INT DynamicFlowControlDepth
Definition: d3d9caps.h:246
INT StaticFlowControlDepth
Definition: d3d9caps.h:248
DWORD MaxVertexShader30InstructionSlots
Definition: wined3d.h:1968
DWORD DevCaps
Definition: wined3d.h:1895
DWORD MaxVertexShaderConst
Definition: wined3d.h:1946
DWORD MaxPrimitiveCount
Definition: wined3d.h:1940
DWORD MaxTextureAspectRatio
Definition: wined3d.h:1915
DWORD ShadeCaps
Definition: wined3d.h:1902
DWORD PrimitiveMiscCaps
Definition: wined3d.h:1896
struct wined3d_pixel_shader_caps PS20Caps
Definition: wined3d.h:1964
DWORD CursorCaps
Definition: wined3d.h:1894
DWORD MaxStreamStride
Definition: wined3d.h:1943
DWORD MaxVertexBlendMatrixIndex
Definition: wined3d.h:1936
float GuardBandRight
Definition: wined3d.h:1921
DWORD TextureFilterCaps
Definition: wined3d.h:1904
DWORD DeclTypes
Definition: wined3d.h:1960
DWORD VolumeTextureFilterCaps
Definition: wined3d.h:1906
DWORD MaxTextureHeight
Definition: wined3d.h:1912
UINT MasterAdapterOrdinal
Definition: wined3d.h:1957
DWORD MaxAnisotropy
Definition: wined3d.h:1916
float MaxNpatchTessellationLevel
Definition: wined3d.h:1954
UINT AdapterOrdinalInGroup
Definition: wined3d.h:1958
DWORD StretchRectFilterCaps
Definition: wined3d.h:1962
UINT NumberOfAdaptersInGroup
Definition: wined3d.h:1959
DWORD MaxTextureWidth
Definition: wined3d.h:1911
float MaxVertexW
Definition: wined3d.h:1917
DWORD CubeTextureFilterCaps
Definition: wined3d.h:1905
DWORD AlphaCmpCaps
Definition: wined3d.h:1901
DWORD NumSimultaneousRTs
Definition: wined3d.h:1961
float PixelShader1xMaxValue
Definition: wined3d.h:1949
DWORD TextureAddressCaps
Definition: wined3d.h:1907
DWORD MaxVolumeExtent
Definition: wined3d.h:1913
float GuardBandBottom
Definition: wined3d.h:1922
DWORD DevCaps2
Definition: wined3d.h:1952
struct wined3d_vertex_shader_caps VS20Caps
Definition: wined3d.h:1963
DWORD Caps
Definition: wined3d.h:1889
DWORD LineCaps
Definition: wined3d.h:1909
DWORD MaxVShaderInstructionsExecuted
Definition: wined3d.h:1966
DWORD MaxTextureRepeat
Definition: wined3d.h:1914
DWORD PixelShaderVersion
Definition: wined3d.h:1948
DWORD StencilCaps
Definition: wined3d.h:1925
DWORD MaxUserClipPlanes
Definition: wined3d.h:1934
UINT AdapterOrdinal
Definition: wined3d.h:1887
DWORD VertexProcessingCaps
Definition: wined3d.h:1932
float MaxPointSize
Definition: wined3d.h:1938
DWORD VolumeTextureAddressCaps
Definition: wined3d.h:1908
DWORD TextureCaps
Definition: wined3d.h:1903
DWORD MaxTextureBlendStages
Definition: wined3d.h:1929
DWORD DestBlendCaps
Definition: wined3d.h:1900
float ExtentsAdjust
Definition: wined3d.h:1924
float GuardBandLeft
Definition: wined3d.h:1919
DWORD TextureOpCaps
Definition: wined3d.h:1928
DWORD Caps3
Definition: wined3d.h:1891
DWORD MaxStreams
Definition: wined3d.h:1942
DWORD MaxVertexBlendMatrices
Definition: wined3d.h:1935
DWORD ZCmpCaps
Definition: wined3d.h:1898
enum wined3d_device_type DeviceType
Definition: wined3d.h:1886
DWORD MaxSimultaneousTextures
Definition: wined3d.h:1930
DWORD VertexTextureFilterCaps
Definition: wined3d.h:1965
DWORD VertexShaderVersion
Definition: wined3d.h:1945
DWORD PresentationIntervals
Definition: wined3d.h:1892
float GuardBandTop
Definition: wined3d.h:1920
DWORD FVFCaps
Definition: wined3d.h:1927
DWORD RasterCaps
Definition: wined3d.h:1897
DWORD SrcBlendCaps
Definition: wined3d.h:1899
DWORD Caps2
Definition: wined3d.h:1890
DWORD MaxVertexIndex
Definition: wined3d.h:1941
DWORD MaxPixelShader30InstructionSlots
Definition: wined3d.h:1969
DWORD MaxActiveLights
Definition: wined3d.h:1933
DWORD MaxPShaderInstructionsExecuted
Definition: wined3d.h:1967

◆ d3dformat_from_wined3dformat()

D3DFORMAT d3dformat_from_wined3dformat ( enum wined3d_format_id  format)

Definition at line 35 of file device.c.

36{
37 BYTE *c = (BYTE *)&format;
38
39 /* Don't translate FOURCC formats */
40 if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format;
41
42 switch(format)
43 {
53 case WINED3DFMT_A8_UNORM: return D3DFMT_A8;
63 case WINED3DFMT_P8_UINT: return D3DFMT_P8;
64 case WINED3DFMT_L8_UNORM: return D3DFMT_L8;
93 default:
94 FIXME("Unhandled wined3d format %#x.\n", format);
95 return D3DFMT_UNKNOWN;
96 }
97}
#define isprint(c)
Definition: acclib.h:73
@ D3DFMT_L6V5U5
Definition: d3d8types.h:625
@ D3DFMT_A1R5G5B5
Definition: d3d8types.h:608
@ D3DFMT_A8P8
Definition: d3d8types.h:617
@ D3DFMT_D16
Definition: d3d8types.h:644
@ D3DFMT_X1R5G5B5
Definition: d3d8types.h:607
@ D3DFMT_D16_LOCKABLE
Definition: d3d8types.h:640
@ D3DFMT_R8G8B8
Definition: d3d8types.h:603
@ D3DFMT_R3G3B2
Definition: d3d8types.h:610
@ D3DFMT_A8L8
Definition: d3d8types.h:621
@ D3DFMT_V16U16
Definition: d3d8types.h:628
@ D3DFMT_A8R8G8B8
Definition: d3d8types.h:604
@ D3DFMT_A2B10G10R10
Definition: d3d8types.h:614
@ D3DFMT_X8L8V8U8
Definition: d3d8types.h:626
@ D3DFMT_A8
Definition: d3d8types.h:611
@ D3DFMT_X4R4G4B4
Definition: d3d8types.h:613
@ D3DFMT_R5G6B5
Definition: d3d8types.h:606
@ D3DFMT_A8R3G3B2
Definition: d3d8types.h:612
@ D3DFMT_V8U8
Definition: d3d8types.h:624
@ D3DFMT_A4R4G4B4
Definition: d3d8types.h:609
@ D3DFMT_D24S8
Definition: d3d8types.h:643
@ D3DFMT_D32
Definition: d3d8types.h:641
@ D3DFMT_D24X8
Definition: d3d8types.h:645
@ D3DFMT_P8
Definition: d3d8types.h:618
@ D3DFMT_INDEX32
Definition: d3d8types.h:650
@ D3DFMT_UNKNOWN
Definition: d3d8types.h:601
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
@ D3DFMT_L8
Definition: d3d8types.h:620
@ D3DFMT_G16R16
Definition: d3d8types.h:615
@ D3DFMT_A2W10V10U10
Definition: d3d8types.h:630
@ D3DFMT_Q8W8V8U8
Definition: d3d8types.h:627
@ D3DFMT_D15S1
Definition: d3d8types.h:642
@ D3DFMT_D24X4S4
Definition: d3d8types.h:646
@ D3DFMT_A4L4
Definition: d3d8types.h:622
@ D3DFMT_A32B32G32R32F
Definition: d3d9types.h:836
@ D3DFMT_CxV8U8
Definition: d3d9types.h:838
@ D3DFMT_D24FS8
Definition: d3d9types.h:817
@ D3DFMT_A16B16G16R16F
Definition: d3d9types.h:831
@ D3DFMT_D32F_LOCKABLE
Definition: d3d9types.h:816
@ D3DFMT_R32F
Definition: d3d9types.h:834
@ D3DFMT_X8B8G8R8
Definition: d3d9types.h:777
@ D3DFMT_Q16W16V16U16
Definition: d3d9types.h:827
@ D3DFMT_A2R10G10B10
Definition: d3d9types.h:779
@ D3DFMT_G32R32F
Definition: d3d9types.h:835
@ D3DFMT_A8B8G8R8
Definition: d3d9types.h:776
@ D3DFMT_A16B16G16R16
Definition: d3d9types.h:780
@ D3DFMT_L16
Definition: d3d9types.h:815
@ D3DFMT_G16R16F
Definition: d3d9types.h:830
@ D3DFMT_R16F
Definition: d3d9types.h:829
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:111
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:110
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:171
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:176
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:158
@ WINED3DFMT_R8G8_SNORM_Cx
Definition: wined3d.h:134
@ WINED3DFMT_R32G32_FLOAT
Definition: wined3d.h:150
@ WINED3DFMT_R16G16_SNORM
Definition: wined3d.h:173
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_R8G8B8A8_SNORM
Definition: wined3d.h:167
@ WINED3DFMT_S8_UINT_D24_FLOAT
Definition: wined3d.h:133
@ WINED3DFMT_D16_LOCKABLE
Definition: wined3d.h:127
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_B2G3R3A8_UNORM
Definition: wined3d.h:112
@ WINED3DFMT_L8A8_UNORM
Definition: wined3d.h:119
@ WINED3DFMT_L4A4_UNORM
Definition: wined3d.h:120
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_R8G8B8X8_UNORM
Definition: wined3d.h:114
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:109
@ WINED3DFMT_B10G10R10A2_UNORM
Definition: wined3d.h:115
@ WINED3DFMT_R16G16B16A16_FLOAT
Definition: wined3d.h:144
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:191
@ WINED3DFMT_L8_UNORM
Definition: wined3d.h:118
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:187
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:121
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:108
@ WINED3DFMT_R32_UINT
Definition: wined3d.h:178
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:126
@ WINED3DFMT_R16_FLOAT
Definition: wined3d.h:190
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:164
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:145
@ WINED3DFMT_R32_FLOAT
Definition: wined3d.h:177
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:122
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_R16G16_FLOAT
Definition: wined3d.h:170
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3DFMT_L16_UNORM
Definition: wined3d.h:132
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:193
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:201
@ WINED3DFMT_R32G32B32A32_FLOAT
Definition: wined3d.h:136
@ WINED3DFMT_B4G4R4X4_UNORM
Definition: wined3d.h:113
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:181
@ WINED3DFMT_P8_UINT_A8_UNORM
Definition: wined3d.h:116
@ WINED3DFMT_R16G16B16A16_SNORM
Definition: wined3d.h:147
unsigned char BYTE
Definition: xxhash.c:193

Referenced by d3d8_EnumAdapterModes(), d3d8_GetAdapterDisplayMode(), d3d8_indexbuffer_GetDesc(), d3d8_surface_GetDesc(), d3d8_texture_2d_GetLevelDesc(), d3d8_texture_3d_GetLevelDesc(), d3d8_texture_cube_GetLevelDesc(), d3d8_volume_GetDesc(), d3d9_EnumAdapterModes(), d3d9_EnumAdapterModesEx(), d3d9_GetAdapterDisplayMode(), d3d9_GetAdapterDisplayModeEx(), d3d9_indexbuffer_GetDesc(), d3d9_surface_GetDesc(), d3d9_swapchain_GetDisplayMode(), d3d9_swapchain_GetDisplayModeEx(), d3d9_texture_2d_GetLevelDesc(), d3d9_texture_3d_GetLevelDesc(), d3d9_texture_cube_GetLevelDesc(), and d3d9_volume_GetDesc().

◆ d3dswapeffect_from_wined3dswapeffect()

static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect ( enum wined3d_swap_effect  effect)
static

Definition at line 213 of file device.c.

214{
215 switch (effect)
216 {
220 return D3DSWAPEFFECT_FLIP;
222 return D3DSWAPEFFECT_COPY;
227 default:
228 FIXME("Unhandled swap effect %#x.\n", effect);
229 return D3DSWAPEFFECT_FLIP;
230 }
231}
@ D3DSWAPEFFECT_FLIP
Definition: d3d8types.h:852
@ D3DSWAPEFFECT_DISCARD
Definition: d3d8types.h:851
@ D3DSWAPEFFECT_COPY
Definition: d3d8types.h:853
@ D3DSWAPEFFECT_FLIPEX
Definition: d3d9types.h:1075
@ D3DSWAPEFFECT_OVERLAY
Definition: d3d9types.h:1074
@ WINED3D_SWAP_EFFECT_COPY
Definition: wined3d.h:529
@ WINED3D_SWAP_EFFECT_SEQUENTIAL
Definition: wined3d.h:526
@ WINED3D_SWAP_EFFECT_DISCARD
Definition: wined3d.h:525
@ WINED3D_SWAP_EFFECT_OVERLAY
Definition: wined3d.h:531
@ WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL
Definition: wined3d.h:528

◆ device_from_device_parent()

static struct d3d9_device * device_from_device_parent ( struct wined3d_device_parent device_parent)
inlinestatic

Definition at line 4020 of file device.c.

4021{
4022 return CONTAINING_RECORD(device_parent, struct d3d9_device, device_parent);
4023}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ device_get_fvf_declaration()

static struct wined3d_vertex_declaration * device_get_fvf_declaration ( struct d3d9_device device,
DWORD  fvf 
)
static

Definition at line 3013 of file device.c.

3014{
3015 struct wined3d_vertex_declaration *wined3d_declaration;
3016 struct fvf_declaration *fvf_decls = device->fvf_decls;
3017 struct d3d9_vertex_declaration *d3d9_declaration;
3019 int p, low, high; /* deliberately signed */
3020 HRESULT hr;
3021
3022 TRACE("Searching for declaration for fvf %08x... ", fvf);
3023
3024 low = 0;
3025 high = device->fvf_decl_count - 1;
3026 while (low <= high)
3027 {
3028 p = (low + high) >> 1;
3029 TRACE("%d ", p);
3030
3031 if (fvf_decls[p].fvf == fvf)
3032 {
3033 TRACE("found %p.\n", fvf_decls[p].decl);
3034 return fvf_decls[p].decl;
3035 }
3036
3037 if (fvf_decls[p].fvf < fvf)
3038 low = p + 1;
3039 else
3040 high = p - 1;
3041 }
3042 TRACE("not found. Creating and inserting at position %d.\n", low);
3043
3045 return NULL;
3046
3047 hr = d3d9_vertex_declaration_create(device, elements, &d3d9_declaration);
3049 if (FAILED(hr))
3050 return NULL;
3051
3052 if (device->fvf_decl_size == device->fvf_decl_count)
3053 {
3054 UINT grow = max(device->fvf_decl_size / 2, 8);
3055
3056 if (!(fvf_decls = heap_realloc(fvf_decls, sizeof(*fvf_decls) * (device->fvf_decl_size + grow))))
3057 {
3059 return NULL;
3060 }
3061 device->fvf_decls = fvf_decls;
3062 device->fvf_decl_size += grow;
3063 }
3064
3065 d3d9_declaration->fvf = fvf;
3066 wined3d_declaration = d3d9_declaration->wined3d_declaration;
3069
3070 memmove(fvf_decls + low + 1, fvf_decls + low, sizeof(*fvf_decls) * (device->fvf_decl_count - low));
3071 fvf_decls[low].decl = wined3d_declaration;
3072 fvf_decls[low].fvf = fvf;
3073 ++device->fvf_decl_count;
3074
3075 TRACE("Returning %p. %u declarations in array.\n", wined3d_declaration, device->fvf_decl_count);
3076
3077 return wined3d_declaration;
3078}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define IDirect3DVertexDeclaration9_Release(p)
Definition: d3d9.h:1185
GLfloat GLfloat p
Definition: glext.h:8902
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
struct wined3d_vertex_declaration * decl
Definition: d3d9_private.h:73
HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements) DECLSPEC_HIDDEN
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)

Referenced by d3d9_device_SetFVF().

◆ device_init()

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 
)

Definition at line 4174 of file device.c.

4177{
4178 struct wined3d_swapchain_desc *swapchain_desc;
4179 unsigned i, count = 1;
4180 WINED3DCAPS caps;
4181 HRESULT hr;
4182
4183 if (mode)
4184 FIXME("Ignoring display mode.\n");
4185
4186 device->IDirect3DDevice9Ex_iface.lpVtbl = &d3d9_device_vtbl;
4187 device->device_parent.ops = &d3d9_wined3d_device_parent_ops;
4188 device->refcount = 1;
4189
4191
4194 &device->device_parent, &device->wined3d_device)))
4195 {
4196 WARN("Failed to create wined3d device, hr %#x.\n", hr);
4198 return hr;
4199 }
4200
4202 device->max_user_clip_planes = caps.MaxUserClipPlanes;
4205
4208
4209 if (!parameters->Windowed)
4210 {
4211 if (!focus_window)
4212 focus_window = parameters->hDeviceWindow;
4213 if (FAILED(hr = wined3d_device_acquire_focus_window(device->wined3d_device, focus_window)))
4214 {
4215 ERR("Failed to acquire focus window, hr %#x.\n", hr);
4216 wined3d_device_decref(device->wined3d_device);
4218 return hr;
4219 }
4220
4221 for (i = 0; i < count; ++i)
4222 {
4223 HWND device_window = parameters[i].hDeviceWindow;
4224
4225 if (!device_window) device_window = focus_window;
4227 parameters[i].BackBufferWidth,
4228 parameters[i].BackBufferHeight);
4229 }
4230 }
4231
4232 if (!(swapchain_desc = heap_alloc(sizeof(*swapchain_desc) * count)))
4233 {
4234 ERR("Failed to allocate wined3d parameters.\n");
4236 wined3d_device_decref(device->wined3d_device);
4238 return E_OUTOFMEMORY;
4239 }
4240
4241 for (i = 0; i < count; ++i)
4242 {
4243 if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc[i], &parameters[i],
4244 parent->extended))
4245 {
4247 wined3d_device_decref(device->wined3d_device);
4248 heap_free(swapchain_desc);
4250 return D3DERR_INVALIDCALL;
4251 }
4252 }
4253
4254 if (FAILED(hr = wined3d_device_init_3d(device->wined3d_device, swapchain_desc)))
4255 {
4256 WARN("Failed to initialize 3D, hr %#x.\n", hr);
4258 heap_free(swapchain_desc);
4259 wined3d_device_decref(device->wined3d_device);
4261 return hr;
4262 }
4263
4266
4268 {
4269 wined3d_device_uninit_3d(device->wined3d_device);
4271 wined3d_device_decref(device->wined3d_device);
4273 return E_OUTOFMEMORY;
4274 }
4275
4276 for (i = 0; i < count; ++i)
4277 {
4278 present_parameters_from_wined3d_swapchain_desc(&parameters[i], &swapchain_desc[i]);
4279 }
4280
4282
4283 heap_free(swapchain_desc);
4284
4285 /* Initialize the converted declaration array. This creates a valid pointer
4286 * and when adding decls HeapReAlloc() can be used without further checking. */
4287 if (!(device->fvf_decls = heap_alloc(0)))
4288 {
4289 ERR("Failed to allocate FVF vertex declaration map memory.\n");
4291 heap_free(device->implicit_swapchains);
4292 wined3d_device_uninit_3d(device->wined3d_device);
4294 wined3d_device_decref(device->wined3d_device);
4296 return E_OUTOFMEMORY;
4297 }
4298
4299 /* We could also simply ignore the initial rendertarget since it's known
4300 * not to be a texture (we currently use these only for automatic mipmap
4301 * generation). */
4304 wined3d_device_get_rendertarget_view(device->wined3d_device, 0));
4306
4307 IDirect3D9Ex_AddRef(&parent->IDirect3D9Ex_iface);
4308 device->d3d_parent = parent;
4309
4310 return D3D_OK;
4311}
#define D3DCREATE_ADAPTERGROUP_DEVICE
Definition: d3d9.h:49
#define IDirect3D9Ex_AddRef(p)
Definition: d3d9.h:308
device_type
static void setup_fpu(void)
Definition: device.c:3262
static const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl
Definition: device.c:3879
static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops
Definition: device.c:4146
void CDECL wined3d_device_setup_fullscreen_window(struct wined3d_device *device, HWND window, UINT w, UINT h)
Definition: device.c:853
HRESULT CDECL wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window)
Definition: device.c:938
void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
Definition: device.c:1290
HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc)
Definition: device.c:1061
r parent
Definition: btrfs.c:3010
return adapter
#define D3DCREATE_MULTITHREADED
Definition: d3d8.h:42
#define D3DCREATE_FPU_PRESERVE
Definition: d3d8.h:41
BOOL enable_auto_depth_stencil
Definition: wined3d.h:1742
HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
Definition: directx.c:6244
HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, WINED3DCAPS *caps)
Definition: directx.c:5659

◆ device_parent_activate()

static void CDECL device_parent_activate ( struct wined3d_device_parent device_parent,
BOOL  activate 
)
static

Definition at line 4036 of file device.c.

4037{
4039
4040 TRACE("device_parent %p, activate %#x.\n", device_parent, activate);
4041
4042 if (!device->d3d_parent)
4043 return;
4044
4045 if (!activate)
4047 else if (device->d3d_parent->extended)
4049 else
4051}
static struct d3d8_device * device_from_device_parent(struct wined3d_device_parent *device_parent)
Definition: device.c:3137
#define InterlockedCompareExchange
Definition: interlocked.h:104
struct wined3d_device_parent device_parent
Definition: d3d9_private.h:87

◆ device_parent_create_swapchain()

static HRESULT CDECL device_parent_create_swapchain ( struct wined3d_device_parent device_parent,
struct wined3d_swapchain_desc desc,
struct wined3d_swapchain **  swapchain 
)
static

Definition at line 4122 of file device.c.

4124{
4126 struct d3d9_swapchain *d3d_swapchain;
4127 HRESULT hr;
4128
4129 TRACE("device_parent %p, desc %p, swapchain %p\n", device_parent, desc, swapchain);
4130
4131 hr = d3d9_swapchain_create(device, desc, &d3d_swapchain);
4132 if (FAILED(hr))
4133 {
4134 WARN("Failed to create swapchain, hr %#x.\n", hr);
4135 *swapchain = NULL;
4136 return hr;
4137 }
4138
4139 *swapchain = d3d_swapchain->wined3d_swapchain;
4140 wined3d_swapchain_incref(*swapchain);
4142
4143 return hr;
4144}
#define IDirect3DSwapChain9Ex_Release(p)
Definition: d3d9.h:497
IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex_iface
Definition: d3d9_private.h:148
struct wined3d_swapchain * wined3d_swapchain
Definition: d3d9_private.h:150
ULONG CDECL wined3d_swapchain_incref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:104

◆ device_parent_create_swapchain_texture()

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

Definition at line 4091 of file device.c.

4094{
4096 struct d3d9_surface *d3d_surface;
4097 HRESULT hr;
4098
4099 TRACE("device_parent %p, container_parent %p, desc %p, texture flags %#x, texture %p.\n",
4100 device_parent, container_parent, desc, texture_flags, texture);
4101
4102 if (container_parent == device_parent)
4103 container_parent = &device->IDirect3DDevice9Ex_iface;
4104
4105 if (is_gdi_compat_wined3dformat(desc->format))
4106 texture_flags |= WINED3D_TEXTURE_CREATE_GET_DC;
4107
4108 if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, 1,
4109 texture_flags | WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, container_parent,
4111 {
4112 WARN("Failed to create texture, hr %#x.\n", hr);
4113 return hr;
4114 }
4115
4117 d3d_surface->parent_device = &device->IDirect3DDevice9Ex_iface;
4118
4119 return hr;
4120}

◆ device_parent_mode_changed()

static void CDECL device_parent_mode_changed ( struct wined3d_device_parent device_parent)
static

Definition at line 4031 of file device.c.

4032{
4033 TRACE("device_parent %p.\n", device_parent);
4034}

◆ device_parent_surface_created()

static HRESULT CDECL device_parent_surface_created ( struct wined3d_device_parent device_parent,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
void **  parent,
const struct wined3d_parent_ops **  parent_ops 
)
static

Definition at line 4053 of file device.c.

4056{
4057 struct d3d9_surface *d3d_surface;
4058
4059 TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
4060 device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops);
4061
4062 if (!(d3d_surface = heap_alloc_zero(sizeof(*d3d_surface))))
4063 return E_OUTOFMEMORY;
4064
4065 surface_init(d3d_surface, wined3d_texture, sub_resource_idx, parent_ops);
4066 *parent = d3d_surface;
4067 TRACE("Created surface %p.\n", d3d_surface);
4068
4069 return D3D_OK;
4070}
void surface_init(struct d3d8_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
Definition: surface.c:317

◆ device_parent_volume_created()

static HRESULT CDECL device_parent_volume_created ( struct wined3d_device_parent device_parent,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
void **  parent,
const struct wined3d_parent_ops **  parent_ops 
)
static

Definition at line 4072 of file device.c.

4075{
4076 struct d3d9_volume *d3d_volume;
4077
4078 TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
4079 device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops);
4080
4081 if (!(d3d_volume = heap_alloc_zero(sizeof(*d3d_volume))))
4082 return E_OUTOFMEMORY;
4083
4084 volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops);
4085 *parent = d3d_volume;
4086 TRACE("Created volume %p.\n", d3d_volume);
4087
4088 return D3D_OK;
4089}
void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
Definition: volume.c:209
unsigned int sub_resource_idx
Definition: d3d9_private.h:139

◆ device_parent_wined3d_device_created()

static void CDECL device_parent_wined3d_device_created ( struct wined3d_device_parent device_parent,
struct wined3d_device device 
)
static

Definition at line 4025 of file device.c.

4027{
4028 TRACE("device_parent %p, device %p.\n", device_parent, device);
4029}

◆ is_gdi_compat_wined3dformat()

BOOL is_gdi_compat_wined3dformat ( enum wined3d_format_id  format)

Definition at line 1389 of file device.c.

1390{
1391 switch (format)
1392 {
1399 return TRUE;
1400 default:
1401 return FALSE;
1402 }
1403}

Referenced by cubetexture_init(), d3d9_device_create_surface(), device_parent_create_swapchain_texture(), and texture_init().

◆ present_parameters_from_wined3d_swapchain_desc()

void present_parameters_from_wined3d_swapchain_desc ( D3DPRESENT_PARAMETERS present_parameters,
const struct wined3d_swapchain_desc swapchain_desc 
)

Definition at line 233 of file device.c.

235{
236 present_parameters->BackBufferWidth = swapchain_desc->backbuffer_width;
237 present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height;
238 present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format);
239 present_parameters->BackBufferCount = swapchain_desc->backbuffer_count;
240 present_parameters->MultiSampleType = swapchain_desc->multisample_type;
241 present_parameters->MultiSampleQuality = swapchain_desc->multisample_quality;
242 present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect);
243 present_parameters->hDeviceWindow = swapchain_desc->device_window;
244 present_parameters->Windowed = swapchain_desc->windowed;
245 present_parameters->EnableAutoDepthStencil = swapchain_desc->enable_auto_depth_stencil;
246 present_parameters->AutoDepthStencilFormat
248 present_parameters->Flags = swapchain_desc->flags & D3DPRESENTFLAGS_MASK;
249 present_parameters->FullScreen_RefreshRateInHz = swapchain_desc->refresh_rate;
250 present_parameters->PresentationInterval = swapchain_desc->swap_interval;
251}
#define D3DPRESENTFLAGS_MASK
Definition: d3d8_private.h:40
static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect(enum wined3d_swap_effect effect)
Definition: device.c:193
D3DSWAPEFFECT SwapEffect
Definition: d3d8types.h:1128
D3DMULTISAMPLE_TYPE MultiSampleType
Definition: d3d8types.h:1126
D3DFORMAT AutoDepthStencilFormat
Definition: d3d8types.h:1132
enum wined3d_multisample_type multisample_type
Definition: wined3d.h:1737
enum wined3d_format_id auto_depth_stencil_format
Definition: wined3d.h:1743
enum wined3d_format_id backbuffer_format
Definition: wined3d.h:1734
enum wined3d_swap_effect swap_effect
Definition: wined3d.h:1739

◆ reset_enum_callback()

static HRESULT CDECL reset_enum_callback ( struct wined3d_resource resource)
static

Definition at line 825 of file device.c.

826{
828 IDirect3DBaseTexture9 *texture;
829 struct d3d9_surface *surface;
831
834 return D3D_OK;
835
836 if (desc.resource_type != WINED3D_RTYPE_TEXTURE_2D)
837 {
838 WARN("Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", resource);
839 return D3DERR_INVALIDCALL;
840 }
841
843 if (parent && SUCCEEDED(IUnknown_QueryInterface(parent, &IID_IDirect3DBaseTexture9, (void **)&texture)))
844 {
846 WARN("Texture %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", texture, resource);
847 return D3DERR_INVALIDCALL;
848 }
849
851 if (!surface->resource.refcount)
852 return D3D_OK;
853
854 WARN("Surface %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface);
855 return D3DERR_INVALIDCALL;
856}
#define IDirect3DBaseTexture9_Release(p)
Definition: d3d9.h:835
void *CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource)
Definition: resource.c:285
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:295
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:2210
struct d3d9_resource resource
Definition: d3d9_private.h:160

◆ setup_fpu()

static void setup_fpu ( void  )
static

Definition at line 4157 of file device.c.

4158{
4159#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
4160 WORD cw;
4161 __asm__ volatile ("fnstcw %0" : "=m" (cw));
4162 cw = (cw & ~0xf3f) | 0x3f;
4163 __asm__ volatile ("fldcw %0" : : "m" (cw));
4164#elif defined(__i386__) && defined(_MSC_VER)
4165 WORD cw;
4166 __asm fnstcw cw;
4167 cw = (cw & ~0xf3f) | 0x3f;
4168 __asm fldcw cw;
4169#else
4170 FIXME("FPU setup not implemented for this platform.\n");
4171#endif
4172}
unsigned short WORD
Definition: ntddk_ex.h:93
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

◆ vertex_count_from_primitive_count()

static UINT vertex_count_from_primitive_count ( D3DPRIMITIVETYPE  primitive_type,
UINT  primitive_count 
)
static

Definition at line 187 of file device.c.

188{
189 switch (primitive_type)
190 {
191 case D3DPT_POINTLIST:
192 return primitive_count;
193
194 case D3DPT_LINELIST:
195 return primitive_count * 2;
196
197 case D3DPT_LINESTRIP:
198 return primitive_count + 1;
199
201 return primitive_count * 3;
202
205 return primitive_count + 2;
206
207 default:
208 FIXME("Unhandled primitive type %#x.\n", primitive_type);
209 return 0;
210 }
211}
@ D3DPT_LINELIST
Definition: d3d8types.h:719
@ D3DPT_POINTLIST
Definition: d3d8types.h:718
@ D3DPT_TRIANGLELIST
Definition: d3d8types.h:721
@ D3DPT_LINESTRIP
Definition: d3d8types.h:720
@ D3DPT_TRIANGLEFAN
Definition: d3d8types.h:723
@ D3DPT_TRIANGLESTRIP
Definition: d3d8types.h:722

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d9  )

◆ wined3d_swapchain_desc_from_present_parameters()

static BOOL wined3d_swapchain_desc_from_present_parameters ( struct wined3d_swapchain_desc swapchain_desc,
const D3DPRESENT_PARAMETERS present_parameters,
BOOL  extended 
)
static

Definition at line 273 of file device.c.

275{
276 D3DSWAPEFFECT highest_swapeffect = extended ? D3DSWAPEFFECT_FLIPEX : D3DSWAPEFFECT_COPY;
277 UINT highest_bb_count = extended ? 30 : 3;
278
279 if (!present_parameters->SwapEffect || present_parameters->SwapEffect > highest_swapeffect)
280 {
281 WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect);
282 return FALSE;
283 }
284 if (present_parameters->BackBufferCount > highest_bb_count
285 || (present_parameters->SwapEffect == D3DSWAPEFFECT_COPY
286 && present_parameters->BackBufferCount > 1))
287 {
288 WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount);
289 return FALSE;
290 }
291
292 swapchain_desc->backbuffer_width = present_parameters->BackBufferWidth;
293 swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight;
294 swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat);
295 swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount);
297 swapchain_desc->multisample_type = present_parameters->MultiSampleType;
298 swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality;
299 swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect);
300 swapchain_desc->device_window = present_parameters->hDeviceWindow;
301 swapchain_desc->windowed = present_parameters->Windowed;
302 swapchain_desc->enable_auto_depth_stencil = present_parameters->EnableAutoDepthStencil;
303 swapchain_desc->auto_depth_stencil_format
305 swapchain_desc->flags
307 swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz;
308 swapchain_desc->swap_interval = present_parameters->PresentationInterval;
309 swapchain_desc->auto_restore_display_mode = TRUE;
310
311 if (present_parameters->Flags & ~D3DPRESENTFLAGS_MASK)
312 FIXME("Unhandled flags %#x.\n", present_parameters->Flags & ~D3DPRESENTFLAGS_MASK);
313
314 return TRUE;
315}
enum _D3DSWAPEFFECT D3DSWAPEFFECT
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect(D3DSWAPEFFECT effect)
Definition: device.c:230
BOOL auto_restore_display_mode
Definition: wined3d.h:1747
#define WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
Definition: wined3d.h:883

◆ wined3dformat_from_d3dformat()

enum wined3d_format_id wined3dformat_from_d3dformat ( D3DFORMAT  format)

Definition at line 99 of file device.c.

100{
101 BYTE *c = (BYTE *)&format;
102
103 /* Don't translate FOURCC formats */
104 if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format;
105
106 switch(format)
107 {
117 case D3DFMT_A8: return WINED3DFMT_A8_UNORM;
127 case D3DFMT_P8: return WINED3DFMT_P8_UINT;
128 case D3DFMT_L8: return WINED3DFMT_L8_UNORM;
138 case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
143 case D3DFMT_D16: return WINED3DFMT_D16_UNORM;
144 case D3DFMT_L16: return WINED3DFMT_L16_UNORM;
157 default:
158 FIXME("Unhandled D3DFORMAT %#x.\n", format);
159 return WINED3DFMT_UNKNOWN;
160 }
161}

Referenced by cubetexture_init(), d3d8_CheckDepthStencilMatch(), d3d8_CheckDeviceFormat(), d3d8_CheckDeviceMultiSampleType(), d3d8_CheckDeviceType(), d3d9_CheckDepthStencilMatch(), d3d9_CheckDeviceFormat(), d3d9_CheckDeviceFormatConversion(), d3d9_CheckDeviceMultiSampleType(), d3d9_CheckDeviceType(), d3d9_EnumAdapterModes(), d3d9_EnumAdapterModesEx(), d3d9_GetAdapterModeCount(), d3d9_GetAdapterModeCountEx(), indexbuffer_init(), texture_init(), and volumetexture_init().

◆ wined3dmapflags_from_d3dmapflags()

unsigned int wined3dmapflags_from_d3dmapflags ( unsigned int  flags)

Definition at line 163 of file device.c.

164{
165 static const unsigned int handled = D3DLOCK_NOSYSLOCK
170 unsigned int wined3d_flags;
171
172 wined3d_flags = flags & handled;
174 wined3d_flags |= WINED3D_MAP_READ;
175 if (!(flags & D3DLOCK_READONLY))
176 wined3d_flags |= WINED3D_MAP_WRITE;
177 if (!(wined3d_flags & (WINED3D_MAP_READ | WINED3D_MAP_WRITE)))
178 wined3d_flags |= WINED3D_MAP_READ | WINED3D_MAP_WRITE;
179 flags &= ~(handled | D3DLOCK_READONLY);
180
181 if (flags)
182 FIXME("Unhandled flags %#x.\n", flags);
183
184 return wined3d_flags;
185}
#define D3DLOCK_DISCARD
Definition: d3d8types.h:72
#define D3DLOCK_NO_DIRTY_UPDATE
Definition: d3d8types.h:73
#define D3DLOCK_NOOVERWRITE
Definition: d3d8types.h:71
#define D3DLOCK_NOSYSLOCK
Definition: d3d8types.h:70
#define D3DLOCK_READONLY
Definition: d3d8types.h:69
#define D3DLOCK_DONOTWAIT
Definition: d3d9types.h:76
#define WINED3D_MAP_READ
Definition: wined3d.h:939

Referenced by d3d8_indexbuffer_Lock(), d3d8_surface_LockRect(), d3d8_vertexbuffer_Lock(), d3d8_volume_LockBox(), d3d9_indexbuffer_Lock(), d3d9_surface_LockRect(), d3d9_vertexbuffer_Lock(), and d3d9_volume_LockBox().

◆ wined3dswapeffect_from_d3dswapeffect()

static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect ( D3DSWAPEFFECT  effect)
static

Definition at line 253 of file device.c.

254{
255 switch (effect)
256 {
267 default:
268 FIXME("Unhandled swap effect %#x.\n", effect);
270 }
271}

Variable Documentation

◆ d3d9_device_vtbl

const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl
static

Definition at line 3879 of file device.c.

Referenced by device_init().

◆ d3d9_null_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d9_null_wined3d_object_destroyed(void *parent)
Definition: device.c:28

Definition at line 30 of file device.c.

Referenced by d3d9_device_create_surface(), d3d9_device_prepare_index_buffer(), d3d9_device_prepare_vertex_buffer(), device_parent_create_swapchain_texture(), and query_init().

◆ d3d9_wined3d_device_parent_ops

const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops
static
Initial value:
=
{
}
static void CDECL device_parent_mode_changed(struct wined3d_device_parent *device_parent)
Definition: device.c:3148
static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate)
Definition: device.c:3153
static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
Definition: device.c:3165
static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
Definition: device.c:3184
static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
Definition: device.c:3228
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)
Definition: device.c:3203
static void CDECL device_parent_wined3d_device_created(struct wined3d_device_parent *device_parent, struct wined3d_device *device)
Definition: device.c:3142

Definition at line 4146 of file device.c.

Referenced by device_init().

◆ tss_lookup

Definition at line 2377 of file device.c.