ReactOS  0.4.14-dev-315-gbb6fece
texture.c File Reference
#include "config.h"
#include "d3d8_private.h"
Include dependency graph for texture.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d8)
 
static struct d3d8_textureimpl_from_IDirect3DTexture8 (IDirect3DTexture8 *iface)
 
static struct d3d8_textureimpl_from_IDirect3DCubeTexture8 (IDirect3DCubeTexture8 *iface)
 
static struct d3d8_textureimpl_from_IDirect3DVolumeTexture8 (IDirect3DVolumeTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_2d_QueryInterface (IDirect3DTexture8 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d8_texture_2d_AddRef (IDirect3DTexture8 *iface)
 
static ULONG WINAPI d3d8_texture_2d_Release (IDirect3DTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_2d_GetDevice (IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
 
static HRESULT WINAPI d3d8_texture_2d_SetPrivateData (IDirect3DTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_2d_GetPrivateData (IDirect3DTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_texture_2d_FreePrivateData (IDirect3DTexture8 *iface, REFGUID guid)
 
static DWORD WINAPI d3d8_texture_2d_SetPriority (IDirect3DTexture8 *iface, DWORD priority)
 
static DWORD WINAPI d3d8_texture_2d_GetPriority (IDirect3DTexture8 *iface)
 
static void WINAPI d3d8_texture_2d_PreLoad (IDirect3DTexture8 *iface)
 
static D3DRESOURCETYPE WINAPI d3d8_texture_2d_GetType (IDirect3DTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_2d_SetLOD (IDirect3DTexture8 *iface, DWORD lod)
 
static DWORD WINAPI d3d8_texture_2d_GetLOD (IDirect3DTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_2d_GetLevelCount (IDirect3DTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc (IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
 
static HRESULT WINAPI d3d8_texture_2d_GetSurfaceLevel (IDirect3DTexture8 *iface, UINT level, IDirect3DSurface8 **surface)
 
static HRESULT WINAPI d3d8_texture_2d_LockRect (IDirect3DTexture8 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_2d_UnlockRect (IDirect3DTexture8 *iface, UINT level)
 
static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect (IDirect3DTexture8 *iface, const RECT *dirty_rect)
 
static HRESULT WINAPI d3d8_texture_cube_QueryInterface (IDirect3DCubeTexture8 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d8_texture_cube_AddRef (IDirect3DCubeTexture8 *iface)
 
static ULONG WINAPI d3d8_texture_cube_Release (IDirect3DCubeTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_cube_GetDevice (IDirect3DCubeTexture8 *iface, IDirect3DDevice8 **device)
 
static HRESULT WINAPI d3d8_texture_cube_SetPrivateData (IDirect3DCubeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_cube_GetPrivateData (IDirect3DCubeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_texture_cube_FreePrivateData (IDirect3DCubeTexture8 *iface, REFGUID guid)
 
static DWORD WINAPI d3d8_texture_cube_SetPriority (IDirect3DCubeTexture8 *iface, DWORD priority)
 
static DWORD WINAPI d3d8_texture_cube_GetPriority (IDirect3DCubeTexture8 *iface)
 
static void WINAPI d3d8_texture_cube_PreLoad (IDirect3DCubeTexture8 *iface)
 
static D3DRESOURCETYPE WINAPI d3d8_texture_cube_GetType (IDirect3DCubeTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_cube_SetLOD (IDirect3DCubeTexture8 *iface, DWORD lod)
 
static DWORD WINAPI d3d8_texture_cube_GetLOD (IDirect3DCubeTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_cube_GetLevelCount (IDirect3DCubeTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc (IDirect3DCubeTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
 
static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface (IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
 
static HRESULT WINAPI d3d8_texture_cube_LockRect (IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_cube_UnlockRect (IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level)
 
static HRESULT WINAPI d3d8_texture_cube_AddDirtyRect (IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
 
static HRESULT WINAPI d3d8_texture_3d_QueryInterface (IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d8_texture_3d_AddRef (IDirect3DVolumeTexture8 *iface)
 
static ULONG WINAPI d3d8_texture_3d_Release (IDirect3DVolumeTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_3d_GetDevice (IDirect3DVolumeTexture8 *iface, IDirect3DDevice8 **device)
 
static HRESULT WINAPI d3d8_texture_3d_SetPrivateData (IDirect3DVolumeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_3d_GetPrivateData (IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_texture_3d_FreePrivateData (IDirect3DVolumeTexture8 *iface, REFGUID guid)
 
static DWORD WINAPI d3d8_texture_3d_SetPriority (IDirect3DVolumeTexture8 *iface, DWORD priority)
 
static DWORD WINAPI d3d8_texture_3d_GetPriority (IDirect3DVolumeTexture8 *iface)
 
static void WINAPI d3d8_texture_3d_PreLoad (IDirect3DVolumeTexture8 *iface)
 
static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType (IDirect3DVolumeTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_3d_SetLOD (IDirect3DVolumeTexture8 *iface, DWORD lod)
 
static DWORD WINAPI d3d8_texture_3d_GetLOD (IDirect3DVolumeTexture8 *iface)
 
static DWORD WINAPI d3d8_texture_3d_GetLevelCount (IDirect3DVolumeTexture8 *iface)
 
static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc (IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
 
static HRESULT WINAPI d3d8_texture_3d_GetVolumeLevel (IDirect3DVolumeTexture8 *iface, UINT level, IDirect3DVolume8 **volume)
 
static HRESULT WINAPI d3d8_texture_3d_LockBox (IDirect3DVolumeTexture8 *iface, UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
 
static HRESULT WINAPI d3d8_texture_3d_UnlockBox (IDirect3DVolumeTexture8 *iface, UINT level)
 
static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox (IDirect3DVolumeTexture8 *iface, const D3DBOX *dirty_box)
 
struct d3d8_textureunsafe_impl_from_IDirect3DBaseTexture8 (IDirect3DBaseTexture8 *iface)
 
static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed (void *parent)
 
HRESULT texture_init (struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 
HRESULT cubetexture_init (struct d3d8_texture *texture, struct d3d8_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 
HRESULT volumetexture_init (struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
 

Variables

static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
 
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
 
static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
 
static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
 

Function Documentation

◆ cubetexture_init()

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

Definition at line 1142 of file texture.c.

1144 {
1145  struct wined3d_resource_desc desc;
1146  DWORD flags = 0;
1147  HRESULT hr;
1148 
1149  texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl;
1150  d3d8_resource_init(&texture->resource);
1151  list_init(&texture->rtv_list);
1152 
1153  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1155  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1156  desc.multisample_quality = 0;
1157  desc.usage = usage & WINED3DUSAGE_MASK;
1159  if (pool == D3DPOOL_SCRATCH)
1160  desc.usage |= WINED3DUSAGE_SCRATCH;
1163  desc.width = edge_length;
1164  desc.height = edge_length;
1165  desc.depth = 1;
1166  desc.size = 0;
1167 
1170 
1171  if (!levels)
1172  levels = wined3d_log2i(edge_length) + 1;
1173 
1175  hr = wined3d_texture_create(device->wined3d_device, &desc, 6, levels, flags,
1176  NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
1178  if (FAILED(hr))
1179  {
1180  WARN("Failed to create wined3d cube texture, hr %#x.\n", hr);
1181  return hr;
1182  }
1183 
1184  texture->parent_device = &device->IDirect3DDevice8_iface;
1185  IDirect3DDevice8_AddRef(texture->parent_device);
1186 
1187  return D3D_OK;
1188 }
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
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 WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
Definition: texture.c:715
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
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 WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
#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 struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
Definition: texture.c:1089
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
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
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

Referenced by d3d8_device_CreateCubeTexture(), and d3d9_device_CreateCubeTexture().

◆ d3d8_texture_2d_AddDirtyRect()

static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect ( IDirect3DTexture8 *  iface,
const RECT dirty_rect 
)
static

Definition at line 328 of file texture.c.

329 {
331  HRESULT hr;
332 
333  TRACE("iface %p, dirty_rect %s.\n",
334  iface, wine_dbgstr_rect(dirty_rect));
335 
337  if (!dirty_rect)
338  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL);
339  else
340  {
341  struct wined3d_box dirty_region;
342 
343  wined3d_box_set(&dirty_region, dirty_rect->left, dirty_rect->top, dirty_rect->right, dirty_rect->bottom, 0, 1);
344  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region);
345  }
347 
348  return hr;
349 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
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:77
const char * wine_dbgstr_rect(const RECT *rect)
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
LONG bottom
Definition: windef.h:294
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_AddRef()

static ULONG WINAPI d3d8_texture_2d_AddRef ( IDirect3DTexture8 *  iface)
static

Definition at line 59 of file texture.c.

60 {
62  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
63 
64  TRACE("%p increasing refcount to %u.\n", iface, ref);
65 
66  if (ref == 1)
67  {
68  struct d3d8_surface *surface;
69 
70  IDirect3DDevice8_AddRef(texture->parent_device);
72  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d8_surface, rtv_entry)
73  {
75  }
76  wined3d_texture_incref(texture->wined3d_texture);
78  }
79 
80  return ref;
81 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: send.c:47
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
struct list rtv_entry
Definition: d3d8_private.h:180
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
#define InterlockedIncrement
Definition: armddk.h:53
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994

◆ d3d8_texture_2d_FreePrivateData()

static HRESULT WINAPI d3d8_texture_2d_FreePrivateData ( IDirect3DTexture8 *  iface,
REFGUID  guid 
)
static

Definition at line 143 of file texture.c.

144 {
146  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
147 
148  return d3d8_resource_free_private_data(&texture->resource, guid);
149 }
HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid)
Definition: d3d8_main.c:135
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 d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24

◆ d3d8_texture_2d_GetDevice()

static HRESULT WINAPI d3d8_texture_2d_GetDevice ( IDirect3DTexture8 *  iface,
IDirect3DDevice8 **  device 
)
static

Definition at line 109 of file texture.c.

110 {
112 
113  TRACE("iface %p, device %p.\n", iface, device);
114 
115  *device = texture->parent_device;
117 
118  TRACE("Returning device %p.\n", *device);
119 
120  return D3D_OK;
121 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24

◆ d3d8_texture_2d_GetLevelCount()

static DWORD WINAPI d3d8_texture_2d_GetLevelCount ( IDirect3DTexture8 *  iface)
static

Definition at line 229 of file texture.c.

230 {
232  DWORD ret;
233 
234  TRACE("iface %p.\n", iface);
235 
237  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
239 
240  return ret;
241 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
#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 d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_GetLevelDesc()

static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc ( IDirect3DTexture8 *  iface,
UINT  level,
D3DSURFACE_DESC desc 
)
static

Definition at line 243 of file texture.c.

244 {
246  struct wined3d_sub_resource_desc wined3d_desc;
247  HRESULT hr;
248 
249  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
250 
252  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
253  {
254  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
255  desc->Type = D3DRTYPE_SURFACE;
256  desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
257  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
258  desc->Size = wined3d_desc.size;
259  desc->MultiSampleType = wined3d_desc.multisample_type;
260  desc->Width = wined3d_desc.width;
261  desc->Height = wined3d_desc.height;
262  }
264 
265  return hr;
266 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
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:77
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_texture_2d_GetLOD()

static DWORD WINAPI d3d8_texture_2d_GetLOD ( IDirect3DTexture8 *  iface)
static

Definition at line 215 of file texture.c.

216 {
218  DWORD ret;
219 
220  TRACE("iface %p.\n", iface);
221 
223  ret = wined3d_texture_get_lod(texture->wined3d_texture);
225 
226  return ret;
227 }
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_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_GetPriority()

static DWORD WINAPI d3d8_texture_2d_GetPriority ( IDirect3DTexture8 *  iface)
static

Definition at line 167 of file texture.c.

168 {
170  const struct wined3d_resource *resource;
171  DWORD ret;
172 
173  TRACE("iface %p.\n", iface);
174 
176  resource = wined3d_texture_get_resource(texture->wined3d_texture);
179 
180  return ret;
181 }
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
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_GetPrivateData()

static HRESULT WINAPI d3d8_texture_2d_GetPrivateData ( IDirect3DTexture8 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 133 of file texture.c.

135 {
137  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
138  iface, debugstr_guid(guid), data, data_size);
139 
140  return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size);
141 }
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
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153

◆ d3d8_texture_2d_GetSurfaceLevel()

static HRESULT WINAPI d3d8_texture_2d_GetSurfaceLevel ( IDirect3DTexture8 *  iface,
UINT  level,
IDirect3DSurface8 **  surface 
)
static

Definition at line 268 of file texture.c.

270 {
272  struct d3d8_surface *surface_impl;
273 
274  TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
275 
277  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
278  {
280  return D3DERR_INVALIDCALL;
281  }
282 
283  *surface = &surface_impl->IDirect3DSurface8_iface;
284  IDirect3DSurface8_AddRef(*surface);
286 
287  return D3D_OK;
288 }
GLint level
Definition: gl.h:1546
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
#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 D3D_OK
Definition: d3d.h:106
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_GetType()

static D3DRESOURCETYPE WINAPI d3d8_texture_2d_GetType ( IDirect3DTexture8 *  iface)
static

Definition at line 194 of file texture.c.

195 {
196  TRACE("iface %p.\n", iface);
197 
198  return D3DRTYPE_TEXTURE;
199 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d8_texture_2d_LockRect()

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

Definition at line 290 of file texture.c.

292 {
294  struct d3d8_surface *surface_impl;
295  HRESULT hr;
296 
297  TRACE("iface %p, level %u, locked_rect %p, rect %p, flags %#x.\n",
298  iface, level, locked_rect, rect, flags);
299 
301  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
303  else
304  hr = IDirect3DSurface8_LockRect(&surface_impl->IDirect3DSurface8_iface, locked_rect, rect, flags);
306 
307  return hr;
308 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
& rect
Definition: startmenu.cpp:1413
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
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
#define IDirect3DSurface8_LockRect(p, a, b, c)
Definition: d3d8.h:318
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_PreLoad()

static void WINAPI d3d8_texture_2d_PreLoad ( IDirect3DTexture8 *  iface)
static

Definition at line 183 of file texture.c.

184 {
186 
187  TRACE("iface %p.\n", iface);
188 
192 }
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
GLenum GLuint texture
Definition: glext.h:6295
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_QueryInterface()

static HRESULT WINAPI d3d8_texture_2d_QueryInterface ( IDirect3DTexture8 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 39 of file texture.c.

40 {
41  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
42 
43  if (IsEqualGUID(riid, &IID_IDirect3DTexture8)
44  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)
45  || IsEqualGUID(riid, &IID_IDirect3DResource8)
47  {
49  *out = iface;
50  return S_OK;
51  }
52 
53  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
54 
55  *out = NULL;
56  return E_NOINTERFACE;
57 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
#define IDirect3DTexture8_AddRef(p)
Definition: d3d8.h:698
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:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3d8_texture_2d_Release()

static ULONG WINAPI d3d8_texture_2d_Release ( IDirect3DTexture8 *  iface)
static

Definition at line 83 of file texture.c.

84 {
86  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
87 
88  TRACE("%p decreasing refcount to %u.\n", iface, ref);
89 
90  if (!ref)
91  {
92  IDirect3DDevice8 *parent_device = texture->parent_device;
93  struct d3d8_surface *surface;
94 
96  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d8_surface, rtv_entry)
97  {
99  }
100  wined3d_texture_decref(texture->wined3d_texture);
102 
103  /* Release the device last, as it may cause the device to be destroyed. */
105  }
106  return ref;
107 }
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:182
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:226
Definition: send.c:47
#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 TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
struct list rtv_entry
Definition: d3d8_private.h:180
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
unsigned int ULONG
Definition: retypes.h:1
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_SetLOD()

static DWORD WINAPI d3d8_texture_2d_SetLOD ( IDirect3DTexture8 *  iface,
DWORD  lod 
)
static

Definition at line 201 of file texture.c.

202 {
204  DWORD ret;
205 
206  TRACE("iface %p, lod %u.\n", iface, lod);
207 
209  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
211 
212  return ret;
213 }
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
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
GLint lod
Definition: glext.h:7795
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_SetPriority()

static DWORD WINAPI d3d8_texture_2d_SetPriority ( IDirect3DTexture8 *  iface,
DWORD  priority 
)
static

Definition at line 151 of file texture.c.

152 {
154  struct wined3d_resource *resource;
155  DWORD ret;
156 
157  TRACE("iface %p, priority %u.\n", iface, priority);
158 
160  resource = wined3d_texture_get_resource(texture->wined3d_texture);
163 
164  return ret;
165 }
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
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_2d_SetPrivateData()

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

Definition at line 123 of file texture.c.

125 {
127  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
128  iface, debugstr_guid(guid), data, data_size, flags);
129 
130  return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
131 }
HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d8_main.c:197
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 d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24

◆ d3d8_texture_2d_UnlockRect()

static HRESULT WINAPI d3d8_texture_2d_UnlockRect ( IDirect3DTexture8 *  iface,
UINT  level 
)
static

Definition at line 310 of file texture.c.

311 {
313  struct d3d8_surface *surface_impl;
314  HRESULT hr;
315 
316  TRACE("iface %p, level %u.\n", iface, level);
317 
319  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
321  else
324 
325  return hr;
326 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define IDirect3DSurface8_UnlockRect(p)
Definition: d3d8.h:319
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_AddDirtyBox()

static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox ( IDirect3DVolumeTexture8 *  iface,
const D3DBOX dirty_box 
)
static

Definition at line 1020 of file texture.c.

1021 {
1023  HRESULT hr;
1024 
1025  TRACE("iface %p, dirty_box %p.\n", iface, dirty_box);
1026 
1028  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const struct wined3d_box *)dirty_box);
1030 
1031  return hr;
1032 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
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_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_AddRef()

static ULONG WINAPI d3d8_texture_3d_AddRef ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 762 of file texture.c.

763 {
765  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
766 
767  TRACE("%p increasing refcount to %u.\n", iface, ref);
768 
769  if (ref == 1)
770  {
771  IDirect3DDevice8_AddRef(texture->parent_device);
773  wined3d_texture_incref(texture->wined3d_texture);
775  }
776 
777  return ref;
778 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedIncrement
Definition: armddk.h:53
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994

◆ d3d8_texture_3d_FreePrivateData()

static HRESULT WINAPI d3d8_texture_3d_FreePrivateData ( IDirect3DVolumeTexture8 *  iface,
REFGUID  guid 
)
static

Definition at line 835 of file texture.c.

836 {
838  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
839 
840  return d3d8_resource_free_private_data(&texture->resource, guid);
841 }
HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid)
Definition: d3d8_main.c:135
const GUID * guid
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295

◆ d3d8_texture_3d_GetDevice()

static HRESULT WINAPI d3d8_texture_3d_GetDevice ( IDirect3DVolumeTexture8 *  iface,
IDirect3DDevice8 **  device 
)
static

Definition at line 801 of file texture.c.

802 {
804 
805  TRACE("iface %p, device %p.\n", iface, device);
806 
807  *device = texture->parent_device;
809 
810  TRACE("Returning device %p.\n", *device);
811 
812  return D3D_OK;
813 }
Definition: devices.h:37
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947

◆ d3d8_texture_3d_GetLevelCount()

static DWORD WINAPI d3d8_texture_3d_GetLevelCount ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 921 of file texture.c.

922 {
924  DWORD ret;
925 
926  TRACE("iface %p.\n", iface);
927 
929  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
931 
932  return ret;
933 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#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

◆ d3d8_texture_3d_GetLevelDesc()

static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc ( IDirect3DVolumeTexture8 *  iface,
UINT  level,
D3DVOLUME_DESC desc 
)
static

Definition at line 935 of file texture.c.

936 {
938  struct wined3d_sub_resource_desc wined3d_desc;
939  HRESULT hr;
940 
941  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
942 
944  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
945  {
946  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
947  desc->Type = D3DRTYPE_VOLUME;
948  desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
949  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
950  desc->Size = wined3d_desc.size;
951  desc->Width = wined3d_desc.width;
952  desc->Height = wined3d_desc.height;
953  desc->Depth = wined3d_desc.depth;
954  }
956 
957  return hr;
958 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
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
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
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:57

◆ d3d8_texture_3d_GetLOD()

static DWORD WINAPI d3d8_texture_3d_GetLOD ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 907 of file texture.c.

908 {
910  DWORD ret;
911 
912  TRACE("iface %p.\n", iface);
913 
915  ret = wined3d_texture_get_lod(texture->wined3d_texture);
917 
918  return ret;
919 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#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_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_GetPriority()

static DWORD WINAPI d3d8_texture_3d_GetPriority ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 859 of file texture.c.

860 {
862  const struct wined3d_resource *resource;
863  DWORD ret;
864 
865  TRACE("iface %p.\n", iface);
866 
868  resource = wined3d_texture_get_resource(texture->wined3d_texture);
871 
872  return ret;
873 }
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
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_GetPrivateData()

static HRESULT WINAPI d3d8_texture_3d_GetPrivateData ( IDirect3DVolumeTexture8 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 825 of file texture.c.

827 {
829  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
830  iface, debugstr_guid(guid), data, data_size);
831 
832  return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size);
833 }
const GUID * guid
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#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
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153

◆ d3d8_texture_3d_GetType()

static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 886 of file texture.c.

887 {
888  TRACE("iface %p.\n", iface);
889 
890  return D3DRTYPE_VOLUMETEXTURE;
891 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d8_texture_3d_GetVolumeLevel()

static HRESULT WINAPI d3d8_texture_3d_GetVolumeLevel ( IDirect3DVolumeTexture8 *  iface,
UINT  level,
IDirect3DVolume8 **  volume 
)
static

Definition at line 960 of file texture.c.

962 {
964  struct d3d8_volume *volume_impl;
965 
966  TRACE("iface %p, level %u, volume %p.\n", iface, level, volume);
967 
969  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
970  {
972  return D3DERR_INVALIDCALL;
973  }
974 
975  *volume = &volume_impl->IDirect3DVolume8_iface;
978 
979  return D3D_OK;
980 }
GLint level
Definition: gl.h:1546
IDirect3DVolume8 IDirect3DVolume8_iface
Definition: d3d8_private.h:153
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define IDirect3DVolume8_AddRef(p)
Definition: d3d8.h:222
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_LockBox()

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

Definition at line 982 of file texture.c.

984 {
986  struct d3d8_volume *volume_impl;
987  HRESULT hr;
988 
989  TRACE("iface %p, level %u, locked_box %p, box %p, flags %#x.\n",
990  iface, level, locked_box, box, flags);
991 
993  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
995  else
996  hr = IDirect3DVolume8_LockBox(&volume_impl->IDirect3DVolume8_iface, locked_box, box, flags);
998 
999  return hr;
1000 }
GLint level
Definition: gl.h:1546
IDirect3DVolume8 IDirect3DVolume8_iface
Definition: d3d8_private.h:153
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define IDirect3DVolume8_LockBox(p, a, b, c)
Definition: d3d8.h:231
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
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
Definition: palette.c:467

◆ d3d8_texture_3d_PreLoad()

static void WINAPI d3d8_texture_3d_PreLoad ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 875 of file texture.c.

876 {
878 
879  TRACE("iface %p.\n", iface);
880 
884 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_QueryInterface()

static HRESULT WINAPI d3d8_texture_3d_QueryInterface ( IDirect3DVolumeTexture8 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 742 of file texture.c.

743 {
744  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
745 
746  if (IsEqualGUID(riid, &IID_IDirect3DVolumeTexture8)
747  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)
748  || IsEqualGUID(riid, &IID_IDirect3DResource8)
750  {
752  *out = iface;
753  return S_OK;
754  }
755 
756  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
757 
758  *out = NULL;
759  return E_NOINTERFACE;
760 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
#define IDirect3DVolumeTexture8_AddRef(p)
Definition: d3d8.h:780
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:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3d8_texture_3d_Release()

static ULONG WINAPI d3d8_texture_3d_Release ( IDirect3DVolumeTexture8 *  iface)
static

Definition at line 780 of file texture.c.

781 {
783  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
784 
785  TRACE("%p decreasing refcount to %u.\n", iface, ref);
786 
787  if (!ref)
788  {
789  IDirect3DDevice8 *parent_device = texture->parent_device;
790 
792  wined3d_texture_decref(texture->wined3d_texture);
794 
795  /* Release the device last, as it may cause the device to be destroyed. */
797  }
798  return ref;
799 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:226
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
unsigned int ULONG
Definition: retypes.h:1
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_SetLOD()

static DWORD WINAPI d3d8_texture_3d_SetLOD ( IDirect3DVolumeTexture8 *  iface,
DWORD  lod 
)
static

Definition at line 893 of file texture.c.

894 {
896  DWORD ret;
897 
898  TRACE("iface %p, lod %u.\n", iface, lod);
899 
901  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
903 
904  return ret;
905 }
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLint lod
Definition: glext.h:7795
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_SetPriority()

static DWORD WINAPI d3d8_texture_3d_SetPriority ( IDirect3DVolumeTexture8 *  iface,
DWORD  priority 
)
static

Definition at line 843 of file texture.c.

844 {
846  struct wined3d_resource *resource;
847  DWORD ret;
848 
849  TRACE("iface %p, priority %u.\n", iface, priority);
850 
852  resource = wined3d_texture_get_resource(texture->wined3d_texture);
855 
856  return ret;
857 }
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
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_3d_SetPrivateData()

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

Definition at line 815 of file texture.c.

817 {
819  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
820  iface, debugstr_guid(guid), data, data_size, flags);
821 
822  return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
823 }
HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d8_main.c:197
const GUID * guid
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#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

◆ d3d8_texture_3d_UnlockBox()

static HRESULT WINAPI d3d8_texture_3d_UnlockBox ( IDirect3DVolumeTexture8 *  iface,
UINT  level 
)
static

Definition at line 1002 of file texture.c.

1003 {
1005  struct d3d8_volume *volume_impl;
1006  HRESULT hr;
1007 
1008  TRACE("iface %p, level %u.\n", iface, level);
1009 
1011  if (!(volume_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, level)))
1013  else
1016 
1017  return hr;
1018 }
GLint level
Definition: gl.h:1546
IDirect3DVolume8 IDirect3DVolume8_iface
Definition: d3d8_private.h:153
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define IDirect3DVolume8_UnlockBox(p)
Definition: d3d8.h:232
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_AddDirtyRect()

static HRESULT WINAPI d3d8_texture_cube_AddDirtyRect ( IDirect3DCubeTexture8 *  iface,
D3DCUBEMAP_FACES  face,
const RECT dirty_rect 
)
static

Definition at line 691 of file texture.c.

693 {
695  HRESULT hr;
696 
697  TRACE("iface %p, face %#x, dirty_rect %s.\n",
698  iface, face, wine_dbgstr_rect(dirty_rect));
699 
701  if (!dirty_rect)
702  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL);
703  else
704  {
705  struct wined3d_box dirty_region;
706 
707  wined3d_box_set(&dirty_region, dirty_rect->left, dirty_rect->top, dirty_rect->right, dirty_rect->bottom, 0, 1);
708  hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region);
709  }
711 
712  return hr;
713 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
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:77
const char * wine_dbgstr_rect(const RECT *rect)
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
LONG bottom
Definition: windef.h:294
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ d3d8_texture_cube_AddRef()

static ULONG WINAPI d3d8_texture_cube_AddRef ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 398 of file texture.c.

399 {
401  ULONG ref = InterlockedIncrement(&texture->resource.refcount);
402 
403  TRACE("%p increasing refcount to %u.\n", iface, ref);
404 
405  if (ref == 1)
406  {
407  struct d3d8_surface *surface;
408 
409  IDirect3DDevice8_AddRef(texture->parent_device);
411  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d8_surface, rtv_entry)
412  {
414  }
415  wined3d_texture_incref(texture->wined3d_texture);
417  }
418 
419  return ref;
420 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: send.c:47
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
struct list rtv_entry
Definition: d3d8_private.h:180
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
#define InterlockedIncrement
Definition: armddk.h:53
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
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
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994

◆ d3d8_texture_cube_FreePrivateData()

static HRESULT WINAPI d3d8_texture_cube_FreePrivateData ( IDirect3DCubeTexture8 *  iface,
REFGUID  guid 
)
static

Definition at line 484 of file texture.c.

485 {
487  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
488 
489  return d3d8_resource_free_private_data(&texture->resource, guid);
490 }
HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid)
Definition: d3d8_main.c:135
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 d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29

◆ d3d8_texture_cube_GetCubeMapSurface()

static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface ( IDirect3DCubeTexture8 *  iface,
D3DCUBEMAP_FACES  face,
UINT  level,
IDirect3DSurface8 **  surface 
)
static

Definition at line 615 of file texture.c.

617 {
619  struct d3d8_surface *surface_impl;
621  DWORD level_count;
622 
623  TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface);
624 
626  level_count = wined3d_texture_get_level_count(texture->wined3d_texture);
627  if (level >= level_count)
628  {
630  return D3DERR_INVALIDCALL;
631  }
632 
633  sub_resource_idx = level_count * face + level;
634  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
635  {
637  return D3DERR_INVALIDCALL;
638  }
639 
640  *surface = &surface_impl->IDirect3DSurface8_iface;
641  IDirect3DSurface8_AddRef(*surface);
643 
644  return D3D_OK;
645 }
GLint level
Definition: gl.h:1546
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
unsigned int sub_resource_idx
Definition: d3d8_private.h:179
#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
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
#define D3D_OK
Definition: d3d.h:106
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ d3d8_texture_cube_GetDevice()

static HRESULT WINAPI d3d8_texture_cube_GetDevice ( IDirect3DCubeTexture8 *  iface,
IDirect3DDevice8 **  device 
)
static

Definition at line 450 of file texture.c.

451 {
453 
454  TRACE("iface %p, device %p.\n", iface, device);
455 
456  *device = texture->parent_device;
458 
459  TRACE("Returning device %p.\n", *device);
460 
461  return D3D_OK;
462 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947

◆ d3d8_texture_cube_GetLevelCount()

static DWORD WINAPI d3d8_texture_cube_GetLevelCount ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 570 of file texture.c.

571 {
573  DWORD ret;
574 
575  TRACE("iface %p.\n", iface);
576 
578  ret = wined3d_texture_get_level_count(texture->wined3d_texture);
580 
581  return ret;
582 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
#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 d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_GetLevelDesc()

static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc ( IDirect3DCubeTexture8 *  iface,
UINT  level,
D3DSURFACE_DESC desc 
)
static

Definition at line 584 of file texture.c.

585 {
587  struct wined3d_sub_resource_desc wined3d_desc;
588  HRESULT hr;
589 
590  TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
591 
593  if (level >= wined3d_texture_get_level_count(texture->wined3d_texture))
594  {
596  return D3DERR_INVALIDCALL;
597  }
598 
599  if (SUCCEEDED(hr = wined3d_texture_get_sub_resource_desc(texture->wined3d_texture, level, &wined3d_desc)))
600  {
601  desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
602  desc->Type = D3DRTYPE_SURFACE;
603  desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
604  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
605  desc->Size = wined3d_desc.size;
606  desc->MultiSampleType = wined3d_desc.multisample_type;
607  desc->Width = wined3d_desc.width;
608  desc->Height = wined3d_desc.height;
609  }
611 
612  return hr;
613 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
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
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
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:77
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
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:57

◆ d3d8_texture_cube_GetLOD()

static DWORD WINAPI d3d8_texture_cube_GetLOD ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 556 of file texture.c.

557 {
559  DWORD ret;
560 
561  TRACE("iface %p.\n", iface);
562 
564  ret = wined3d_texture_get_lod(texture->wined3d_texture);
566 
567  return ret;
568 }
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_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_GetPriority()

static DWORD WINAPI d3d8_texture_cube_GetPriority ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 508 of file texture.c.

509 {
511  const struct wined3d_resource *resource;
512  DWORD ret;
513 
514  TRACE("iface %p.\n", iface);
515 
517  resource = wined3d_texture_get_resource(texture->wined3d_texture);
520 
521  return ret;
522 }
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
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_GetPrivateData()

static HRESULT WINAPI d3d8_texture_cube_GetPrivateData ( IDirect3DCubeTexture8 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 474 of file texture.c.

476 {
478  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
479  iface, debugstr_guid(guid), data, data_size);
480 
481  return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size);
482 }
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
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153

◆ d3d8_texture_cube_GetType()

static D3DRESOURCETYPE WINAPI d3d8_texture_cube_GetType ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 535 of file texture.c.

536 {
537  TRACE("iface %p.\n", iface);
538 
539  return D3DRTYPE_CUBETEXTURE;
540 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d8_texture_cube_LockRect()

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

Definition at line 647 of file texture.c.

650 {
652  struct d3d8_surface *surface_impl;
654  HRESULT hr;
655 
656  TRACE("iface %p, face %#x, level %u, locked_rect %p, rect %p, flags %#x.\n",
657  iface, face, level, locked_rect, rect, flags);
658 
661  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
663  else
664  hr = IDirect3DSurface8_LockRect(&surface_impl->IDirect3DSurface8_iface, locked_rect, rect, flags);
666 
667  return hr;
668 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
& rect
Definition: startmenu.cpp:1413
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
unsigned int sub_resource_idx
Definition: d3d8_private.h:179
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
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 d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
#define IDirect3DSurface8_LockRect(p, a, b, c)
Definition: d3d8.h:318
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ d3d8_texture_cube_PreLoad()

static void WINAPI d3d8_texture_cube_PreLoad ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 524 of file texture.c.

525 {
527 
528  TRACE("iface %p.\n", iface);
529 
533 }
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
GLenum GLuint texture
Definition: glext.h:6295
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_QueryInterface()

static HRESULT WINAPI d3d8_texture_cube_QueryInterface ( IDirect3DCubeTexture8 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 378 of file texture.c.

379 {
380  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
381 
382  if (IsEqualGUID(riid, &IID_IDirect3DCubeTexture8)
383  || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)
384  || IsEqualGUID(riid, &IID_IDirect3DResource8)
386  {
388  *out = iface;
389  return S_OK;
390  }
391 
392  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
393 
394  *out = NULL;
395  return E_NOINTERFACE;
396 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DCubeTexture8_AddRef(p)
Definition: d3d8.h:616
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3d8_texture_cube_Release()

static ULONG WINAPI d3d8_texture_cube_Release ( IDirect3DCubeTexture8 *  iface)
static

Definition at line 422 of file texture.c.

423 {
425  ULONG ref = InterlockedDecrement(&texture->resource.refcount);
426 
427  TRACE("%p decreasing refcount to %u.\n", iface, ref);
428 
429  if (!ref)
430  {
431  IDirect3DDevice8 *parent_device = texture->parent_device;
432  struct d3d8_surface *surface;
433 
434  TRACE("Releasing child %p.\n", texture->wined3d_texture);
435 
437  LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d8_surface, rtv_entry)
438  {
440  }
441  wined3d_texture_decref(texture->wined3d_texture);
443 
444  /* Release the device last, as it may cause the device to be destroyed. */
446  }
447  return ref;
448 }
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:182
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:226
Definition: send.c:47
#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 TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define InterlockedDecrement
Definition: armddk.h:52
struct list rtv_entry
Definition: d3d8_private.h:180
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
unsigned int ULONG
Definition: retypes.h:1
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_SetLOD()

static DWORD WINAPI d3d8_texture_cube_SetLOD ( IDirect3DCubeTexture8 *  iface,
DWORD  lod 
)
static

Definition at line 542 of file texture.c.

543 {
545  DWORD ret;
546 
547  TRACE("iface %p, lod %u.\n", iface, lod);
548 
550  ret = wined3d_texture_set_lod(texture->wined3d_texture, lod);
552 
553  return ret;
554 }
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
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 d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
GLint lod
Definition: glext.h:7795
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_SetPriority()

static DWORD WINAPI d3d8_texture_cube_SetPriority ( IDirect3DCubeTexture8 *  iface,
DWORD  priority 
)
static

Definition at line 492 of file texture.c.

493 {
495  struct wined3d_resource *resource;
496  DWORD ret;
497 
498  TRACE("iface %p, priority %u.\n", iface, priority);
499 
501  resource = wined3d_texture_get_resource(texture->wined3d_texture);
504 
505  return ret;
506 }
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
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
int ret
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_texture_cube_SetPrivateData()

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

Definition at line 464 of file texture.c.

466 {
468  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
469  iface, debugstr_guid(guid), data, data_size, flags);
470 
471  return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags);
472 }
HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d8_main.c:197
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 d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29

◆ d3d8_texture_cube_UnlockRect()

static HRESULT WINAPI d3d8_texture_cube_UnlockRect ( IDirect3DCubeTexture8 *  iface,
D3DCUBEMAP_FACES  face,
UINT  level 
)
static

Definition at line 670 of file texture.c.

672 {
674  struct d3d8_surface *surface_impl;
676  HRESULT hr;
677 
678  TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
679 
682  if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
684  else
687 
688  return hr;
689 }
GLint level
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
#define IDirect3DSurface8_UnlockRect(p)
Definition: d3d8.h:319
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
unsigned int sub_resource_idx
Definition: d3d8_private.h:179
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ d3d8_texture_wined3d_object_destroyed()

static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed ( void parent)
static

Definition at line 1082 of file texture.c.

1083 {
1084  struct d3d8_texture *texture = parent;
1085  d3d8_resource_cleanup(&texture->resource);
1086  heap_free(texture);
1087 }
void d3d8_resource_cleanup(struct d3d8_resource *resource)
Definition: d3d8_main.c:130
r parent
Definition: btrfs.c:2869
GLenum GLuint texture
Definition: glext.h:6295
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ impl_from_IDirect3DCubeTexture8()

static struct d3d8_texture* impl_from_IDirect3DCubeTexture8 ( IDirect3DCubeTexture8 *  iface)
inlinestatic

◆ impl_from_IDirect3DTexture8()

static struct d3d8_texture* impl_from_IDirect3DTexture8 ( IDirect3DTexture8 *  iface)
inlinestatic

◆ impl_from_IDirect3DVolumeTexture8()

static struct d3d8_texture* impl_from_IDirect3DVolumeTexture8 ( IDirect3DVolumeTexture8 *  iface)
inlinestatic

◆ texture_init()

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

Definition at line 1094 of file texture.c.

1096 {
1097  struct wined3d_resource_desc desc;
1098  DWORD flags = 0;
1099  HRESULT hr;
1100 
1101  texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl;
1102  d3d8_resource_init(&texture->resource);
1103  list_init(&texture->rtv_list);
1104 
1105  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1107  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1108  desc.multisample_quality = 0;
1109  desc.usage = usage & WINED3DUSAGE_MASK;
1110  desc.usage |= WINED3DUSAGE_TEXTURE;
1111  if (pool == D3DPOOL_SCRATCH)
1112  desc.usage |= WINED3DUSAGE_SCRATCH;
1115  desc.width = width;
1116  desc.height = height;
1117  desc.depth = 1;
1118  desc.size = 0;
1119 
1122 
1123  if (!levels)
1124  levels = wined3d_log2i(max(width, height)) + 1;
1125 
1127  hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, flags,
1128  NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
1130  if (FAILED(hr))
1131  {
1132  WARN("Failed to create wined3d texture, hr %#x.\n", hr);
1133  return hr;
1134  }
1135 
1136  texture->parent_device = &device->IDirect3DDevice8_iface;
1137  IDirect3DDevice8_AddRef(texture->parent_device);
1138 
1139  return D3D_OK;
1140 }
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
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 WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
Definition: texture.c:351
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
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 IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
#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 struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
Definition: texture.c:1089
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
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
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

Referenced by d3d8_device_CreateTexture(), d3d9_device_CreateTexture(), and wined3d_texture_create().

◆ unsafe_impl_from_IDirect3DBaseTexture8()

struct d3d8_texture* unsafe_impl_from_IDirect3DBaseTexture8 ( IDirect3DBaseTexture8 *  iface)

Definition at line 1061 of file texture.c.

1062 {
1063  if (!iface)
1064  return NULL;
1065 
1066  /* SetTexture() in particular doesn't do a lot of validation on the pointer
1067  * that gets passed in, and passing an invalid pointer works as long as the
1068  * application doesn't try to actually render anything with it, so we print
1069  * a WARN and return NULL instead of having the usual assert() here.
1070  * One application affected by this is Fishdom 2. */
1071  if (iface->lpVtbl != (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl
1072  && iface->lpVtbl != (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl
1073  && iface->lpVtbl != (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl)
1074  {
1075  WARN("%p is not a valid IDirect3DBaseTexture8 interface.\n", iface);
1076  return NULL;
1077  }
1078 
1079  return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
1080 }
#define WARN(fmt,...)
Definition: debug.h:111
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
Definition: texture.c:715
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
Definition: texture.c:351
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 IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
Definition: texture.c:1034

Referenced by d3d8_device_SetTexture(), d3d8_device_UpdateTexture(), and surface_init().

◆ volumetexture_init()

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

Definition at line 1190 of file texture.c.

1192 {
1193  struct wined3d_resource_desc desc;
1194  HRESULT hr;
1195 
1196  texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl;
1197  d3d8_resource_init(&texture->resource);
1198  list_init(&texture->rtv_list);
1199 
1200  desc.resource_type = WINED3D_RTYPE_TEXTURE_3D;
1202  desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
1203  desc.multisample_quality = 0;
1204  desc.usage = usage & WINED3DUSAGE_MASK;
1205  desc.usage |= WINED3DUSAGE_TEXTURE;
1206  if (pool == D3DPOOL_SCRATCH)
1207  desc.usage |= WINED3DUSAGE_SCRATCH;
1209  desc.width = width;
1210  desc.height = height;
1211  desc.depth = depth;
1212  desc.size = 0;
1213 
1214  if (!levels)
1216 
1218  hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, 0,
1219  NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
1221  if (FAILED(hr))
1222  {
1223  WARN("Failed to create wined3d volume texture, hr %#x.\n", hr);
1224  return hr;
1225  }
1226 
1227  texture->parent_device = &device->IDirect3DDevice8_iface;
1228  IDirect3DDevice8_AddRef(texture->parent_device);
1229 
1230  return D3D_OK;
1231 }
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 WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
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
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
Definition: texture.c:1034
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 IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
#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 d3d8_texture_wined3d_parent_ops
Definition: texture.c:1089
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
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
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

Referenced by d3d8_device_CreateVolumeTexture(), d3d9_device_CreateVolumeTexture(), and wined3d_texture_create().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d8  )

Variable Documentation

◆ d3d8_texture_wined3d_parent_ops

const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed(void *parent)
Definition: texture.c:1082

Definition at line 1089 of file texture.c.

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

◆ Direct3DCubeTexture8_Vtbl

const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
static
Initial value:
=
{
}
static DWORD WINAPI d3d8_texture_cube_GetLevelCount(IDirect3DCubeTexture8 *iface)
Definition: texture.c:570
static HRESULT WINAPI d3d8_texture_cube_UnlockRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level)
Definition: texture.c:670
static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
Definition: texture.c:398
static void WINAPI d3d8_texture_cube_PreLoad(IDirect3DCubeTexture8 *iface)
Definition: texture.c:524
static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority)
Definition: texture.c:492
static HRESULT WINAPI d3d8_texture_cube_LockRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:647
static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:378
static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface)
Definition: texture.c:422
static HRESULT WINAPI d3d8_texture_cube_GetPrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:474
static DWORD WINAPI d3d8_texture_cube_GetLOD(IDirect3DCubeTexture8 *iface)
Definition: texture.c:556
static HRESULT WINAPI d3d8_texture_cube_FreePrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid)
Definition: texture.c:484
static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc(IDirect3DCubeTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:584
static HRESULT WINAPI d3d8_texture_cube_AddDirtyRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
Definition: texture.c:691
static DWORD WINAPI d3d8_texture_cube_GetPriority(IDirect3DCubeTexture8 *iface)
Definition: texture.c:508
static DWORD WINAPI d3d8_texture_cube_SetLOD(IDirect3DCubeTexture8 *iface, DWORD lod)
Definition: texture.c:542
static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
Definition: texture.c:615
static D3DRESOURCETYPE WINAPI d3d8_texture_cube_GetType(IDirect3DCubeTexture8 *iface)
Definition: texture.c:535
static HRESULT WINAPI d3d8_texture_cube_SetPrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:464
static HRESULT WINAPI d3d8_texture_cube_GetDevice(IDirect3DCubeTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:450

Definition at line 715 of file texture.c.

Referenced by cubetexture_init(), and unsafe_impl_from_IDirect3DBaseTexture8().

◆ Direct3DTexture8_Vtbl

const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
static
Initial value:
=
{
}
static DWORD WINAPI d3d8_texture_2d_GetLOD(IDirect3DTexture8 *iface)
Definition: texture.c:215
static DWORD WINAPI d3d8_texture_2d_GetPriority(IDirect3DTexture8 *iface)
Definition: texture.c:167
static DWORD WINAPI d3d8_texture_2d_GetLevelCount(IDirect3DTexture8 *iface)
Definition: texture.c:229
static D3DRESOURCETYPE WINAPI d3d8_texture_2d_GetType(IDirect3DTexture8 *iface)
Definition: texture.c:194
static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:243
static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect(IDirect3DTexture8 *iface, const RECT *dirty_rect)
Definition: texture.c:328
static HRESULT WINAPI d3d8_texture_2d_GetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:133
static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface)
Definition: texture.c:59
static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority)
Definition: texture.c:151
static HRESULT WINAPI d3d8_texture_2d_GetDevice(IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:109
static DWORD WINAPI d3d8_texture_2d_SetLOD(IDirect3DTexture8 *iface, DWORD lod)
Definition: texture.c:201
static ULONG WINAPI d3d8_texture_2d_Release(IDirect3DTexture8 *iface)
Definition: texture.c:83
static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:39
static void WINAPI d3d8_texture_2d_PreLoad(IDirect3DTexture8 *iface)
Definition: texture.c:183
static HRESULT WINAPI d3d8_texture_2d_LockRect(IDirect3DTexture8 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:290
static HRESULT WINAPI d3d8_texture_2d_FreePrivateData(IDirect3DTexture8 *iface, REFGUID guid)
Definition: texture.c:143
static HRESULT WINAPI d3d8_texture_2d_SetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:123
static HRESULT WINAPI d3d8_texture_2d_GetSurfaceLevel(IDirect3DTexture8 *iface, UINT level, IDirect3DSurface8 **surface)
Definition: texture.c:268
static HRESULT WINAPI d3d8_texture_2d_UnlockRect(IDirect3DTexture8 *iface, UINT level)
Definition: texture.c:310

Definition at line 351 of file texture.c.

Referenced by texture_init(), and unsafe_impl_from_IDirect3DBaseTexture8().

◆ Direct3DVolumeTexture8_Vtbl

const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d8_texture_3d_SetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:815
static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:886
static ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:762
static DWORD WINAPI d3d8_texture_3d_GetLevelCount(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:921
static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc(IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
Definition: texture.c:935
static DWORD WINAPI d3d8_texture_3d_GetPriority(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:859
static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox(IDirect3DVolumeTexture8 *iface, const D3DBOX *dirty_box)
Definition: texture.c:1020
static HRESULT WINAPI d3d8_texture_3d_LockBox(IDirect3DVolumeTexture8 *iface, UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
Definition: texture.c:982
static DWORD WINAPI d3d8_texture_3d_SetLOD(IDirect3DVolumeTexture8 *iface, DWORD lod)
Definition: texture.c:893
static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority)
Definition: texture.c:843
static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:742
static ULONG WINAPI d3d8_texture_3d_Release(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:780
static void WINAPI d3d8_texture_3d_PreLoad(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:875
static HRESULT WINAPI d3d8_texture_3d_GetDevice(IDirect3DVolumeTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:801
static DWORD WINAPI d3d8_texture_3d_GetLOD(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:907
static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid)
Definition: texture.c:835
static HRESULT WINAPI d3d8_texture_3d_UnlockBox(IDirect3DVolumeTexture8 *iface, UINT level)
Definition: texture.c:1002
static HRESULT WINAPI d3d8_texture_3d_GetVolumeLevel(IDirect3DVolumeTexture8 *iface, UINT level, IDirect3DVolume8 **volume)
Definition: texture.c:960
static HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:825

Definition at line 1034 of file texture.c.

Referenced by unsafe_impl_from_IDirect3DBaseTexture8(), and volumetexture_init().