ReactOS 0.4.15-dev-8413-gc1c91f2
texture.c
Go to the documentation of this file.
1/*
2 * Copyright 2005 Oliver Stieber
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "config.h"
20#include "d3d8_private.h"
21
23
24static inline struct d3d8_texture *impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
25{
26 return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
27}
28
29static inline struct d3d8_texture *impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
30{
31 return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
32}
33
34static inline struct d3d8_texture *impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
35{
36 return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
37}
38
39static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out)
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}
58
59static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface)
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}
82
83static ULONG WINAPI d3d8_texture_2d_Release(IDirect3DTexture8 *iface)
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}
108
109static HRESULT WINAPI d3d8_texture_2d_GetDevice(IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
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}
122
123static HRESULT WINAPI d3d8_texture_2d_SetPrivateData(IDirect3DTexture8 *iface,
124 REFGUID guid, const void *data, DWORD data_size, DWORD flags)
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}
132
133static HRESULT WINAPI d3d8_texture_2d_GetPrivateData(IDirect3DTexture8 *iface,
134 REFGUID guid, void *data, DWORD *data_size)
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}
142
144{
146 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
147
148 return d3d8_resource_free_private_data(&texture->resource, guid);
149}
150
151static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority)
152{
155 DWORD ret;
156
157 TRACE("iface %p, priority %u.\n", iface, priority);
158
163
164 return ret;
165}
166
167static DWORD WINAPI d3d8_texture_2d_GetPriority(IDirect3DTexture8 *iface)
168{
170 const struct wined3d_resource *resource;
171 DWORD ret;
172
173 TRACE("iface %p.\n", iface);
174
179
180 return ret;
181}
182
183static void WINAPI d3d8_texture_2d_PreLoad(IDirect3DTexture8 *iface)
184{
186
187 TRACE("iface %p.\n", iface);
188
192}
193
194static D3DRESOURCETYPE WINAPI d3d8_texture_2d_GetType(IDirect3DTexture8 *iface)
195{
196 TRACE("iface %p.\n", iface);
197
198 return D3DRTYPE_TEXTURE;
199}
200
201static DWORD WINAPI d3d8_texture_2d_SetLOD(IDirect3DTexture8 *iface, DWORD lod)
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}
214
215static DWORD WINAPI d3d8_texture_2d_GetLOD(IDirect3DTexture8 *iface)
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}
228
229static DWORD WINAPI d3d8_texture_2d_GetLevelCount(IDirect3DTexture8 *iface)
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}
242
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}
267
268static HRESULT WINAPI d3d8_texture_2d_GetSurfaceLevel(IDirect3DTexture8 *iface,
269 UINT level, IDirect3DSurface8 **surface)
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}
289
290static HRESULT WINAPI d3d8_texture_2d_LockRect(IDirect3DTexture8 *iface, UINT level,
291 D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
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}
309
310static HRESULT WINAPI d3d8_texture_2d_UnlockRect(IDirect3DTexture8 *iface, UINT level)
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}
327
328static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect(IDirect3DTexture8 *iface, const RECT *dirty_rect)
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}
350
351static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl =
352{
353 /* IUnknown */
357 /* IDirect3DResource8 */
366 /* IDirect3dBaseTexture8 */
370 /* IDirect3DTexture8 */
376};
377
378static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *iface, REFIID riid, void **out)
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}
397
398static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
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}
421
422static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface)
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}
449
450static HRESULT WINAPI d3d8_texture_cube_GetDevice(IDirect3DCubeTexture8 *iface, IDirect3DDevice8 **device)
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}
463
464static HRESULT WINAPI d3d8_texture_cube_SetPrivateData(IDirect3DCubeTexture8 *iface,
465 REFGUID guid, const void *data, DWORD data_size, DWORD flags)
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}
473
474static HRESULT WINAPI d3d8_texture_cube_GetPrivateData(IDirect3DCubeTexture8 *iface,
475 REFGUID guid, void *data, DWORD *data_size)
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}
483
484static HRESULT WINAPI d3d8_texture_cube_FreePrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid)
485{
487 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
488
489 return d3d8_resource_free_private_data(&texture->resource, guid);
490}
491
492static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority)
493{
496 DWORD ret;
497
498 TRACE("iface %p, priority %u.\n", iface, priority);
499
504
505 return ret;
506}
507
508static DWORD WINAPI d3d8_texture_cube_GetPriority(IDirect3DCubeTexture8 *iface)
509{
511 const struct wined3d_resource *resource;
512 DWORD ret;
513
514 TRACE("iface %p.\n", iface);
515
520
521 return ret;
522}
523
524static void WINAPI d3d8_texture_cube_PreLoad(IDirect3DCubeTexture8 *iface)
525{
527
528 TRACE("iface %p.\n", iface);
529
533}
534
535static D3DRESOURCETYPE WINAPI d3d8_texture_cube_GetType(IDirect3DCubeTexture8 *iface)
536{
537 TRACE("iface %p.\n", iface);
538
540}
541
542static DWORD WINAPI d3d8_texture_cube_SetLOD(IDirect3DCubeTexture8 *iface, DWORD lod)
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}
555
556static DWORD WINAPI d3d8_texture_cube_GetLOD(IDirect3DCubeTexture8 *iface)
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}
569
570static DWORD WINAPI d3d8_texture_cube_GetLevelCount(IDirect3DCubeTexture8 *iface)
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}
583
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}
614
615static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture8 *iface,
616 D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
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}
646
647static HRESULT WINAPI d3d8_texture_cube_LockRect(IDirect3DCubeTexture8 *iface,
648 D3DCUBEMAP_FACES face, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect,
649 DWORD flags)
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}
669
670static HRESULT WINAPI d3d8_texture_cube_UnlockRect(IDirect3DCubeTexture8 *iface,
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}
690
691static HRESULT WINAPI d3d8_texture_cube_AddDirtyRect(IDirect3DCubeTexture8 *iface,
692 D3DCUBEMAP_FACES face, const RECT *dirty_rect)
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}
714
715static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl =
716{
717 /* IUnknown */
721 /* IDirect3DResource8 */
730 /* IDirect3DBaseTexture8 */
734 /* IDirect3DCubeTexture8 */
740};
741
742static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
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}
761
762static ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface)
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}
779
780static ULONG WINAPI d3d8_texture_3d_Release(IDirect3DVolumeTexture8 *iface)
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}
800
801static HRESULT WINAPI d3d8_texture_3d_GetDevice(IDirect3DVolumeTexture8 *iface, IDirect3DDevice8 **device)
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}
814
815static HRESULT WINAPI d3d8_texture_3d_SetPrivateData(IDirect3DVolumeTexture8 *iface,
816 REFGUID guid, const void *data, DWORD data_size, DWORD flags)
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}
824
825static HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface,
826 REFGUID guid, void *data, DWORD *data_size)
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}
834
835static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid)
836{
838 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
839
840 return d3d8_resource_free_private_data(&texture->resource, guid);
841}
842
843static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority)
844{
847 DWORD ret;
848
849 TRACE("iface %p, priority %u.\n", iface, priority);
850
855
856 return ret;
857}
858
859static DWORD WINAPI d3d8_texture_3d_GetPriority(IDirect3DVolumeTexture8 *iface)
860{
862 const struct wined3d_resource *resource;
863 DWORD ret;
864
865 TRACE("iface %p.\n", iface);
866
871
872 return ret;
873}
874
875static void WINAPI d3d8_texture_3d_PreLoad(IDirect3DVolumeTexture8 *iface)
876{
878
879 TRACE("iface %p.\n", iface);
880
884}
885
886static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType(IDirect3DVolumeTexture8 *iface)
887{
888 TRACE("iface %p.\n", iface);
889
891}
892
893static DWORD WINAPI d3d8_texture_3d_SetLOD(IDirect3DVolumeTexture8 *iface, DWORD lod)
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}
906
907static DWORD WINAPI d3d8_texture_3d_GetLOD(IDirect3DVolumeTexture8 *iface)
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}
920
921static DWORD WINAPI d3d8_texture_3d_GetLevelCount(IDirect3DVolumeTexture8 *iface)
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}
934
935static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc(IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
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}
959
960static HRESULT WINAPI d3d8_texture_3d_GetVolumeLevel(IDirect3DVolumeTexture8 *iface,
961 UINT level, IDirect3DVolume8 **volume)
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}
981
982static HRESULT WINAPI d3d8_texture_3d_LockBox(IDirect3DVolumeTexture8 *iface,
983 UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
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}
1001
1002static HRESULT WINAPI d3d8_texture_3d_UnlockBox(IDirect3DVolumeTexture8 *iface, UINT level)
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}
1019
1020static HRESULT WINAPI d3d8_texture_3d_AddDirtyBox(IDirect3DVolumeTexture8 *iface, const D3DBOX *dirty_box)
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}
1033
1034static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
1035{
1036 /* IUnknown */
1040 /* IDirect3DResource8 */
1049 /* IDirect3DBaseTexture8 */
1053 /* IDirect3DVolumeTexture8 */
1059};
1060
1061struct d3d8_texture *unsafe_impl_from_IDirect3DBaseTexture8(IDirect3DBaseTexture8 *iface)
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
1080}
1081
1083{
1084 struct d3d8_texture *texture = parent;
1085 d3d8_resource_cleanup(&texture->resource);
1087}
1088
1090{
1092};
1093
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}
1141
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}
1189
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}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static void list_init(struct list_entry *head)
Definition: list.h:51
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153
void d3d8_resource_cleanup(struct d3d8_resource *resource)
Definition: d3d8_main.c:130
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
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
HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid)
Definition: d3d8_main.c:135
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
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 unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
enum _D3DRESOURCETYPE D3DRESOURCETYPE
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
@ D3DRTYPE_TEXTURE
Definition: d3d8types.h:812
@ D3DRTYPE_VOLUMETEXTURE
Definition: d3d8types.h:813
@ D3DRTYPE_CUBETEXTURE
Definition: d3d8types.h:814
@ D3DRTYPE_VOLUME
Definition: d3d8types.h:811
@ D3DRTYPE_SURFACE
Definition: d3d8types.h:810
enum _D3DPOOL D3DPOOL
@ D3DPOOL_SCRATCH
Definition: d3d8types.h:712
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
enum _D3DFORMAT D3DFORMAT
enum _D3DCUBEMAP_FACES D3DCUBEMAP_FACES
#define D3D_OK
Definition: d3d.h:106
#define D3DERR_INVALIDCALL
#define NULL
Definition: types.h:112
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_cube_GetCubeMapSurface(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
Definition: texture.c:615
struct d3d8_texture * unsafe_impl_from_IDirect3DBaseTexture8(IDirect3DBaseTexture8 *iface)
Definition: texture.c:1061
static HRESULT WINAPI d3d8_texture_2d_GetSurfaceLevel(IDirect3DTexture8 *iface, UINT level, IDirect3DSurface8 **surface)
Definition: texture.c:268
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
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: texture.c:1190
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_cube_AddDirtyRect(IDirect3DCubeTexture8 *iface, D3DCUBEMAP_FACES face, const RECT *dirty_rect)
Definition: texture.c:691
static HRESULT WINAPI d3d8_texture_3d_GetDevice(IDirect3DVolumeTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:801
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_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
HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: texture.c:1142
static HRESULT WINAPI d3d8_texture_2d_GetDevice(IDirect3DTexture8 *iface, IDirect3DDevice8 **device)
Definition: texture.c:109
static struct d3d8_texture * impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:34
static HRESULT WINAPI d3d8_texture_2d_AddDirtyRect(IDirect3DTexture8 *iface, const RECT *dirty_rect)
Definition: texture.c:328
static HRESULT WINAPI d3d8_texture_3d_GetLevelDesc(IDirect3DVolumeTexture8 *iface, UINT level, D3DVOLUME_DESC *desc)
Definition: texture.c:935
static DWORD WINAPI d3d8_texture_2d_GetPriority(IDirect3DTexture8 *iface)
Definition: texture.c:167
static void WINAPI d3d8_texture_cube_PreLoad(IDirect3DCubeTexture8 *iface)
Definition: texture.c:524
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
HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: texture.c:1094
static D3DRESOURCETYPE WINAPI d3d8_texture_3d_GetType(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:886
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 HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *iface, REFIID riid, void **out)
Definition: texture.c:742
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_2d_AddRef(IDirect3DTexture8 *iface)
Definition: texture.c:59
static const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
Definition: texture.c:715
static void WINAPI d3d8_texture_2d_PreLoad(IDirect3DTexture8 *iface)
Definition: texture.c:183
static const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
Definition: texture.c:1034
static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid)
Definition: texture.c:835
static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface)
Definition: texture.c:422
static struct d3d8_texture * impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
Definition: texture.c:29
static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface)
Definition: texture.c:398
static DWORD WINAPI d3d8_texture_2d_SetLOD(IDirect3DTexture8 *iface, DWORD lod)
Definition: texture.c:201
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 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 struct d3d8_texture * impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
Definition: texture.c:24
static DWORD WINAPI d3d8_texture_3d_GetPriority(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:859
static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops
Definition: texture.c:1089
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 HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: texture.c:825
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_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 DWORD WINAPI d3d8_texture_3d_GetLOD(IDirect3DVolumeTexture8 *iface)
Definition: texture.c:907
static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UINT level, D3DSURFACE_DESC *desc)
Definition: texture.c:243
static HRESULT WINAPI d3d8_texture_3d_SetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: texture.c:815
static const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
Definition: texture.c:351
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_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
static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed(void *parent)
Definition: texture.c:1082
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 HRESULT WINAPI d3d8_texture_2d_LockRect(IDirect3DTexture8 *iface, UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
Definition: texture.c:290
static DWORD WINAPI d3d8_texture_cube_SetLOD(IDirect3DCubeTexture8 *iface, DWORD lod)
Definition: texture.c:542
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
Definition: texture.c:1186
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_lod(const struct wined3d_texture *texture)
Definition: texture.c:1221
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
Definition: texture.c:1677
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:3511
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
Definition: texture.c:994
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1228
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint level
Definition: gl.h:1546
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLuint texture
Definition: glext.h:6295
GLint lod
Definition: glext.h:7795
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLbitfield flags
Definition: glext.h:7161
GLsizei levels
Definition: glext.h:7884
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define resource
Definition: kernel32.h:9
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid
static const WCHAR desc[]
Definition: protectdata.c:36
static int priority
Definition: timer.c:163
unsigned int UINT
Definition: ndis.h:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static FILE * out
Definition: regtests2xml.c:44
#define IDirect3DCubeTexture8_AddRef(p)
Definition: d3d8.h:616
#define IDirect3DSurface8_UnlockRect(p)
Definition: d3d8.h:319
#define IDirect3DVolumeTexture8_AddRef(p)
Definition: d3d8.h:780
#define IDirect3DVolume8_UnlockBox(p)
Definition: d3d8.h:232
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
#define IDirect3DTexture8_AddRef(p)
Definition: d3d8.h:698
#define IDirect3DSurface8_LockRect(p, a, b, c)
Definition: d3d8.h:318
#define IDirect3DVolume8_AddRef(p)
Definition: d3d8.h:222
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
#define IDirect3DVolume8_LockBox(p, a, b, c)
Definition: d3d8.h:231
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
Definition: scsiwmi.h:51
Definition: palette.c:468
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:182
unsigned int sub_resource_idx
Definition: d3d8_private.h:179
struct list rtv_entry
Definition: d3d8_private.h:180
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:226
IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface
Definition: d3d8_private.h:223
IDirect3DVolume8 IDirect3DVolume8_iface
Definition: d3d8_private.h:153
Definition: devices.h:37
Definition: send.c:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
enum wined3d_format_id format
Definition: wined3d.h:1766
enum wined3d_multisample_type multisample_type
Definition: wined3d.h:1767
#define max(a, b)
Definition: svc.c:63
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define WINAPI
Definition: msvc.h:6
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
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:701
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558
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
#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
#define E_NOINTERFACE
Definition: winerror.h:2364