ReactOS  0.4.14-dev-1034-g1e60116
buffer.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 
24 static inline struct d3d8_vertexbuffer *impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface)
25 {
27 }
28 
29 static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *iface, REFIID riid, void **object)
30 {
31  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
32 
33  if (IsEqualGUID(riid, &IID_IDirect3DVertexBuffer8)
34  || IsEqualGUID(riid, &IID_IDirect3DResource8)
36  {
38  *object = iface;
39  return S_OK;
40  }
41 
42  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
43 
44  *object = NULL;
45  return E_NOINTERFACE;
46 }
47 
48 static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface)
49 {
51  ULONG refcount = InterlockedIncrement(&buffer->resource.refcount);
52 
53  TRACE("%p increasing refcount to %u.\n", iface, refcount);
54 
55  if (refcount == 1)
56  {
57  IDirect3DDevice8_AddRef(buffer->parent_device);
59  wined3d_buffer_incref(buffer->wined3d_buffer);
61  }
62 
63  return refcount;
64 }
65 
66 static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface)
67 {
69  ULONG refcount = InterlockedDecrement(&buffer->resource.refcount);
70 
71  TRACE("%p decreasing refcount to %u.\n", iface, refcount);
72 
73  if (!refcount)
74  {
75  IDirect3DDevice8 *device = buffer->parent_device;
76 
78  wined3d_buffer_decref(buffer->wined3d_buffer);
80 
81  /* Release the device last, as it may cause the device to be destroyed. */
83  }
84 
85  return refcount;
86 }
87 
88 static HRESULT WINAPI d3d8_vertexbuffer_GetDevice(IDirect3DVertexBuffer8 *iface,
89  IDirect3DDevice8 **device)
90 {
92 
93  TRACE("iface %p, device %p.\n", iface, device);
94 
95  *device = buffer->parent_device;
97 
98  TRACE("Returning device %p.\n", *device);
99 
100  return D3D_OK;
101 }
102 
103 static HRESULT WINAPI d3d8_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer8 *iface,
104  REFGUID guid, const void *data, DWORD data_size, DWORD flags)
105 {
107  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
108  iface, debugstr_guid(guid), data, data_size, flags);
109 
110  return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags);
111 }
112 
113 static HRESULT WINAPI d3d8_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer8 *iface,
114  REFGUID guid, void *data, DWORD *data_size)
115 {
117  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
118  iface, debugstr_guid(guid), data, data_size);
119 
120  return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size);
121 }
122 
123 static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid)
124 {
126  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
127 
128  return d3d8_resource_free_private_data(&buffer->resource, guid);
129 }
130 
131 static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority)
132 {
134  struct wined3d_resource *resource;
135  DWORD previous;
136 
137  TRACE("iface %p, priority %u.\n", iface, priority);
138 
140  resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
143 
144  return previous;
145 }
146 
147 static DWORD WINAPI d3d8_vertexbuffer_GetPriority(IDirect3DVertexBuffer8 *iface)
148 {
150  const struct wined3d_resource *resource;
151  DWORD priority;
152 
153  TRACE("iface %p.\n", iface);
154 
156  resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
159 
160  return priority;
161 }
162 
163 static void WINAPI d3d8_vertexbuffer_PreLoad(IDirect3DVertexBuffer8 *iface)
164 {
166 
167  TRACE("iface %p.\n", iface);
168 
172 }
173 
174 static D3DRESOURCETYPE WINAPI d3d8_vertexbuffer_GetType(IDirect3DVertexBuffer8 *iface)
175 {
176  TRACE("iface %p.\n", iface);
177 
178  return D3DRTYPE_VERTEXBUFFER;
179 }
180 
181 static HRESULT WINAPI d3d8_vertexbuffer_Lock(IDirect3DVertexBuffer8 *iface, UINT offset, UINT size,
182  BYTE **data, DWORD flags)
183 {
186  struct wined3d_box wined3d_box = {0};
187  HRESULT hr;
188 
189  TRACE("iface %p, offset %u, size %u, data %p, flags %#x.\n",
190  iface, offset, size, data, flags);
191 
199 
200  return hr;
201 }
202 
203 static HRESULT WINAPI d3d8_vertexbuffer_Unlock(IDirect3DVertexBuffer8 *iface)
204 {
206 
207  TRACE("iface %p.\n", iface);
208 
212 
213  return D3D_OK;
214 }
215 
216 static HRESULT WINAPI d3d8_vertexbuffer_GetDesc(IDirect3DVertexBuffer8 *iface,
218 {
220  struct wined3d_resource_desc wined3d_desc;
222 
223  TRACE("iface %p, desc %p.\n", iface, desc);
224 
229 
230  desc->Format = D3DFMT_VERTEXDATA;
231  desc->Type = D3DRTYPE_VERTEXBUFFER;
232  desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
233  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
234  desc->Size = wined3d_desc.size;
235  desc->FVF = buffer->fvf;
236 
237  return D3D_OK;
238 }
239 
240 static const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
241 {
242  /* IUnknown */
246  /* IDirect3DResource8 */
255  /* IDirect3DVertexBuffer8 */
259 };
260 
262 {
263  struct d3d8_vertexbuffer *buffer = parent;
264  d3d8_resource_cleanup(&buffer->resource);
265  heap_free(buffer);
266 }
267 
269 {
271 };
272 
275 {
276  struct wined3d_buffer_desc desc;
277  HRESULT hr;
278 
279  if (pool == D3DPOOL_SCRATCH)
280  {
281  WARN("Vertex buffer with D3DPOOL_SCRATCH requested.\n");
282  return D3DERR_INVALIDCALL;
283  }
284 
285  buffer->IDirect3DVertexBuffer8_iface.lpVtbl = &Direct3DVertexBuffer8_Vtbl;
286  d3d8_resource_init(&buffer->resource);
287  buffer->fvf = fvf;
288 
289  desc.byte_width = size;
290  desc.usage = usage & WINED3DUSAGE_MASK;
291  desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
294  desc.misc_flags = 0;
295  desc.structure_byte_stride = 0;
296 
298  hr = wined3d_buffer_create(device->wined3d_device, &desc, NULL, buffer,
299  &d3d8_vertexbuffer_wined3d_parent_ops, &buffer->wined3d_buffer);
301  if (FAILED(hr))
302  {
303  WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
304  return hr;
305  }
306 
307  buffer->parent_device = &device->IDirect3DDevice8_iface;
308  IDirect3DDevice8_AddRef(buffer->parent_device);
309 
310  return D3D_OK;
311 }
312 
313 struct d3d8_vertexbuffer *unsafe_impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface)
314 {
315  if (!iface)
316  return NULL;
317  assert(iface->lpVtbl == &Direct3DVertexBuffer8_Vtbl);
318 
319  return impl_from_IDirect3DVertexBuffer8(iface);
320 }
321 
322 static inline struct d3d8_indexbuffer *impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
323 {
325 }
326 
327 static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *iface, REFIID riid, void **object)
328 {
329  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
330 
331  if (IsEqualGUID(riid, &IID_IDirect3DIndexBuffer8)
332  || IsEqualGUID(riid, &IID_IDirect3DResource8)
334  {
336  *object = iface;
337  return S_OK;
338  }
339 
340  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
341 
342  *object = NULL;
343  return E_NOINTERFACE;
344 }
345 
346 static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
347 {
349  ULONG refcount = InterlockedIncrement(&buffer->resource.refcount);
350 
351  TRACE("%p increasing refcount to %u.\n", iface, refcount);
352 
353  if (refcount == 1)
354  {
355  IDirect3DDevice8_AddRef(buffer->parent_device);
357  wined3d_buffer_incref(buffer->wined3d_buffer);
359  }
360 
361  return refcount;
362 }
363 
364 static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
365 {
367  ULONG refcount = InterlockedDecrement(&buffer->resource.refcount);
368 
369  TRACE("%p decreasing refcount to %u.\n", iface, refcount);
370 
371  if (!refcount)
372  {
373  IDirect3DDevice8 *device = buffer->parent_device;
374 
376  wined3d_buffer_decref(buffer->wined3d_buffer);
378 
379  /* Release the device last, as it may cause the device to be destroyed. */
381  }
382 
383  return refcount;
384 }
385 
386 static HRESULT WINAPI d3d8_indexbuffer_GetDevice(IDirect3DIndexBuffer8 *iface,
387  IDirect3DDevice8 **device)
388 {
390 
391  TRACE("iface %p, device %p.\n", iface, device);
392 
393  *device = buffer->parent_device;
395 
396  TRACE("Returning device %p.\n", *device);
397 
398  return D3D_OK;
399 }
400 
401 static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *iface,
402  REFGUID guid, const void *data, DWORD data_size, DWORD flags)
403 {
405  TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
406  iface, debugstr_guid(guid), data, data_size, flags);
407 
408  return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags);
409 }
410 
411 static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *iface,
412  REFGUID guid, void *data, DWORD *data_size)
413 {
415  TRACE("iface %p, guid %s, data %p, data_size %p.\n",
416  iface, debugstr_guid(guid), data, data_size);
417 
418  return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size);
419 }
420 
421 static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid)
422 {
424  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
425 
426  return d3d8_resource_free_private_data(&buffer->resource, guid);
427 }
428 
429 static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority)
430 {
432  struct wined3d_resource *resource;
433  DWORD previous;
434 
435  TRACE("iface %p, priority %u.\n", iface, priority);
436 
438  resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
441 
442  return previous;
443 }
444 
445 static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface)
446 {
448  const struct wined3d_resource *resource;
449  DWORD priority;
450 
451  TRACE("iface %p.\n", iface);
452 
454  resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
457 
458  return priority;
459 }
460 
461 static void WINAPI d3d8_indexbuffer_PreLoad(IDirect3DIndexBuffer8 *iface)
462 {
464 
465  TRACE("iface %p.\n", iface);
466 
470 }
471 
472 static D3DRESOURCETYPE WINAPI d3d8_indexbuffer_GetType(IDirect3DIndexBuffer8 *iface)
473 {
474  TRACE("iface %p.\n", iface);
475 
476  return D3DRTYPE_INDEXBUFFER;
477 }
478 
479 static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface, UINT offset, UINT size,
480  BYTE **data, DWORD flags)
481 {
484  struct wined3d_box wined3d_box = {0};
485  HRESULT hr;
486 
487  TRACE("iface %p, offset %u, size %u, data %p, flags %#x.\n",
488  iface, offset, size, data, flags);
489 
497 
498  return hr;
499 }
500 
501 static HRESULT WINAPI d3d8_indexbuffer_Unlock(IDirect3DIndexBuffer8 *iface)
502 {
504 
505  TRACE("iface %p.\n", iface);
506 
510 
511  return D3D_OK;
512 }
513 
514 static HRESULT WINAPI d3d8_indexbuffer_GetDesc(IDirect3DIndexBuffer8 *iface,
516 {
518  struct wined3d_resource_desc wined3d_desc;
520 
521  TRACE("iface %p, desc %p.\n", iface, desc);
522 
527 
528  desc->Format = d3dformat_from_wined3dformat(buffer->format);
529  desc->Type = D3DRTYPE_INDEXBUFFER;
530  desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
531  desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
532  desc->Size = wined3d_desc.size;
533 
534  return D3D_OK;
535 }
536 
537 static const IDirect3DIndexBuffer8Vtbl d3d8_indexbuffer_vtbl =
538 {
539  /* IUnknown */
543  /* IDirect3DResource8 */
552  /* IDirect3DIndexBuffer8 */
556 };
557 
559 {
560  struct d3d8_indexbuffer *buffer = parent;
561  d3d8_resource_cleanup(&buffer->resource);
562  heap_free(buffer);
563 }
564 
566 {
568 };
569 
572 {
573  struct wined3d_buffer_desc desc;
574  HRESULT hr;
575 
576  desc.byte_width = size;
578  if (pool == D3DPOOL_SCRATCH)
579  desc.usage |= WINED3DUSAGE_SCRATCH;
580  desc.bind_flags = WINED3D_BIND_INDEX_BUFFER;
583  desc.misc_flags = 0;
584  desc.structure_byte_stride = 0;
585 
586  buffer->IDirect3DIndexBuffer8_iface.lpVtbl = &d3d8_indexbuffer_vtbl;
587  d3d8_resource_init(&buffer->resource);
589 
591  hr = wined3d_buffer_create(device->wined3d_device, &desc, NULL, buffer,
592  &d3d8_indexbuffer_wined3d_parent_ops, &buffer->wined3d_buffer);
594  if (FAILED(hr))
595  {
596  WARN("Failed to create wined3d buffer, hr %#x.\n", hr);
597  return hr;
598  }
599 
600  buffer->parent_device = &device->IDirect3DDevice8_iface;
601  IDirect3DDevice8_AddRef(buffer->parent_device);
602 
603  return D3D_OK;
604 }
605 
606 struct d3d8_indexbuffer *unsafe_impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
607 {
608  if (!iface)
609  return NULL;
610  assert(iface->lpVtbl == &d3d8_indexbuffer_vtbl);
611 
612  return impl_from_IDirect3DIndexBuffer8(iface);
613 }
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
#define IDirect3DVertexBuffer8_AddRef(p)
Definition: d3d8.h:417
static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *iface, REFIID riid, void **object)
Definition: buffer.c:29
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
Definition: resource.c:263
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
UINT left
Definition: wined3d.h:1839
HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid)
Definition: d3d8_main.c:135
static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface, UINT offset, UINT size, BYTE **data, DWORD flags)
Definition: buffer.c:479
HRESULT hr
Definition: shlfolder.c:183
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:890
Definition: scsiwmi.h:51
static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:364
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
static HRESULT WINAPI d3d8_vertexbuffer_GetDevice(IDirect3DVertexBuffer8 *iface, IDirect3DDevice8 **device)
Definition: buffer.c:88
IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface
Definition: d3d8_private.h:197
REFIID riid
Definition: precomp.h:44
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:279
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:295
#define WARN(fmt,...)
Definition: debug.h:111
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
GLintptr offset
Definition: glext.h:5920
static void STDMETHODCALLTYPE d3d8_vertexbuffer_wined3d_object_destroyed(void *parent)
Definition: buffer.c:261
enum _D3DPOOL D3DPOOL
#define D3DERR_INVALIDCALL
#define assert(x)
Definition: debug.h:53
GLuint buffer
Definition: glext.h:5915
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
int resource
Definition: rdpsnd_sgi.c:44
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static const struct wined3d_parent_ops d3d8_indexbuffer_wined3d_parent_ops
Definition: buffer.c:565
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482
static HRESULT WINAPI d3d8_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: buffer.c:113
static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:346
IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface
Definition: d3d8_private.h:210
ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
Definition: buffer.c:525
static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority)
Definition: buffer.c:429
struct d3d8_indexbuffer * unsafe_impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:606
static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: buffer.c:411
const GUID * guid
void d3d8_resource_cleanup(struct d3d8_resource *resource)
Definition: d3d8_main.c:130
static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: buffer.c:401
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:891
static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid)
Definition: buffer.c:421
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
Definition: resource.c:344
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:920
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: buffer.c:570
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
Definition: buffer.c:273
static D3DRESOURCETYPE WINAPI d3d8_indexbuffer_GetType(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:472
smooth NULL
Definition: ftsmooth.c:416
static const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl
Definition: buffer.c:240
static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:445
enum _D3DFORMAT D3DFORMAT
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static void WINAPI d3d8_indexbuffer_PreLoad(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:461
UINT right
Definition: wined3d.h:1841
static HRESULT WINAPI d3d8_indexbuffer_GetDesc(IDirect3DIndexBuffer8 *iface, D3DINDEXBUFFER_DESC *desc)
Definition: buffer.c:514
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static HRESULT WINAPI d3d8_vertexbuffer_Unlock(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:203
r parent
Definition: btrfs.c:2869
static HRESULT WINAPI d3d8_vertexbuffer_GetDesc(IDirect3DVertexBuffer8 *iface, D3DVERTEXBUFFER_DESC *desc)
Definition: buffer.c:216
static struct d3d8_vertexbuffer * impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:24
LONG HRESULT
Definition: typedefs.h:78
static const IDirect3DIndexBuffer8Vtbl d3d8_indexbuffer_vtbl
Definition: buffer.c:537
const GUID IID_IUnknown
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:791
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void d3d8_resource_init(struct d3d8_resource *resource)
Definition: d3d8_main.c:191
GLbitfield flags
Definition: glext.h:7161
#define InterlockedDecrement
Definition: armddk.h:52
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
unsigned int size
Definition: wined3d.h:1761
unsigned char BYTE
Definition: mem.h:68
static DWORD WINAPI d3d8_vertexbuffer_GetPriority(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:147
unsigned int usage
Definition: wined3d.h:1756
static void WINAPI d3d8_vertexbuffer_PreLoad(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:163
static struct d3d8_indexbuffer * impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:322
static HRESULT WINAPI d3d8_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: buffer.c:103
#define S_OK
Definition: intsafe.h:59
#define D3D_OK
Definition: d3d.h:106
#define InterlockedIncrement
Definition: armddk.h:53
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
static HRESULT WINAPI d3d8_indexbuffer_Unlock(IDirect3DIndexBuffer8 *iface)
Definition: buffer.c:501
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
#define IDirect3DDevice8_AddRef(p)
Definition: d3d8.h:947
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
static HRESULT WINAPI d3d8_vertexbuffer_Lock(IDirect3DVertexBuffer8 *iface, UINT offset, UINT size, BYTE **data, DWORD flags)
Definition: buffer.c:181
static void STDMETHODCALLTYPE d3d8_indexbuffer_wined3d_object_destroyed(void *parent)
Definition: buffer.c:558
static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:48
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags) DECLSPEC_HIDDEN
Definition: device.c:144
#define IDirect3DDevice8_Release(p)
Definition: d3d8.h:948
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define IDirect3DIndexBuffer8_AddRef(p)
Definition: d3d8.h:481
static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid)
Definition: buffer.c:123
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
Definition: buffer.c:1436
static const struct wined3d_parent_ops d3d8_vertexbuffer_wined3d_parent_ops
Definition: buffer.c:268
unsigned int ULONG
Definition: retypes.h:1
static int priority
Definition: timer.c:163
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *iface, REFIID riid, void **object)
Definition: buffer.c:327
unsigned int access
Definition: wined3d.h:1757
WINE_DEFAULT_DEBUG_CHANNEL(d3d8)
static D3DRESOURCETYPE WINAPI d3d8_vertexbuffer_GetType(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:174
static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority)
Definition: buffer.c:131
HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d8_main.c:153
enum _D3DRESOURCETYPE D3DRESOURCETYPE
struct d3d8_vertexbuffer * unsafe_impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:313
static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface)
Definition: buffer.c:66
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static HRESULT WINAPI d3d8_indexbuffer_GetDevice(IDirect3DIndexBuffer8 *iface, IDirect3DDevice8 **device)
Definition: buffer.c:386