ReactOS  0.4.15-dev-1068-g467feb9
texture.c File Reference
#include "config.h"
#include "d3d9_private.h"
Include dependency graph for texture.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d9)
 
static struct d3d9_textureimpl_from_IDirect3DTexture9 (IDirect3DTexture9 *iface)
 
static struct d3d9_textureimpl_from_IDirect3DCubeTexture9 (IDirect3DCubeTexture9 *iface)
 
static struct d3d9_textureimpl_from_IDirect3DVolumeTexture9 (IDirect3DVolumeTexture9 *iface)
 
static void STDMETHODCALLTYPE srv_wined3d_object_destroyed (void *parent)
 
static struct wined3d_shader_resource_viewd3d9_texture_acquire_shader_resource_view (struct d3d9_texture *texture)
 
static void d3d9_texture_cleanup (struct d3d9_texture *texture)
 
void d3d9_texture_gen_auto_mipmap (struct d3d9_texture *texture)
 
void d3d9_texture_flag_auto_gen_mipmap (struct d3d9_texture *texture)
 
static HRESULT WINAPI d3d9_texture_2d_QueryInterface (IDirect3DTexture9 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_texture_2d_AddRef (IDirect3DTexture9 *iface)
 
static ULONG WINAPI d3d9_texture_2d_Release (IDirect3DTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_2d_GetDevice (IDirect3DTexture9 *iface, IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3d9_texture_2d_SetPrivateData (IDirect3DTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_2d_GetPrivateData (IDirect3DTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d9_texture_2d_FreePrivateData (IDirect3DTexture9 *iface, REFGUID guid)
 
static DWORD WINAPI d3d9_texture_2d_SetPriority (IDirect3DTexture9 *iface, DWORD priority)
 
static DWORD WINAPI d3d9_texture_2d_GetPriority (IDirect3DTexture9 *iface)
 
static void WINAPI d3d9_texture_2d_PreLoad (IDirect3DTexture9 *iface)
 
static D3DRESOURCETYPE WINAPI d3d9_texture_2d_GetType (IDirect3DTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_2d_SetLOD (IDirect3DTexture9 *iface, DWORD lod)
 
static DWORD WINAPI d3d9_texture_2d_GetLOD (IDirect3DTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_2d_GetLevelCount (IDirect3DTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_2d_SetAutoGenFilterType (IDirect3DTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
 
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_2d_GetAutoGenFilterType (IDirect3DTexture9 *iface)
 
static void WINAPI d3d9_texture_2d_GenerateMipSubLevels (IDirect3DTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc (IDirect3DTexture9 *iface, UINT level, D3DSURFACE_DESC *desc)
 
static HRESULT WINAPI d3d9_texture_2d_GetSurfaceLevel (IDirect3DTexture9 *iface, UINT level, IDirect3DSurface9 **surface)
 
static HRESULT WINAPI d3d9_texture_2d_LockRect (IDirect3DTexture9 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_2d_UnlockRect (IDirect3DTexture9 *iface, UINT level)
 
static HRESULT WINAPI d3d9_texture_2d_AddDirtyRect (IDirect3DTexture9 *iface, const RECT *dirty_rect)
 
static HRESULT WINAPI d3d9_texture_cube_QueryInterface (IDirect3DCubeTexture9 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_texture_cube_AddRef (IDirect3DCubeTexture9 *iface)
 
static ULONG WINAPI d3d9_texture_cube_Release (IDirect3DCubeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_cube_GetDevice (IDirect3DCubeTexture9 *iface, IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3d9_texture_cube_SetPrivateData (IDirect3DCubeTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_cube_GetPrivateData (IDirect3DCubeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d9_texture_cube_FreePrivateData (IDirect3DCubeTexture9 *iface, REFGUID guid)
 
static DWORD WINAPI d3d9_texture_cube_SetPriority (IDirect3DCubeTexture9 *iface, DWORD priority)
 
static DWORD WINAPI d3d9_texture_cube_GetPriority (IDirect3DCubeTexture9 *iface)
 
static void WINAPI d3d9_texture_cube_PreLoad (IDirect3DCubeTexture9 *iface)
 
static D3DRESOURCETYPE WINAPI d3d9_texture_cube_GetType (IDirect3DCubeTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_cube_SetLOD (IDirect3DCubeTexture9 *iface, DWORD lod)
 
static DWORD WINAPI d3d9_texture_cube_GetLOD (IDirect3DCubeTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_cube_GetLevelCount (IDirect3DCubeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_cube_SetAutoGenFilterType (IDirect3DCubeTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
 
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_cube_GetAutoGenFilterType (IDirect3DCubeTexture9 *iface)
 
static void WINAPI d3d9_texture_cube_GenerateMipSubLevels (IDirect3DCubeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc (IDirect3DCubeTexture9 *iface, UINT level, D3DSURFACE_DESC *desc)
 
static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface (IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface9 **surface)
 
static HRESULT WINAPI d3d9_texture_cube_LockRect (IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_cube_UnlockRect (IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level)
 
static HRESULT WINAPI d3d9_texture_cube_AddDirtyRect (IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
 
static HRESULT WINAPI d3d9_texture_3d_QueryInterface (IDirect3DVolumeTexture9 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_texture_3d_AddRef (IDirect3DVolumeTexture9 *iface)
 
static ULONG WINAPI d3d9_texture_3d_Release (IDirect3DVolumeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_3d_GetDevice (IDirect3DVolumeTexture9 *iface, IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3d9_texture_3d_SetPrivateData (IDirect3DVolumeTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_3d_GetPrivateData (IDirect3DVolumeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d9_texture_3d_FreePrivateData (IDirect3DVolumeTexture9 *iface, REFGUID guid)
 
static DWORD WINAPI d3d9_texture_3d_SetPriority (IDirect3DVolumeTexture9 *iface, DWORD priority)
 
static DWORD WINAPI d3d9_texture_3d_GetPriority (IDirect3DVolumeTexture9 *iface)
 
static void WINAPI d3d9_texture_3d_PreLoad (IDirect3DVolumeTexture9 *iface)
 
static D3DRESOURCETYPE WINAPI d3d9_texture_3d_GetType (IDirect3DVolumeTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_3d_SetLOD (IDirect3DVolumeTexture9 *iface, DWORD lod)
 
static DWORD WINAPI d3d9_texture_3d_GetLOD (IDirect3DVolumeTexture9 *iface)
 
static DWORD WINAPI d3d9_texture_3d_GetLevelCount (IDirect3DVolumeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_3d_SetAutoGenFilterType (IDirect3DVolumeTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
 
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_3d_GetAutoGenFilterType (IDirect3DVolumeTexture9 *iface)
 
static void WINAPI d3d9_texture_3d_GenerateMipSubLevels (IDirect3DVolumeTexture9 *iface)
 
static HRESULT WINAPI d3d9_texture_3d_GetLevelDesc (IDirect3DVolumeTexture9 *iface, UINT level, D3DVOLUME_DESC *desc)
 
static HRESULT WINAPI d3d9_texture_3d_GetVolumeLevel (IDirect3DVolumeTexture9 *iface, UINT level, IDirect3DVolume9 **volume)
 
static HRESULT WINAPI d3d9_texture_3d_LockBox (IDirect3DVolumeTexture9 *iface, UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
 
static HRESULT WINAPI d3d9_texture_3d_UnlockBox (IDirect3DVolumeTexture9 *iface, UINT level)
 
static HRESULT WINAPI d3d9_texture_3d_AddDirtyBox (IDirect3DVolumeTexture9 *iface, const D3DBOX *dirty_box)
 
struct d3d9_textureunsafe_impl_from_IDirect3DBaseTexture9 (IDirect3DBaseTexture9 *iface)
 
static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed (void *parent)
 
HRESULT texture_init (struct d3d9_texture *texture, struct d3d9_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 
HRESULT cubetexture_init (struct d3d9_texture *texture, struct d3d9_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 
HRESULT volumetexture_init (struct d3d9_texture *texture, struct d3d9_device *device, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 

Variables

static const struct wined3d_parent_ops d3d9_srv_wined3d_parent_ops
 
static const IDirect3DTexture9Vtbl d3d9_texture_2d_vtbl
 
static const IDirect3DCubeTexture9Vtbl d3d9_texture_cube_vtbl
 
static const IDirect3DVolumeTexture9Vtbl d3d9_texture_3d_vtbl
 
static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops
 

Function Documentation

◆ cubetexture_init()

HRESULT cubetexture_init ( struct d3d9_texture texture,
struct d3d9_device device,
UINT  edge_length,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool 
)

Definition at line 1369 of file texture.c.

1371 {
1372  struct wined3d_resource_desc desc;
1373  DWORD flags = 0;
1374  HRESULT hr;
1375 
1376  texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl;
1377  d3d9_resource_init(&texture->resource);
1378  list_init(&texture->rtv_list);
1379  texture->usage = usage;
1380 
1381  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1383  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1384  desc.multisample_quality = 0;
1387  if (pool == D3DPOOL_SCRATCH)
1388  desc.usage |= WINED3DUSAGE_SCRATCH;
1391  desc.width = edge_length;
1392  desc.height = edge_length;
1393  desc.depth = 1;
1394  desc.size = 0;
1395 
1398 
1399  if (is_gdi_compat_wined3dformat(desc.format))
1401 
1403  {
1404  if (pool == D3DPOOL_SYSTEMMEM)
1405  {
1406  WARN("D3DUSAGE_AUTOGENMIPMAP texture can't be in D3DPOOL_SYSTEMMEM, returning D3DERR_INVALIDCALL.\n");
1407  return D3DERR_INVALIDCALL;
1408  }
1409  if (levels && levels != 1)
1410  {
1411  WARN("D3DUSAGE_AUTOGENMIPMAP texture with %u levels, returning D3DERR_INVALIDCALL.\n", levels);
1412  return D3DERR_INVALIDCALL;
1413  }
1415  texture->autogen_filter_type = D3DTEXF_LINEAR;
1416  levels = 0;
1417  }
1418  else
1419  {
1420  texture->autogen_filter_type = D3DTEXF_NONE;
1421  }
1422  if (!levels)
1423  levels = wined3d_log2i(edge_length) + 1;
1424 
1426  hr = wined3d_texture_create(device->wined3d_device, &desc, 6, levels, flags,
1427  NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture);
1429  if (FAILED(hr))
1430  {
1431  WARN("Failed to create wined3d cube texture, hr %#x.\n", hr);
1432  return hr;
1433  }
1434 
1435  texture->parent_device = &device->IDirect3DDevice9Ex_iface;
1436  IDirect3DDevice9Ex_AddRef(texture->parent_device);
1437 
1438  return D3D_OK;
1439 }
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
#define WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS
Definition: wined3d.h:1562
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
GLsizei levels
Definition: glext.h:7884
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void d3d9_resource_init(struct d3d9_resource *resource)
Definition: d3d9_main.c:216
BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:1389
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
#define D3DERR_INVALIDCALL
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_GET_DC
Definition: wined3d.h:1561
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
static DWORD wined3dusage_from_d3dusage(unsigned int usage)
Definition: d3d9_private.h:334
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define D3D_OK
Definition: d3d.h:106
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static const IDirect3DCubeTexture9Vtbl d3d9_texture_cube_vtbl
Definition: texture.c:906
static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops
Definition: texture.c:1292
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

◆ d3d9_texture_2d_AddDirtyRect()

static HRESULT WINAPI d3d9_texture_2d_AddDirtyRect ( IDirect3DTexture9 *  iface,
const RECT dirty_rect 
)
static

Definition at line 459 of file texture.c.

460 {
462  HRESULT hr;
463 
464  TRACE("iface %p, dirty_rect %s.\n",
465  iface, wine_dbgstr_rect(dirty_rect));
466 
468  if (!dirty_rect)
469  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL);
470  else
471  {
472  struct wined3d_box dirty_region;
473 
474  wined3d_box_set(&dirty_region, dirty_rect->left, dirty_rect->top, dirty_rect->right, dirty_rect->bottom, 0, 1);
475  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region);
476  }
478 
479  return hr;
480 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
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
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
const char * wine_dbgstr_rect(const RECT *rect)
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
LONG bottom
Definition: windef.h:309
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_AddRef()

static ULONG WINAPI d3d9_texture_2d_AddRef ( IDirect3DTexture9 *  iface)
static

Definition at line 134 of file texture.c.

135 {
137  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
138 
139  TRACE("%p increasing refcount to %u.\n", iface, ref);
140 
141  if (ref == 1)
142  {
143  struct d3d9_surface *surface;
144 
145  IDirect3DDevice9Ex_AddRef(texture->parent_device);
147  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d9_surface, rtv_entry)
148  {
150  }
151  wined3d_texture_incref(texture->wined3d_texture);
153  }
154 
155  return ref;
156 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164
Definition: send.c:48
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
GLenum GLint ref
Definition: glext.h:6028
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
struct list rtv_entry
Definition: d3d9_private.h:163
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_FreePrivateData()

static HRESULT WINAPI d3d9_texture_2d_FreePrivateData ( IDirect3DTexture9 *  iface,
REFGUID  guid 
)
static

Definition at line 204 of file texture.c.

205 {
207  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
208 
209  return d3d9_resource_free_private_data(&texture->resource, guid);
210 }
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid)
Definition: d3d9_main.c:160

◆ d3d9_texture_2d_GenerateMipSubLevels()

static void WINAPI d3d9_texture_2d_GenerateMipSubLevels ( IDirect3DTexture9 *  iface)
static

Definition at line 339 of file texture.c.

340 {
342 
343  TRACE("iface %p.\n", iface);
344 
348 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void d3d9_texture_gen_auto_mipmap(struct d3d9_texture *texture)
Definition: texture.c:99
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_GetAutoGenFilterType()

static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_2d_GetAutoGenFilterType ( IDirect3DTexture9 *  iface)
static

Definition at line 327 of file texture.c.

328 {
330 
331  TRACE("iface %p.\n", iface);
332 
333  if (!(texture->usage & D3DUSAGE_AUTOGENMIPMAP))
334  WARN("Called on a texture without the D3DUSAGE_AUTOGENMIPMAP flag.\n");
335 
336  return texture->autogen_filter_type;
337 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26

◆ d3d9_texture_2d_GetDevice()

static HRESULT WINAPI d3d9_texture_2d_GetDevice ( IDirect3DTexture9 *  iface,
IDirect3DDevice9 **  device 
)
static

Definition at line 170 of file texture.c.

171 {
173 
174  TRACE("iface %p, device %p.\n", iface, device);
175 
176  *device = (IDirect3DDevice9 *)texture->parent_device;
178 
179  TRACE("Returning device %p.\n", *device);
180 
181  return D3D_OK;
182 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26

◆ d3d9_texture_2d_GetLevelCount()

static DWORD WINAPI d3d9_texture_2d_GetLevelCount ( IDirect3DTexture9 *  iface)
static

Definition at line 290 of file texture.c.

291 {
293  DWORD ret;
294 
295  TRACE("iface %p.\n", iface);
296 
297  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP)
298  return 1;
299 
301  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
303 
304  return ret;
305 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_GetLevelDesc()

static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc ( IDirect3DTexture9 *  iface,
UINT  level,
D3DSURFACE_DESC desc 
)
static

Definition at line 350 of file texture.c.

351 {
353  struct wined3d_sub_resource_desc wined3d_desc;
354  HRESULT hr;
355 
356  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
357 
358  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
359  {
360  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
361  return D3DERR_INVALIDCALL;
362  }
363 
365  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
366  {
367  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
368  desc->Type = D3DRTYPE_SURFACE;
369  desc->Usage = texture->usage;
370  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
371  desc->MultiSampleType = wined3d_desc.multisample_type;
372  desc->MultiSampleQuality = wined3d_desc.multisample_quality;
373  desc->Width = wined3d_desc.width;
374  desc->Height = wined3d_desc.height;
375  }
377 
378  return hr;
379 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:3480
static const WCHAR desc[]
Definition: protectdata.c:36
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:49

◆ d3d9_texture_2d_GetLOD()

static DWORD WINAPI d3d9_texture_2d_GetLOD ( IDirect3DTexture9 *  iface)
static

Definition at line 276 of file texture.c.

277 {
279  DWORD ret;
280 
281  TRACE("iface %p.\n", iface);
282 
284  ret = wined3d_texture_get_lod(texture->wined3d_texture);
286 
287  return ret;
288 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_GetPriority()

static DWORD WINAPI d3d9_texture_2d_GetPriority ( IDirect3DTexture9 *  iface)
static

Definition at line 228 of file texture.c.

229 {
231  const struct wined3d_resource *resource;
232  DWORD ret;
233 
234  TRACE("iface %p.\n", iface);
235 
237  resource = wined3d_texture_get_resource(texture->wined3d_texture);
240 
241  return ret;
242 }
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_GetPrivateData()

static HRESULT WINAPI d3d9_texture_2d_GetPrivateData ( IDirect3DTexture9 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 194 of file texture.c.

196 {
198  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
199  iface, debugstr_guid(guid), data, data_size);
200 
201  return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size);
202 }
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d9_main.c:178
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26

◆ d3d9_texture_2d_GetSurfaceLevel()

static HRESULT WINAPI d3d9_texture_2d_GetSurfaceLevel ( IDirect3DTexture9 *  iface,
UINT  level,
IDirect3DSurface9 **  surface 
)
static

Definition at line 381 of file texture.c.

383 {
385  struct d3d9_surface *surface_impl;
386 
387  TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
388 
389  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
390  {
391  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
392  return D3DERR_INVALIDCALL;
393  }
394 
396  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
397  {
399  return D3DERR_INVALIDCALL;
400  }
401 
402  *surface = &surface_impl->IDirect3DSurface9_iface;
403  IDirect3DSurface9_AddRef(*surface);
405 
406  return D3D_OK;
407 }
GLint level
Definition: gl.h:1546
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define D3D_OK
Definition: d3d.h:106
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_GetType()

static D3DRESOURCETYPE WINAPI d3d9_texture_2d_GetType ( IDirect3DTexture9 *  iface)
static

Definition at line 255 of file texture.c.

256 {
257  TRACE("iface %p.\n", iface);
258 
259  return D3DRTYPE_TEXTURE;
260 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_2d_LockRect()

static HRESULT WINAPI d3d9_texture_2d_LockRect ( IDirect3DTexture9 *  iface,
UINT  level,
D3DLOCKED_RECT locked_rect,
const RECT rect,
DWORD  flags 
)
static

Definition at line 409 of file texture.c.

411 {
413  struct d3d9_surface *surface_impl;
414  HRESULT hr;
415 
416  TRACE("iface %p, level %u, locked_rect %p, rect %p, flags %#x.\n",
417  iface, level, locked_rect, rect, flags);
418 
419  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
420  {
421  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
422  return D3DERR_INVALIDCALL;
423  }
424 
426  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
428  else
429  hr = IDirect3DSurface9_LockRect(&surface_impl->IDirect3DSurface9_iface, locked_rect, rect, flags);
431 
432  return hr;
433 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
& rect
Definition: startmenu.cpp:1413
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
#define IDirect3DSurface9_LockRect(p, a, b, c)
Definition: d3d9.h:635
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_PreLoad()

static void WINAPI d3d9_texture_2d_PreLoad ( IDirect3DTexture9 *  iface)
static

Definition at line 244 of file texture.c.

245 {
247 
248  TRACE("iface %p.\n", iface);
249 
253 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_QueryInterface()

static HRESULT WINAPI d3d9_texture_2d_QueryInterface ( IDirect3DTexture9 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 114 of file texture.c.

115 {
116  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
117 
118  if (IsEqualGUID(riid, &IID_IDirect3DTexture9)
119  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture9)
120  || IsEqualGUID(riid, &IID_IDirect3DResource9)
122  {
124  *out = iface;
125  return S_OK;
126  }
127 
128  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
129 
130  *out = NULL;
131  return E_NOINTERFACE;
132 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
#define IDirect3DTexture9_AddRef(p)
Definition: d3d9.h:1013
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3d9_texture_2d_Release()

static ULONG WINAPI d3d9_texture_2d_Release ( IDirect3DTexture9 *  iface)
static

Definition at line 158 of file texture.c.

159 {
161  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
162 
163  TRACE("%p decreasing refcount to %u.\n", iface, ref);
164 
165  if (!ref)
167  return ref;
168 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static void d3d9_texture_cleanup(struct d3d9_texture *texture)
Definition: texture.c:81
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
unsigned int ULONG
Definition: retypes.h:1

◆ d3d9_texture_2d_SetAutoGenFilterType()

static HRESULT WINAPI d3d9_texture_2d_SetAutoGenFilterType ( IDirect3DTexture9 *  iface,
D3DTEXTUREFILTERTYPE  filter_type 
)
static

Definition at line 307 of file texture.c.

308 {
310 
311  TRACE("iface %p, filter_type %#x.\n", iface, filter_type);
312 
313  if (filter_type == D3DTEXF_NONE)
314  {
315  WARN("Invalid filter type D3DTEXF_NONE specified.\n");
316  return D3DERR_INVALIDCALL;
317  }
318  if (!(texture->usage & D3DUSAGE_AUTOGENMIPMAP))
319  WARN("Called on a texture without the D3DUSAGE_AUTOGENMIPMAP flag.\n");
320  else if (filter_type != D3DTEXF_LINEAR)
321  FIXME("Unsupported filter type %u.\n", filter_type);
322 
323  texture->autogen_filter_type = filter_type;
324  return D3D_OK;
325 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3D_OK
Definition: d3d.h:106
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26

◆ d3d9_texture_2d_SetLOD()

static DWORD WINAPI d3d9_texture_2d_SetLOD ( IDirect3DTexture9 *  iface,
DWORD  lod 
)
static

Definition at line 262 of file texture.c.

263 {
265  DWORD ret;
266 
267  TRACE("iface %p, lod %u.\n", iface, lod);
268 
270  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
272 
273  return ret;
274 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
int ret
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
GLint lod
Definition: glext.h:7795
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_SetPriority()

static DWORD WINAPI d3d9_texture_2d_SetPriority ( IDirect3DTexture9 *  iface,
DWORD  priority 
)
static

Definition at line 212 of file texture.c.

213 {
215  struct wined3d_resource *resource;
216  DWORD ret;
217 
218  TRACE("iface %p, priority %u.\n", iface, priority);
219 
221  resource = wined3d_texture_get_resource(texture->wined3d_texture);
224 
225  return ret;
226 }
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_2d_SetPrivateData()

static HRESULT WINAPI d3d9_texture_2d_SetPrivateData ( IDirect3DTexture9 *  iface,
REFGUID  guid,
const void data,
DWORD  data_size,
DWORD  flags 
)
static

Definition at line 184 of file texture.c.

186 {
188  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
189  iface, debugstr_guid(guid), data, data_size, flags);
190 
191  return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
192 }
HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d9_main.c:222
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26

◆ d3d9_texture_2d_UnlockRect()

static HRESULT WINAPI d3d9_texture_2d_UnlockRect ( IDirect3DTexture9 *  iface,
UINT  level 
)
static

Definition at line 435 of file texture.c.

436 {
438  struct d3d9_surface *surface_impl;
439  HRESULT hr;
440 
441  TRACE("iface %p, level %u.\n", iface, level);
442 
443  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
444  {
445  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
446  return D3DERR_INVALIDCALL;
447  }
448 
450  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
452  else
455 
456  return hr;
457 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
static struct d3d9_texture * impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface)
Definition: texture.c:26
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
#define IDirect3DSurface9_UnlockRect(p)
Definition: d3d9.h:636
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_AddDirtyBox()

static HRESULT WINAPI d3d9_texture_3d_AddDirtyBox ( IDirect3DVolumeTexture9 *  iface,
const D3DBOX dirty_box 
)
static

Definition at line 1224 of file texture.c.

1225 {
1227  HRESULT hr;
1228 
1229  TRACE("iface %p, dirty_box %p.\n", iface, dirty_box);
1230 
1232  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const struct wined3d_box *)dirty_box);
1234 
1235  return hr;
1236 }
HRESULT hr
Definition: shlfolder.c:183
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_AddRef()

static ULONG WINAPI d3d9_texture_3d_AddRef ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 956 of file texture.c.

957 {
959  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
960 
961  TRACE("%p increasing refcount to %u.\n", iface, ref);
962 
963  if (ref == 1)
964  {
965  IDirect3DDevice9Ex_AddRef(texture->parent_device);
967  wined3d_texture_incref(texture->wined3d_texture);
969  }
970 
971  return ref;
972 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_FreePrivateData()

static HRESULT WINAPI d3d9_texture_3d_FreePrivateData ( IDirect3DVolumeTexture9 *  iface,
REFGUID  guid 
)
static

Definition at line 1020 of file texture.c.

1021 {
1023  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
1024 
1025  return d3d9_resource_free_private_data(&texture->resource, guid);
1026 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid)
Definition: d3d9_main.c:160

◆ d3d9_texture_3d_GenerateMipSubLevels()

static void WINAPI d3d9_texture_3d_GenerateMipSubLevels ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1135 of file texture.c.

1136 {
1137  TRACE("iface %p.\n", iface);
1138 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_3d_GetAutoGenFilterType()

static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_3d_GetAutoGenFilterType ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1128 of file texture.c.

1129 {
1130  TRACE("iface %p.\n", iface);
1131 
1132  return D3DTEXF_NONE;
1133 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_3d_GetDevice()

static HRESULT WINAPI d3d9_texture_3d_GetDevice ( IDirect3DVolumeTexture9 *  iface,
IDirect3DDevice9 **  device 
)
static

Definition at line 986 of file texture.c.

987 {
989 
990  TRACE("iface %p, device %p.\n", iface, device);
991 
992  *device = (IDirect3DDevice9 *)texture->parent_device;
994 
995  TRACE("Returning device %p.\n", *device);
996 
997  return D3D_OK;
998 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106

◆ d3d9_texture_3d_GetLevelCount()

static DWORD WINAPI d3d9_texture_3d_GetLevelCount ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1106 of file texture.c.

1107 {
1109  DWORD ret;
1110 
1111  TRACE("iface %p.\n", iface);
1112 
1114  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
1116 
1117  return ret;
1118 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_GetLevelDesc()

static HRESULT WINAPI d3d9_texture_3d_GetLevelDesc ( IDirect3DVolumeTexture9 *  iface,
UINT  level,
D3DVOLUME_DESC desc 
)
static

Definition at line 1140 of file texture.c.

1141 {
1143  struct wined3d_sub_resource_desc wined3d_desc;
1144  HRESULT hr;
1145 
1146  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
1147 
1149  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
1150  {
1151  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
1152  desc->Type = D3DRTYPE_VOLUME;
1153  desc->Usage = texture->usage;
1154  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
1155  desc->Width = wined3d_desc.width;
1156  desc->Height = wined3d_desc.height;
1157  desc->Depth = wined3d_desc.depth;
1158  }
1160 
1161  return hr;
1162 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
static const WCHAR desc[]
Definition: protectdata.c:36
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:49

◆ d3d9_texture_3d_GetLOD()

static DWORD WINAPI d3d9_texture_3d_GetLOD ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1092 of file texture.c.

1093 {
1095  DWORD ret;
1096 
1097  TRACE("iface %p.\n", iface);
1098 
1100  ret = wined3d_texture_get_lod(texture->wined3d_texture);
1102 
1103  return ret;
1104 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_GetPriority()

static DWORD WINAPI d3d9_texture_3d_GetPriority ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1044 of file texture.c.

1045 {
1047  const struct wined3d_resource *resource;
1048  DWORD ret;
1049 
1050  TRACE("iface %p.\n", iface);
1051 
1053  resource = wined3d_texture_get_resource(texture->wined3d_texture);
1056 
1057  return ret;
1058 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_GetPrivateData()

static HRESULT WINAPI d3d9_texture_3d_GetPrivateData ( IDirect3DVolumeTexture9 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 1010 of file texture.c.

1012 {
1014  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
1015  iface, debugstr_guid(guid), data, data_size);
1016 
1017  return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size);
1018 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d9_main.c:178
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ d3d9_texture_3d_GetType()

static D3DRESOURCETYPE WINAPI d3d9_texture_3d_GetType ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1071 of file texture.c.

1072 {
1073  TRACE("iface %p.\n", iface);
1074 
1075  return D3DRTYPE_VOLUMETEXTURE;
1076 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_3d_GetVolumeLevel()

static HRESULT WINAPI d3d9_texture_3d_GetVolumeLevel ( IDirect3DVolumeTexture9 *  iface,
UINT  level,
IDirect3DVolume9 **  volume 
)
static

Definition at line 1164 of file texture.c.

1166 {
1168  struct d3d9_volume *volume_impl;
1169 
1170  TRACE("iface %p, level %u, volume %p.\n", iface, level, volume);
1171 
1173  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
1174  {
1176  return D3DERR_INVALIDCALL;
1177  }
1178 
1179  *volume = &volume_impl->IDirect3DVolume9_iface;
1182 
1183  return D3D_OK;
1184 }
GLint level
Definition: gl.h:1546
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define IDirect3DVolume9_AddRef(p)
Definition: d3d9.h:382
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
IDirect3DVolume9 IDirect3DVolume9_iface
Definition: d3d9_private.h:136
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_LockBox()

static HRESULT WINAPI d3d9_texture_3d_LockBox ( IDirect3DVolumeTexture9 *  iface,
UINT  level,
D3DLOCKED_BOX locked_box,
const D3DBOX box,
DWORD  flags 
)
static

Definition at line 1186 of file texture.c.

1188 {
1190  struct d3d9_volume *volume_impl;
1191  HRESULT hr;
1192 
1193  TRACE("iface %p, level %u, locked_box %p, box %p, flags %#x.\n",
1194  iface, level, locked_box, box, flags);
1195 
1197  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
1199  else
1200  hr = IDirect3DVolume9_LockBox(&volume_impl->IDirect3DVolume9_iface, locked_box, box, flags);
1202 
1203  return hr;
1204 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
#define IDirect3DVolume9_LockBox(p, a, b, c)
Definition: d3d9.h:391
GLbitfield flags
Definition: glext.h:7161
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
IDirect3DVolume9 IDirect3DVolume9_iface
Definition: d3d9_private.h:136
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
Definition: palette.c:467

◆ d3d9_texture_3d_PreLoad()

static void WINAPI d3d9_texture_3d_PreLoad ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 1060 of file texture.c.

1061 {
1063 
1064  TRACE("iface %p.\n", iface);
1065 
1069 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_QueryInterface()

static HRESULT WINAPI d3d9_texture_3d_QueryInterface ( IDirect3DVolumeTexture9 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 936 of file texture.c.

937 {
938  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
939 
940  if (IsEqualGUID(riid, &IID_IDirect3DVolumeTexture9)
941  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture9)
942  || IsEqualGUID(riid, &IID_IDirect3DResource9)
944  {
946  *out = iface;
947  return S_OK;
948  }
949 
950  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
951 
952  *out = NULL;
953  return E_NOINTERFACE;
954 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define IDirect3DVolumeTexture9_AddRef(p)
Definition: d3d9.h:1108

◆ d3d9_texture_3d_Release()

static ULONG WINAPI d3d9_texture_3d_Release ( IDirect3DVolumeTexture9 *  iface)
static

Definition at line 974 of file texture.c.

975 {
977  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
978 
979  TRACE("%p decreasing refcount to %u.\n", iface, ref);
980 
981  if (!ref)
983  return ref;
984 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static void d3d9_texture_cleanup(struct d3d9_texture *texture)
Definition: texture.c:81
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

◆ d3d9_texture_3d_SetAutoGenFilterType()

static HRESULT WINAPI d3d9_texture_3d_SetAutoGenFilterType ( IDirect3DVolumeTexture9 *  iface,
D3DTEXTUREFILTERTYPE  filter_type 
)
static

Definition at line 1120 of file texture.c.

1122 {
1123  TRACE("iface %p, filter_type %#x.\n", iface, filter_type);
1124 
1125  return D3DERR_INVALIDCALL;
1126 }
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_3d_SetLOD()

static DWORD WINAPI d3d9_texture_3d_SetLOD ( IDirect3DVolumeTexture9 *  iface,
DWORD  lod 
)
static

Definition at line 1078 of file texture.c.

1079 {
1081  DWORD ret;
1082 
1083  TRACE("iface %p, lod %u.\n", iface, lod);
1084 
1086  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
1088 
1089  return ret;
1090 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
int ret
GLint lod
Definition: glext.h:7795
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_SetPriority()

static DWORD WINAPI d3d9_texture_3d_SetPriority ( IDirect3DVolumeTexture9 *  iface,
DWORD  priority 
)
static

Definition at line 1028 of file texture.c.

1029 {
1031  struct wined3d_resource *resource;
1032  DWORD ret;
1033 
1034  TRACE("iface %p, priority %u.\n", iface, priority);
1035 
1037  resource = wined3d_texture_get_resource(texture->wined3d_texture);
1040 
1041  return ret;
1042 }
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_3d_SetPrivateData()

static HRESULT WINAPI d3d9_texture_3d_SetPrivateData ( IDirect3DVolumeTexture9 *  iface,
REFGUID  guid,
const void data,
DWORD  data_size,
DWORD  flags 
)
static

Definition at line 1000 of file texture.c.

1002 {
1004  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
1005  iface, debugstr_guid(guid), data, data_size, flags);
1006 
1007  return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
1008 }
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d9_main.c:222
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161

◆ d3d9_texture_3d_UnlockBox()

static HRESULT WINAPI d3d9_texture_3d_UnlockBox ( IDirect3DVolumeTexture9 *  iface,
UINT  level 
)
static

Definition at line 1206 of file texture.c.

1207 {
1209  struct d3d9_volume *volume_impl;
1210  HRESULT hr;
1211 
1212  TRACE("iface %p, level %u.\n", iface, level);
1213 
1215  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
1217  else
1220 
1221  return hr;
1222 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
static struct d3d9_texture * impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:36
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DVolume9_UnlockBox(p)
Definition: d3d9.h:392
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
IDirect3DVolume9 IDirect3DVolume9_iface
Definition: d3d9_private.h:136
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d9_texture_acquire_shader_resource_view()

static struct wined3d_shader_resource_view* d3d9_texture_acquire_shader_resource_view ( struct d3d9_texture texture)
static

Definition at line 54 of file texture.c.

55 {
56  struct wined3d_sub_resource_desc sr_desc;
57  struct wined3d_view_desc desc;
58  HRESULT hr;
59 
60  if (texture->wined3d_srv)
61  return texture->wined3d_srv;
62 
63  wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, 0, &sr_desc);
64  desc.format_id = sr_desc.format;
65  desc.flags = 0;
66  desc.u.texture.level_idx = 0;
67  desc.u.texture.level_count = wined3d_texture_get_level_count(texture->wined3d_texture);
68  desc.u.texture.layer_idx = 0;
69  desc.u.texture.layer_count = sr_desc.usage & WINED3DUSAGE_LEGACY_CUBEMAP ? 6 : 1;
71  wined3d_texture_get_resource(texture->wined3d_texture), texture,
72  &d3d9_srv_wined3d_parent_ops, &texture->wined3d_srv)))
73  {
74  ERR("Failed to create shader resource view, hr %#x.\n", hr);
75  return NULL;
76  }
77 
78  return texture->wined3d_srv;
79 }
static const struct wined3d_parent_ops d3d9_srv_wined3d_parent_ops
Definition: texture.c:48
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_shader_resource_view_create(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader_resource_view **view)
Definition: view.c:781
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
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
#define ERR(fmt,...)
Definition: debug.h:110
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228

Referenced by d3d9_texture_gen_auto_mipmap().

◆ d3d9_texture_cleanup()

static void d3d9_texture_cleanup ( struct d3d9_texture texture)
static

Definition at line 81 of file texture.c.

82 {
83  IDirect3DDevice9Ex *parent_device = texture->parent_device;
84  struct d3d9_surface *surface;
85 
87  if (texture->wined3d_srv)
89  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d9_surface, rtv_entry)
91  wined3d_texture_decref(texture->wined3d_texture);
93 
94  /* Release the device last, as it may cause the device to be destroyed. */
96 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define IDirect3DDevice9Ex_Release(p)
Definition: d3d9.h:1917
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348
struct list rtv_entry
Definition: d3d9_private.h:163
GLenum GLuint texture
Definition: glext.h:6295
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:165
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_view *view)
Definition: view.c:671
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

Referenced by d3d9_texture_2d_Release(), d3d9_texture_3d_Release(), and d3d9_texture_cube_Release().

◆ d3d9_texture_cube_AddDirtyRect()

static HRESULT WINAPI d3d9_texture_cube_AddDirtyRect ( IDirect3DCubeTexture9 *  iface,
D3DCUBEMAP_FACES  face,
const RECT dirty_rect 
)
static

Definition at line 882 of file texture.c.

884 {
886  HRESULT hr;
887 
888  TRACE("iface %p, face %#x, dirty_rect %s.\n",
889  iface, face, wine_dbgstr_rect(dirty_rect));
890 
892  if (!dirty_rect)
893  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL);
894  else
895  {
896  struct wined3d_box dirty_region;
897 
898  wined3d_box_set(&dirty_region, dirty_rect->left, dirty_rect->top, dirty_rect->right, dirty_rect->bottom, 0, 1);
899  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region);
900  }
902 
903  return hr;
904 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
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
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
const char * wine_dbgstr_rect(const RECT *rect)
LONG bottom
Definition: windef.h:309
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_AddRef()

static ULONG WINAPI d3d9_texture_cube_AddRef ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 532 of file texture.c.

533 {
535  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
536 
537  TRACE("%p increasing refcount to %u.\n", iface, ref);
538 
539  if (ref == 1)
540  {
541  struct d3d9_surface *surface;
542 
543  IDirect3DDevice9Ex_AddRef(texture->parent_device);
545  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d9_surface, rtv_entry)
546  {
548  }
549  wined3d_texture_incref(texture->wined3d_texture);
551  }
552 
553  return ref;
554 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:164
Definition: send.c:48
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348
GLenum GLint ref
Definition: glext.h:6028
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
struct list rtv_entry
Definition: d3d9_private.h:163
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_FreePrivateData()

static HRESULT WINAPI d3d9_texture_cube_FreePrivateData ( IDirect3DCubeTexture9 *  iface,
REFGUID  guid 
)
static

Definition at line 602 of file texture.c.

603 {
605  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
606 
607  return d3d9_resource_free_private_data(&texture->resource, guid);
608 }
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31
HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid)
Definition: d3d9_main.c:160

◆ d3d9_texture_cube_GenerateMipSubLevels()

static void WINAPI d3d9_texture_cube_GenerateMipSubLevels ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 738 of file texture.c.

739 {
741 
742  TRACE("iface %p.\n", iface);
743 
747 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void d3d9_texture_gen_auto_mipmap(struct d3d9_texture *texture)
Definition: texture.c:99
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetAutoGenFilterType()

static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_cube_GetAutoGenFilterType ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 726 of file texture.c.

727 {
729 
730  TRACE("iface %p.\n", iface);
731 
732  if (!(texture->usage & D3DUSAGE_AUTOGENMIPMAP))
733  WARN("Called on a texture without the D3DUSAGE_AUTOGENMIPMAP flag.\n");
734 
735  return texture->autogen_filter_type;
736 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetCubeMapSurface()

static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface ( IDirect3DCubeTexture9 *  iface,
D3DCUBEMAP_FACES  face,
UINT  level,
IDirect3DSurface9 **  surface 
)
static

Definition at line 788 of file texture.c.

790 {
792  struct d3d9_surface *surface_impl;
794  DWORD level_count;
795 
796  TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface);
797 
798  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
799  {
800  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
801  return D3DERR_INVALIDCALL;
802  }
803 
805  level_count = wined3d_texture_get_level_count(texture->wined3d_texture);
806  if (level >= level_count)
807  {
809  return D3DERR_INVALIDCALL;
810  }
811 
812  sub_resource_idx = level_count * face + level;
813  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
814  {
816  return D3DERR_INVALIDCALL;
817  }
818 
819  *surface = &surface_impl->IDirect3DSurface9_iface;
820  IDirect3DSurface9_AddRef(*surface);
822 
823  return D3D_OK;
824 }
GLint level
Definition: gl.h:1546
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
#define D3D_OK
Definition: d3d.h:106
unsigned int UINT
Definition: ndis.h:50
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetDevice()

static HRESULT WINAPI d3d9_texture_cube_GetDevice ( IDirect3DCubeTexture9 *  iface,
IDirect3DDevice9 **  device 
)
static

Definition at line 568 of file texture.c.

569 {
571 
572  TRACE("iface %p, device %p.\n", iface, device);
573 
574  *device = (IDirect3DDevice9 *)texture->parent_device;
576 
577  TRACE("Returning device %p.\n", *device);
578 
579  return D3D_OK;
580 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetLevelCount()

static DWORD WINAPI d3d9_texture_cube_GetLevelCount ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 688 of file texture.c.

689 {
691  DWORD ret;
692 
693  TRACE("iface %p.\n", iface);
694 
695  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP)
696  return 1;
697 
699  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
701 
702  return ret;
703 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetLevelDesc()

static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc ( IDirect3DCubeTexture9 *  iface,
UINT  level,
D3DSURFACE_DESC desc 
)
static

Definition at line 749 of file texture.c.

750 {
752  struct wined3d_sub_resource_desc wined3d_desc;
753  DWORD level_count;
754  HRESULT hr;
755 
756  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
757 
758  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
759  {
760  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
761  return D3DERR_INVALIDCALL;
762  }
763 
765  level_count = wined3d_texture_get_level_count(texture->wined3d_texture);
766  if (level >= level_count)
767  {
769  return D3DERR_INVALIDCALL;
770  }
771 
772  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
773  {
774  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
775  desc->Type = D3DRTYPE_SURFACE;
776  desc->Usage = texture->usage;
777  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
778  desc->MultiSampleType = wined3d_desc.multisample_type;
779  desc->MultiSampleQuality = wined3d_desc.multisample_quality;
780  desc->Width = wined3d_desc.width;
781  desc->Height = wined3d_desc.height;
782  }
784 
785  return hr;
786 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:3480
static const WCHAR desc[]
Definition: protectdata.c:36
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:49
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetLOD()

static DWORD WINAPI d3d9_texture_cube_GetLOD ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 674 of file texture.c.

675 {
677  DWORD ret;
678 
679  TRACE("iface %p.\n", iface);
680 
682  ret = wined3d_texture_get_lod(texture->wined3d_texture);
684 
685  return ret;
686 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetPriority()

static DWORD WINAPI d3d9_texture_cube_GetPriority ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 626 of file texture.c.

627 {
629  const struct wined3d_resource *resource;
630  DWORD ret;
631 
632  TRACE("iface %p.\n", iface);
633 
635  resource = wined3d_texture_get_resource(texture->wined3d_texture);
638 
639  return ret;
640 }
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetPrivateData()

static HRESULT WINAPI d3d9_texture_cube_GetPrivateData ( IDirect3DCubeTexture9 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 592 of file texture.c.

594 {
596  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
597  iface, debugstr_guid(guid), data, data_size);
598 
599  return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size);
600 }
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d9_main.c:178
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_GetType()

static D3DRESOURCETYPE WINAPI d3d9_texture_cube_GetType ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 653 of file texture.c.

654 {
655  TRACE("iface %p.\n", iface);
656 
657  return D3DRTYPE_CUBETEXTURE;
658 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_texture_cube_LockRect()

static HRESULT WINAPI d3d9_texture_cube_LockRect ( IDirect3DCubeTexture9 *  iface,
D3DCUBEMAP_FACES  face,
UINT  level,
D3DLOCKED_RECT locked_rect,
const RECT rect,
DWORD  flags 
)
static

Definition at line 826 of file texture.c.

829 {
831  struct d3d9_surface *surface_impl;
833  HRESULT hr;
834 
835  TRACE("iface %p, face %#x, level %u, locked_rect %p, rect %p, flags %#x.\n",
836  iface, face, level, locked_rect, rect, flags);
837 
838  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
839  {
840  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
841  return D3DERR_INVALIDCALL;
842  }
843 
846  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
848  else
849  hr = IDirect3DSurface9_LockRect(&surface_impl->IDirect3DSurface9_iface, locked_rect, rect, flags);
851 
852  return hr;
853 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
& rect
Definition: startmenu.cpp:1413
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
unsigned int UINT
Definition: ndis.h:50
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
#define IDirect3DSurface9_LockRect(p, a, b, c)
Definition: d3d9.h:635
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_PreLoad()

static void WINAPI d3d9_texture_cube_PreLoad ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 642 of file texture.c.

643 {
645 
646  TRACE("iface %p.\n", iface);
647 
651 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_QueryInterface()

static HRESULT WINAPI d3d9_texture_cube_QueryInterface ( IDirect3DCubeTexture9 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 512 of file texture.c.

513 {
514  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
515 
516  if (IsEqualGUID(riid, &IID_IDirect3DCubeTexture9)
517  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture9)
518  || IsEqualGUID(riid, &IID_IDirect3DResource9)
520  {
522  *out = iface;
523  return S_OK;
524  }
525 
526  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
527 
528  *out = NULL;
529  return E_NOINTERFACE;
530 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define IDirect3DCubeTexture9_AddRef(p)
Definition: d3d9.h:918

◆ d3d9_texture_cube_Release()

static ULONG WINAPI d3d9_texture_cube_Release ( IDirect3DCubeTexture9 *  iface)
static

Definition at line 556 of file texture.c.

557 {
559  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
560 
561  TRACE("%p decreasing refcount to %u.\n", iface, ref);
562 
563  if (!ref)
565  return ref;
566 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static void d3d9_texture_cleanup(struct d3d9_texture *texture)
Definition: texture.c:81
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_SetAutoGenFilterType()

static HRESULT WINAPI d3d9_texture_cube_SetAutoGenFilterType ( IDirect3DCubeTexture9 *  iface,
D3DTEXTUREFILTERTYPE  filter_type 
)
static

Definition at line 705 of file texture.c.

707 {
709 
710  TRACE("iface %p, filter_type %#x.\n", iface, filter_type);
711 
712  if (filter_type == D3DTEXF_NONE)
713  {
714  WARN("Invalid filter type D3DTEXF_NONE specified.\n");
715  return D3DERR_INVALIDCALL;
716  }
717  if (!(texture->usage & D3DUSAGE_AUTOGENMIPMAP))
718  WARN("Called on a texture without the D3DUSAGE_AUTOGENMIPMAP flag.\n");
719  else if (filter_type != D3DTEXF_LINEAR)
720  FIXME("Unsupported filter type %u.\n", filter_type);
721 
722  texture->autogen_filter_type = filter_type;
723  return D3D_OK;
724 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3D_OK
Definition: d3d.h:106
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_SetLOD()

static DWORD WINAPI d3d9_texture_cube_SetLOD ( IDirect3DCubeTexture9 *  iface,
DWORD  lod 
)
static

Definition at line 660 of file texture.c.

661 {
663  DWORD ret;
664 
665  TRACE("iface %p, lod %u.\n", iface, lod);
666 
668  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
670 
671  return ret;
672 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
int ret
GLint lod
Definition: glext.h:7795
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_SetPriority()

static DWORD WINAPI d3d9_texture_cube_SetPriority ( IDirect3DCubeTexture9 *  iface,
DWORD  priority 
)
static

Definition at line 610 of file texture.c.

611 {
613  struct wined3d_resource *resource;
614  DWORD ret;
615 
616  TRACE("iface %p, priority %u.\n", iface, priority);
617 
619  resource = wined3d_texture_get_resource(texture->wined3d_texture);
622 
623  return ret;
624 }
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int resource
Definition: rdpsnd_sgi.c:44
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_SetPrivateData()

static HRESULT WINAPI d3d9_texture_cube_SetPrivateData ( IDirect3DCubeTexture9 *  iface,
REFGUID  guid,
const void data,
DWORD  data_size,
DWORD  flags 
)
static

Definition at line 582 of file texture.c.

584 {
586  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
587  iface, debugstr_guid(guid), data, data_size, flags);
588 
589  return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
590 }
HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d9_main.c:222
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_cube_UnlockRect()

static HRESULT WINAPI d3d9_texture_cube_UnlockRect ( IDirect3DCubeTexture9 *  iface,
D3DCUBEMAP_FACES  face,
UINT  level 
)
static

Definition at line 855 of file texture.c.

857 {
859  struct d3d9_surface *surface_impl;
861  HRESULT hr;
862 
863  TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
864 
865  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP && level)
866  {
867  WARN("D3DUSAGE_AUTOGENMIPMAP textures have only one accessible level.\n");
868  return D3DERR_INVALIDCALL;
869  }
870 
873  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
875  else
878 
879  return hr;
880 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
unsigned int UINT
Definition: ndis.h:50
unsigned int sub_resource_idx
Definition: d3d9_private.h:162
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:159
#define IDirect3DSurface9_UnlockRect(p)
Definition: d3d9.h:636
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static struct d3d9_texture * impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface)
Definition: texture.c:31

◆ d3d9_texture_flag_auto_gen_mipmap()

void d3d9_texture_flag_auto_gen_mipmap ( struct d3d9_texture texture)

Definition at line 108 of file texture.c.

109 {
110  if (texture->usage & D3DUSAGE_AUTOGENMIPMAP)
112 }
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
GLenum GLuint texture
Definition: glext.h:6295
#define D3D9_TEXTURE_MIPMAP_DIRTY
Definition: d3d9_private.h:48

Referenced by d3d9_device_ColorFill(), d3d9_device_StretchRect(), d3d9_device_UpdateSurface(), d3d9_device_UpdateTexture(), d3d9_rts_flag_auto_gen_mipmap(), d3d9_surface_ReleaseDC(), and d3d9_surface_UnlockRect().

◆ d3d9_texture_gen_auto_mipmap()

void d3d9_texture_gen_auto_mipmap ( struct d3d9_texture texture)

Definition at line 99 of file texture.c.

100 {
101  if (!(texture->flags & D3D9_TEXTURE_MIPMAP_DIRTY))
102  return;
106 }
void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view)
Definition: view.c:917
static struct wined3d_shader_resource_view * d3d9_texture_acquire_shader_resource_view(struct d3d9_texture *texture)
Definition: texture.c:54
GLenum GLuint texture
Definition: glext.h:6295
#define D3D9_TEXTURE_MIPMAP_DIRTY
Definition: d3d9_private.h:48

Referenced by d3d9_generate_auto_mipmaps(), d3d9_texture_2d_GenerateMipSubLevels(), and d3d9_texture_cube_GenerateMipSubLevels().

◆ d3d9_texture_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed ( void parent)
static

Definition at line 1285 of file texture.c.

1286 {
1287  struct d3d9_texture *texture = parent;
1288  d3d9_resource_cleanup(&texture->resource);
1289  heap_free(texture);
1290 }
r parent
Definition: btrfs.c:2944
GLenum GLuint texture
Definition: glext.h:6295
void d3d9_resource_cleanup(struct d3d9_resource *resource)
Definition: d3d9_main.c:155
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ impl_from_IDirect3DCubeTexture9()

◆ impl_from_IDirect3DTexture9()

◆ impl_from_IDirect3DVolumeTexture9()

static struct d3d9_texture* impl_from_IDirect3DVolumeTexture9 ( IDirect3DVolumeTexture9 *  iface)
inlinestatic

◆ srv_wined3d_object_destroyed()

static void STDMETHODCALLTYPE srv_wined3d_object_destroyed ( void parent)
static

Definition at line 41 of file texture.c.

42 {
43  struct d3d9_texture *texture = parent;
44 
45  texture->wined3d_srv = NULL;
46 }
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2944
GLenum GLuint texture
Definition: glext.h:6295

◆ texture_init()

HRESULT texture_init ( struct d3d9_texture texture,
struct d3d9_device device,
UINT  width,
UINT  height,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool 
)

Definition at line 1297 of file texture.c.

1299 {
1300  struct wined3d_resource_desc desc;
1301  DWORD flags = 0;
1302  HRESULT hr;
1303 
1304  texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl;
1305  d3d9_resource_init(&texture->resource);
1306  list_init(&texture->rtv_list);
1307  texture->usage = usage;
1308 
1309  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1311  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1312  desc.multisample_quality = 0;
1314  desc.usage |= WINED3DUSAGE_TEXTURE;
1315  if (pool == D3DPOOL_SCRATCH)
1316  desc.usage |= WINED3DUSAGE_SCRATCH;
1319  desc.width = width;
1320  desc.height = height;
1321  desc.depth = 1;
1322  desc.size = 0;
1323 
1326 
1327  if (is_gdi_compat_wined3dformat(desc.format))
1329 
1331  {
1332  if (pool == D3DPOOL_SYSTEMMEM)
1333  {
1334  WARN("D3DUSAGE_AUTOGENMIPMAP texture can't be in D3DPOOL_SYSTEMMEM, returning D3DERR_INVALIDCALL.\n");
1335  return D3DERR_INVALIDCALL;
1336  }
1337  if (levels && levels != 1)
1338  {
1339  WARN("D3DUSAGE_AUTOGENMIPMAP texture with %u levels, returning D3DERR_INVALIDCALL.\n", levels);
1340  return D3DERR_INVALIDCALL;
1341  }
1343  texture->autogen_filter_type = D3DTEXF_LINEAR;
1344  levels = 0;
1345  }
1346  else
1347  {
1348  texture->autogen_filter_type = D3DTEXF_NONE;
1349  }
1350  if (!levels)
1351  levels = wined3d_log2i(max(width, height)) + 1;
1352 
1354  hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, flags,
1355  NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture);
1357  if (FAILED(hr))
1358  {
1359  WARN("Failed to create wined3d texture, hr %#x.\n", hr);
1360  return hr;
1361  }
1362 
1363  texture->parent_device = &device->IDirect3DDevice9Ex_iface;
1364  IDirect3DDevice9Ex_AddRef(texture->parent_device);
1365 
1366  return D3D_OK;
1367 }
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
GLint GLint GLsizei width
Definition: gl.h:1546
#define max(a, b)
Definition: svc.c:63
#define WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS
Definition: wined3d.h:1562
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
GLsizei levels
Definition: glext.h:7884
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void d3d9_resource_init(struct d3d9_resource *resource)
Definition: d3d9_main.c:216
BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:1389
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
#define D3DERR_INVALIDCALL
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define WINED3D_TEXTURE_CREATE_GET_DC
Definition: wined3d.h:1561
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
static DWORD wined3dusage_from_d3dusage(unsigned int usage)
Definition: d3d9_private.h:334
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define D3D_OK
Definition: d3d.h:106
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
static const IDirect3DTexture9Vtbl d3d9_texture_2d_vtbl
Definition: texture.c:482
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops
Definition: texture.c:1292
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

◆ unsafe_impl_from_IDirect3DBaseTexture9()

struct d3d9_texture* unsafe_impl_from_IDirect3DBaseTexture9 ( IDirect3DBaseTexture9 *  iface)

Definition at line 1269 of file texture.c.

1270 {
1271  if (!iface)
1272  return NULL;
1273 
1274  if (iface->lpVtbl != (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl
1275  && iface->lpVtbl != (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl
1276  && iface->lpVtbl != (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_3d_vtbl)
1277  {
1278  WARN("%p is not a valid IDirect3DBaseTexture9 interface.\n", iface);
1279  return NULL;
1280  }
1281 
1282  return CONTAINING_RECORD(iface, struct d3d9_texture, IDirect3DBaseTexture9_iface);
1283 }
#define WARN(fmt,...)
Definition: debug.h:112
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static const IDirect3DVolumeTexture9Vtbl d3d9_texture_3d_vtbl
Definition: texture.c:1239
static const IDirect3DTexture9Vtbl d3d9_texture_2d_vtbl
Definition: texture.c:482
static const IDirect3DCubeTexture9Vtbl d3d9_texture_cube_vtbl
Definition: texture.c:906

Referenced by d3d9_device_SetTexture(), d3d9_device_UpdateTexture(), and surface_init().

◆ volumetexture_init()

HRESULT volumetexture_init ( struct d3d9_texture texture,
struct d3d9_device device,
UINT  width,
UINT  height,
UINT  depth,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool 
)

Definition at line 1441 of file texture.c.

1443 {
1444  struct wined3d_resource_desc desc;
1445  HRESULT hr;
1446 
1447  texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_3d_vtbl;
1448  d3d9_resource_init(&texture->resource);
1449  list_init(&texture->rtv_list);
1450  texture->usage = usage;
1451 
1452  desc.resource_type = WINED3D_RTYPE_TEXTURE_3D;
1454  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1455  desc.multisample_quality = 0;
1457  desc.usage |= WINED3DUSAGE_TEXTURE;
1458  if (pool == D3DPOOL_SCRATCH)
1459  desc.usage |= WINED3DUSAGE_SCRATCH;
1461  desc.width = width;
1462  desc.height = height;
1463  desc.depth = depth;
1464  desc.size = 0;
1465 
1467  {
1468  WARN("D3DUSAGE_AUTOGENMIPMAP volume texture is not supported, returning D3DERR_INVALIDCALL.\n");
1469  return D3DERR_INVALIDCALL;
1470  }
1471  if (!levels)
1473 
1475  hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, 0,
1476  NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture);
1478  if (FAILED(hr))
1479  {
1480  WARN("Failed to create wined3d volume texture, hr %#x.\n", hr);
1481  return hr;
1482  }
1483 
1484  texture->parent_device = &device->IDirect3DDevice9Ex_iface;
1485  IDirect3DDevice9Ex_AddRef(texture->parent_device);
1486 
1487  return D3D_OK;
1488 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define max(a, b)
Definition: svc.c:63
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
GLsizei levels
Definition: glext.h:7884
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define WARN(fmt,...)
Definition: debug.h:112
void d3d9_resource_init(struct d3d9_resource *resource)
Definition: d3d9_main.c:216
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1916
static DWORD wined3dusage_from_d3dusage(unsigned int usage)
Definition: d3d9_private.h:334
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:79
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static const IDirect3DVolumeTexture9Vtbl d3d9_texture_3d_vtbl
Definition: texture.c:1239
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define D3D_OK
Definition: d3d.h:106
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops
Definition: texture.c:1292
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d9  )

Variable Documentation

◆ d3d9_srv_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_srv_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE srv_wined3d_object_destroyed(void *parent)
Definition: texture.c:41

Definition at line 48 of file texture.c.

Referenced by d3d9_texture_acquire_shader_resource_view().

◆ d3d9_texture_2d_vtbl

const IDirect3DTexture9Vtbl d3d9_texture_2d_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d9_texture_2d_FreePrivateData(IDirect3DTexture9 *iface, REFGUID guid)
Definition: texture.c:204
static HRESULT WINAPI d3d9_texture_2d_GetSurfaceLevel(IDirect3DTexture9 *iface, UINT level, IDirect3DSurface9 **surface)
Definition: texture.c:381
static ULONG WINAPI d3d9_texture_2d_Release(IDirect3DTexture9 *iface)
Definition: texture.c:158
static void WINAPI d3d9_texture_2d_GenerateMipSubLevels(IDirect3DTexture9 *iface)
Definition: texture.c:339
static DWORD WINAPI d3d9_texture_2d_SetLOD(IDirect3DTexture9 *iface, DWORD lod)
Definition: texture.c:262
static HRESULT WINAPI d3d9_texture_2d_GetPrivateData(IDirect3DTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:194
static HRESULT WINAPI d3d9_texture_2d_SetAutoGenFilterType(IDirect3DTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
Definition: texture.c:307
static HRESULT WINAPI d3d9_texture_2d_SetPrivateData(IDirect3DTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:184
static HRESULT WINAPI d3d9_texture_2d_UnlockRect(IDirect3DTexture9 *iface, UINT level)
Definition: texture.c:435
static HRESULT WINAPI d3d9_texture_2d_LockRect(IDirect3DTexture9 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:409
static DWORD WINAPI d3d9_texture_2d_GetLOD(IDirect3DTexture9 *iface)
Definition: texture.c:276
static DWORD WINAPI d3d9_texture_2d_GetLevelCount(IDirect3DTexture9 *iface)
Definition: texture.c:290
static ULONG WINAPI d3d9_texture_2d_AddRef(IDirect3DTexture9 *iface)
Definition: texture.c:134
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_2d_GetAutoGenFilterType(IDirect3DTexture9 *iface)
Definition: texture.c:327
static HRESULT WINAPI d3d9_texture_2d_AddDirtyRect(IDirect3DTexture9 *iface, const RECT *dirty_rect)
Definition: texture.c:459
static DWORD WINAPI d3d9_texture_2d_GetPriority(IDirect3DTexture9 *iface)
Definition: texture.c:228
static HRESULT WINAPI d3d9_texture_2d_QueryInterface(IDirect3DTexture9 *iface, REFIID riid, void **out)
Definition: texture.c:114
static D3DRESOURCETYPE WINAPI d3d9_texture_2d_GetType(IDirect3DTexture9 *iface)
Definition: texture.c:255
static void WINAPI d3d9_texture_2d_PreLoad(IDirect3DTexture9 *iface)
Definition: texture.c:244
static DWORD WINAPI d3d9_texture_2d_SetPriority(IDirect3DTexture9 *iface, DWORD priority)
Definition: texture.c:212
static HRESULT WINAPI d3d9_texture_2d_GetDevice(IDirect3DTexture9 *iface, IDirect3DDevice9 **device)
Definition: texture.c:170
static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc(IDirect3DTexture9 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:350

Definition at line 482 of file texture.c.

Referenced by texture_init(), and unsafe_impl_from_IDirect3DBaseTexture9().

◆ d3d9_texture_3d_vtbl

const IDirect3DVolumeTexture9Vtbl d3d9_texture_3d_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d9_texture_3d_UnlockBox(IDirect3DVolumeTexture9 *iface, UINT level)
Definition: texture.c:1206
static HRESULT WINAPI d3d9_texture_3d_GetLevelDesc(IDirect3DVolumeTexture9 *iface, UINT level, D3DVOLUME_DESC *desc)
Definition: texture.c:1140
static HRESULT WINAPI d3d9_texture_3d_GetDevice(IDirect3DVolumeTexture9 *iface, IDirect3DDevice9 **device)
Definition: texture.c:986
static HRESULT WINAPI d3d9_texture_3d_QueryInterface(IDirect3DVolumeTexture9 *iface, REFIID riid, void **out)
Definition: texture.c:936
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_3d_GetAutoGenFilterType(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1128
static HRESULT WINAPI d3d9_texture_3d_SetAutoGenFilterType(IDirect3DVolumeTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
Definition: texture.c:1120
static ULONG WINAPI d3d9_texture_3d_Release(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:974
static HRESULT WINAPI d3d9_texture_3d_AddDirtyBox(IDirect3DVolumeTexture9 *iface, const D3DBOX *dirty_box)
Definition: texture.c:1224
static HRESULT WINAPI d3d9_texture_3d_SetPrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:1000
static void WINAPI d3d9_texture_3d_GenerateMipSubLevels(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1135
static ULONG WINAPI d3d9_texture_3d_AddRef(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:956
static HRESULT WINAPI d3d9_texture_3d_LockBox(IDirect3DVolumeTexture9 *iface, UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
Definition: texture.c:1186
static HRESULT WINAPI d3d9_texture_3d_FreePrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid)
Definition: texture.c:1020
static DWORD WINAPI d3d9_texture_3d_GetLevelCount(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1106
static DWORD WINAPI d3d9_texture_3d_SetLOD(IDirect3DVolumeTexture9 *iface, DWORD lod)
Definition: texture.c:1078
static D3DRESOURCETYPE WINAPI d3d9_texture_3d_GetType(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1071
static DWORD WINAPI d3d9_texture_3d_SetPriority(IDirect3DVolumeTexture9 *iface, DWORD priority)
Definition: texture.c:1028
static void WINAPI d3d9_texture_3d_PreLoad(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1060
static HRESULT WINAPI d3d9_texture_3d_GetVolumeLevel(IDirect3DVolumeTexture9 *iface, UINT level, IDirect3DVolume9 **volume)
Definition: texture.c:1164
static DWORD WINAPI d3d9_texture_3d_GetLOD(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1092
static HRESULT WINAPI d3d9_texture_3d_GetPrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:1010
static DWORD WINAPI d3d9_texture_3d_GetPriority(IDirect3DVolumeTexture9 *iface)
Definition: texture.c:1044

Definition at line 1239 of file texture.c.

Referenced by unsafe_impl_from_IDirect3DBaseTexture9(), and volumetexture_init().

◆ d3d9_texture_cube_vtbl

const IDirect3DCubeTexture9Vtbl d3d9_texture_cube_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc(IDirect3DCubeTexture9 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:749
static void WINAPI d3d9_texture_cube_GenerateMipSubLevels(IDirect3DCubeTexture9 *iface)
Definition: texture.c:738
static D3DRESOURCETYPE WINAPI d3d9_texture_cube_GetType(IDirect3DCubeTexture9 *iface)
Definition: texture.c:653
static HRESULT WINAPI d3d9_texture_cube_SetPrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:582
static HRESULT WINAPI d3d9_texture_cube_FreePrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid)
Definition: texture.c:602
static HRESULT WINAPI d3d9_texture_cube_GetPrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:592
static ULONG WINAPI d3d9_texture_cube_AddRef(IDirect3DCubeTexture9 *iface)
Definition: texture.c:532
static DWORD WINAPI d3d9_texture_cube_GetPriority(IDirect3DCubeTexture9 *iface)
Definition: texture.c:626
static HRESULT WINAPI d3d9_texture_cube_UnlockRect(IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level)
Definition: texture.c:855
static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_cube_GetAutoGenFilterType(IDirect3DCubeTexture9 *iface)
Definition: texture.c:726
static DWORD WINAPI d3d9_texture_cube_GetLevelCount(IDirect3DCubeTexture9 *iface)
Definition: texture.c:688
static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface9 **surface)
Definition: texture.c:788
static ULONG WINAPI d3d9_texture_cube_Release(IDirect3DCubeTexture9 *iface)
Definition: texture.c:556
static HRESULT WINAPI d3d9_texture_cube_LockRect(IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:826
static HRESULT WINAPI d3d9_texture_cube_SetAutoGenFilterType(IDirect3DCubeTexture9 *iface, D3DTEXTUREFILTERTYPE filter_type)
Definition: texture.c:705
static HRESULT WINAPI d3d9_texture_cube_AddDirtyRect(IDirect3DCubeTexture9 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
Definition: texture.c:882
static HRESULT WINAPI d3d9_texture_cube_QueryInterface(IDirect3DCubeTexture9 *iface, REFIID riid, void **out)
Definition: texture.c:512
static DWORD WINAPI d3d9_texture_cube_GetLOD(IDirect3DCubeTexture9 *iface)
Definition: texture.c:674
static DWORD WINAPI d3d9_texture_cube_SetLOD(IDirect3DCubeTexture9 *iface, DWORD lod)
Definition: texture.c:660
static void WINAPI d3d9_texture_cube_PreLoad(IDirect3DCubeTexture9 *iface)
Definition: texture.c:642
static DWORD WINAPI d3d9_texture_cube_SetPriority(IDirect3DCubeTexture9 *iface, DWORD priority)
Definition: texture.c:610
static HRESULT WINAPI d3d9_texture_cube_GetDevice(IDirect3DCubeTexture9 *iface, IDirect3DDevice9 **device)
Definition: texture.c:568

Definition at line 906 of file texture.c.

Referenced by cubetexture_init(), and unsafe_impl_from_IDirect3DBaseTexture9().

◆ d3d9_texture_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed(void *parent)
Definition: texture.c:1285

Definition at line 1292 of file texture.c.

Referenced by cubetexture_init(), texture_init(), and volumetexture_init().