ReactOS 0.4.15-dev-8119-g4fb2fdb
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{
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}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define WARN(fmt,...)
Definition: debug.h:115
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
@ D3DPOOL_SCRATCH
Definition: d3d8types.h:712
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
#define D3D_OK
Definition: d3d.h:106
#define NULL
Definition: types.h:112
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
Definition: texture.c:715
static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
Definition: texture.c:1089
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLenum GLuint texture
Definition: glext.h:6295
GLbitfield flags
Definition: glext.h:7161
GLsizei levels
Definition: glext.h:7884
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define FAILED(hr)
Definition: intsafe.h:51
static const WCHAR desc[]
Definition: protectdata.c:36
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
HRESULT hr
Definition: shlfolder.c:183
Definition: devices.h:37
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:554
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

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}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
static struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
#define TRACE(s)
Definition: solgame.cpp:4
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
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

◆ 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}
#define InterlockedIncrement
Definition: armddk.h:53
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list rtv_entry
Definition: d3d8_private.h:180
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ 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
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

◆ 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}

◆ 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}
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
int ret

◆ 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}
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
@ D3DRTYPE_SURFACE
Definition: d3d8types.h:810
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
GLint level
Definition: gl.h:1546
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ 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}
DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221

◆ 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
179
180 return ret;
181}
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
#define resource
Definition: kernel32.h:9

◆ 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}
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ 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}
#define D3DERR_INVALIDCALL
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176

◆ 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}
@ D3DRTYPE_TEXTURE
Definition: d3d8types.h:812

◆ 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}
#define IDirect3DSurface8_LockRect(p, a, b, c)
Definition: d3d8.h:318
& rect
Definition: startmenu.cpp:1413

◆ 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 CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482

◆ 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}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static FILE * out
Definition: regtests2xml.c:44
#define IDirect3DTexture8_AddRef(p)
Definition: d3d8.h:698
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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}
#define InterlockedDecrement
Definition: armddk.h:52
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:182
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:226

◆ 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
GLint lod
Definition: glext.h:7795

◆ 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{
155 DWORD ret;
156
157 TRACE("iface %p, priority %u.\n", iface, priority);
158
163
164 return ret;
165}
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
static int priority
Definition: timer.c:163

◆ 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

◆ 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}
#define IDirect3DSurface8_UnlockRect(p)
Definition: d3d8.h:319

◆ 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}
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}
@ D3DRTYPE_VOLUME
Definition: d3d8types.h:811

◆ 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}

◆ 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
871
872 return ret;
873}

◆ 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}

◆ 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
891}
@ D3DRTYPE_VOLUMETEXTURE
Definition: d3d8types.h:813

◆ 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}
#define IDirect3DVolume8_AddRef(p)
Definition: d3d8.h:222
IDirect3DVolume8 IDirect3DVolume8_iface
Definition: d3d8_private.h:153

◆ 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}
#define IDirect3DVolume8_LockBox(p, a, b, c)
Definition: d3d8.h:231
Definition: palette.c:468

◆ 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}

◆ 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 IDirect3DVolumeTexture8_AddRef(p)
Definition: d3d8.h:780

◆ 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}

◆ 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}

◆ 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{
847 DWORD ret;
848
849 TRACE("iface %p, priority %u.\n", iface, priority);
850
855
856 return ret;
857}

◆ 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}

◆ 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}
#define IDirect3DVolume8_UnlockBox(p)
Definition: d3d8.h:232

◆ 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)
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}
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
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}

◆ 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}

◆ 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}
unsigned int UINT
Definition: ndis.h:50
unsigned int sub_resource_idx
Definition: d3d8_private.h:179

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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
520
521 return ret;
522}

◆ 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}

◆ 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
540}
@ D3DRTYPE_CUBETEXTURE
Definition: d3d8types.h:814

◆ 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}

◆ 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}

◆ 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 IDirect3DCubeTexture8_AddRef(p)
Definition: d3d8.h:616

◆ 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}

◆ 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}

◆ 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{
496 DWORD ret;
497
498 TRACE("iface %p, priority %u.\n", iface, priority);
499
504
505 return ret;
506}

◆ 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}

◆ 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}

◆ 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);
1087}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
void d3d8_resource_cleanup(struct d3d8_resource *resource)
Definition: d3d8_main.c:130
r parent
Definition: btrfs.c:3010

◆ impl_from_IDirect3DCubeTexture8()

◆ impl_from_IDirect3DTexture8()

◆ impl_from_IDirect3DVolumeTexture8()

◆ 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{
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)
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}
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
Definition: texture.c:351
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define max(a, b)
Definition: svc.c:63

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}
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{
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 GLsizei GLsizei depth
Definition: gl.h:1546
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:701

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 HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
Definition: texture.c:615
static DWORD WINAPI d3d8_texture_cube_GetLOD(IDirect3DCubeTexture8 *iface)
Definition: texture.c:556
static HRESULT WINAPI d3d8_texture_cube_UnlockRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level)
Definition: texture.c:670
static HRESULT WINAPI d3d8_texture_cube_AddDirtyRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
Definition: texture.c:691
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 void WINAPI d3d8_texture_cube_PreLoad(IDirect3DCubeTexture8 *iface)
Definition: texture.c:524
static HRESULT WINAPI d3d8_texture_cube_GetPrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:474
static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface)
Definition: texture.c:422
static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
Definition: texture.c:398
static DWORD WINAPI d3d8_texture_cube_GetLevelCount(IDirect3DCubeTexture8 *iface)
Definition: texture.c:570
static HRESULT WINAPI d3d8_texture_cube_FreePrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid)
Definition: texture.c:484
static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority)
Definition: texture.c:492
static HRESULT WINAPI d3d8_texture_cube_GetDevice(IDirect3DCubeTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:450
static DWORD WINAPI d3d8_texture_cube_GetPriority(IDirect3DCubeTexture8 *iface)
Definition: texture.c:508
static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc(IDirect3DCubeTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:584
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_QueryInterface(IDirect3DCubeTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:378
static D3DRESOURCETYPE WINAPI d3d8_texture_cube_GetType(IDirect3DCubeTexture8 *iface)
Definition: texture.c:535
static DWORD WINAPI d3d8_texture_cube_SetLOD(IDirect3DCubeTexture8 *iface, DWORD lod)
Definition: texture.c:542

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 HRESULT WINAPI d3d8_texture_2d_GetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:133
static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:39
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_GetDevice(IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:109
static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect(IDirect3DTexture8 *iface, const RECT *dirty_rect)
Definition: texture.c:328
static DWORD WINAPI d3d8_texture_2d_GetPriority(IDirect3DTexture8 *iface)
Definition: texture.c:167
static ULONG WINAPI d3d8_texture_2d_Release(IDirect3DTexture8 *iface)
Definition: texture.c:83
static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority)
Definition: texture.c:151
static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface)
Definition: texture.c:59
static void WINAPI d3d8_texture_2d_PreLoad(IDirect3DTexture8 *iface)
Definition: texture.c:183
static DWORD WINAPI d3d8_texture_2d_SetLOD(IDirect3DTexture8 *iface, DWORD lod)
Definition: texture.c:201
static HRESULT WINAPI d3d8_texture_2d_UnlockRect(IDirect3DTexture8 *iface, UINT level)
Definition: texture.c:310
static DWORD WINAPI d3d8_texture_2d_GetLOD(IDirect3DTexture8 *iface)
Definition: texture.c:215
static HRESULT WINAPI d3d8_texture_2d_FreePrivateData(IDirect3DTexture8 *iface, REFGUID guid)
Definition: texture.c:143
static D3DRESOURCETYPE WINAPI d3d8_texture_2d_GetType(IDirect3DTexture8 *iface)
Definition: texture.c:194
static DWORD WINAPI d3d8_texture_2d_GetLevelCount(IDirect3DTexture8 *iface)
Definition: texture.c:229
static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:243
static HRESULT WINAPI d3d8_texture_2d_LockRect(IDirect3DTexture8 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:290

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 ULONG WINAPI d3d8_texture_3d_Release(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:780
static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority)
Definition: texture.c:843
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 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_GetLevelDesc(IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
Definition: texture.c:935
static DWORD WINAPI d3d8_texture_3d_GetLevelCount(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:921
static DWORD WINAPI d3d8_texture_3d_SetLOD(IDirect3DVolumeTexture8 *iface, DWORD lod)
Definition: texture.c:893
static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:886
static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:742
static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid)
Definition: texture.c:835
static DWORD WINAPI d3d8_texture_3d_GetPriority(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:859
static HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:825
static DWORD WINAPI d3d8_texture_3d_GetLOD(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:907
static HRESULT WINAPI d3d8_texture_3d_SetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:815
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 ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:762
static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox(IDirect3DVolumeTexture8 *iface, const D3DBOX *dirty_box)
Definition: texture.c:1020

Definition at line 1034 of file texture.c.

Referenced by unsafe_impl_from_IDirect3DBaseTexture8(), and volumetexture_init().