ReactOS 0.4.17-dev-966-gf06eace
vertexbuffer.c
Go to the documentation of this file.
1/* Direct3D Vertex Buffer
2 * Copyright (c) 2002 Lionel ULMER
3 * Copyright (c) 2006 Stefan DÖSINGER
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include "ddraw_private.h"
21
23
24static inline struct d3d_vertex_buffer *impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
25{
27}
28
29/*****************************************************************************
30 * IUnknown Methods
31 *****************************************************************************/
32
33static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 *iface, REFIID riid, void **obj)
34{
36
37 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), obj);
38
39 *obj = NULL;
40
42 {
44 *obj = iface;
45 return S_OK;
46 }
47 if (IsEqualGUID(&IID_IDirect3DVertexBuffer7, riid) && buffer->version == 7)
48 {
50 *obj = iface;
51 return S_OK;
52 }
53 if (IsEqualGUID(&IID_IDirect3DVertexBuffer, riid) && buffer->version == 3)
54 {
56 *obj = iface;
57 return S_OK;
58 }
59
60 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
61 return E_NOINTERFACE;
62}
63
64static ULONG WINAPI d3d_vertex_buffer7_AddRef(IDirect3DVertexBuffer7 *iface)
65{
68
69 TRACE("%p increasing refcount to %lu.\n", buffer, ref);
70
71 return ref;
72}
73
74static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
75{
78 struct d3d_device *device;
79
80 TRACE("%p decreasing refcount to %lu.\n", buffer, ref);
81
82 if (!ref)
83 {
84 /* D3D7 vertex buffers don't stay bound in the device, they are passed
85 * as a parameter to DrawPrimitiveVB. DrawPrimitiveVB sets them as the
86 * stream source in wined3d and they should get unset there before
87 * they are destroyed. */
89
90 LIST_FOR_EACH_ENTRY(device, &buffer->ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
91 {
92 if (device->stateblock_state->streams[0].buffer == buffer->wined3d_buffer)
94 }
95
96 wined3d_vertex_declaration_decref(buffer->wined3d_declaration);
97 wined3d_buffer_decref(buffer->wined3d_buffer);
99
100 if (buffer->version == 7)
101 IDirectDraw7_Release(&buffer->ddraw->IDirectDraw7_iface);
102
103 free(buffer);
104 }
105
106 return ref;
107}
108
109/*****************************************************************************
110 * IDirect3DVertexBuffer Methods
111 *****************************************************************************/
112
115{
117
118 desc.byte_width = buffer->size;
120 if (dynamic)
121 desc.usage |= WINED3DUSAGE_DYNAMIC;
122 desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
123 if (buffer->sysmem)
125 else
127 desc.misc_flags = 0;
128 desc.structure_byte_stride = 0;
129
130 return wined3d_buffer_create(buffer->ddraw->wined3d_device, &desc,
132}
133
134/*****************************************************************************
135 * IDirect3DVertexBuffer7::Lock
136 *
137 * Locks the vertex buffer and returns a pointer to the vertex data
138 * Locking vertex buffers is similar to locking surfaces, because Windows
139 * uses surfaces to store vertex data internally (According to the DX sdk)
140 *
141 * Params:
142 * Flags: Locking flags. Relevant here are DDLOCK_READONLY, DDLOCK_WRITEONLY,
143 * DDLOCK_DISCARDCONTENTS and DDLOCK_NOOVERWRITE.
144 * Data: Returns a pointer to the vertex data
145 * Size: Returns the size of the buffer if not NULL
146 *
147 * Returns:
148 * D3D_OK on success
149 * DDERR_INVALIDPARAMS if Data is NULL
150 * D3DERR_VERTEXBUFFEROPTIMIZED if called on an optimized buffer(WineD3D)
151 *
152 *****************************************************************************/
153static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
154 DWORD flags, void **data, DWORD *data_size)
155{
157 struct wined3d_resource_desc wined3d_desc;
160 HRESULT hr;
161
162 TRACE("iface %p, flags %#lx, data %p, data_size %p.\n", iface, flags, data, data_size);
163
164 if (buffer->version != 7)
166
167 if (buffer->discarded)
168 flags &= ~DDLOCK_DISCARDCONTENTS;
169
170 if (!(flags & DDLOCK_WAIT))
173 {
174 buffer->discarded = true;
175 if (!buffer->dynamic)
176 {
177 struct wined3d_buffer *new_buffer;
180 if (SUCCEEDED(hr))
181 {
182 buffer->dynamic = TRUE;
183 wined3d_buffer_decref(buffer->wined3d_buffer);
184 buffer->wined3d_buffer = new_buffer;
185 }
186 else
187 {
188 WARN("Failed to create a dynamic buffer\n");
189 }
191 }
192 }
193
195 if (data_size)
196 {
197 /* Get the size, for returning it, and for locking */
200 *data_size = wined3d_desc.size;
201 }
202
206
208
209 return hr;
210}
211
212/*****************************************************************************
213 * IDirect3DVertexBuffer7::Unlock
214 *
215 * Unlocks a vertex Buffer
216 *
217 * Returns:
218 * D3D_OK on success
219 *
220 *****************************************************************************/
221static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface)
222{
224
225 TRACE("iface %p.\n", iface);
227 return D3D_OK;
228}
229
230/*****************************************************************************
231 * IDirect3DVertexBuffer7::ProcessVertices
232 *
233 * Processes untransformed Vertices into a transformed or optimized vertex
234 * buffer. It can also perform other operations, such as lighting or clipping
235 *
236 * Params
237 * VertexOp: Operation(s) to perform: D3DVOP_CLIP, _EXTENTS, _LIGHT, _TRANSFORM
238 * DestIndex: Index in the destination buffer(This), where the vertices are
239 * placed
240 * Count: Number of Vertices in the Source buffer to process
241 * SrcBuffer: Source vertex buffer
242 * SrcIndex: Index of the first vertex in the src buffer to process
243 * D3DDevice: Device to use for transformation
244 * Flags: 0 for default, D3DPV_DONOTCOPYDATA to prevent copying
245 * unchanged vertices
246 *
247 * Returns:
248 * D3D_OK on success
249 * DDERR_INVALIDPARAMS If D3DVOP_TRANSFORM wasn't passed
250 *
251 *****************************************************************************/
252static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7 *iface,
253 DWORD vertex_op, DWORD dst_idx, DWORD count, IDirect3DVertexBuffer7 *src_buffer,
254 DWORD src_idx, IDirect3DDevice7 *device, DWORD flags)
255{
256 struct d3d_vertex_buffer *dst_buffer_impl = impl_from_IDirect3DVertexBuffer7(iface);
257 struct d3d_vertex_buffer *src_buffer_impl = unsafe_impl_from_IDirect3DVertexBuffer7(src_buffer);
258 struct d3d_device *device_impl = dst_buffer_impl->version == 7
260 : unsafe_impl_from_IDirect3DDevice3((IDirect3DDevice3 *)device);
261 BOOL old_clip, do_clip, old_lighting, do_lighting;
262 const struct wined3d_stateblock_state *state;
263 HRESULT hr;
264
265 TRACE("iface %p, vertex_op %#lx, dst_idx %lu, count %lu, src_buffer %p, src_idx %lu, device %p, flags %#lx.\n",
266 iface, vertex_op, dst_idx, count, src_buffer, src_idx, device, flags);
267
268 /* Vertex operations:
269 * D3DVOP_CLIP: Clips vertices outside the viewing frustrum. Needs clipping information
270 * in the vertex buffer (Buffer may not be created with D3DVBCAPS_DONOTCLIP)
271 * D3DVOP_EXTENTS: Causes the screen extents to be updated when rendering the vertices
272 * D3DVOP_LIGHT: Lights the vertices
273 * D3DVOP_TRANSFORM: Transform the vertices. This flag is necessary
274 *
275 * WineD3D only transforms and clips the vertices by now, so EXTENTS and LIGHT
276 * are not implemented. Clipping is disabled ATM, because of unsure conditions.
277 */
278 if (!(vertex_op & D3DVOP_TRANSFORM))
279 return DDERR_INVALIDPARAMS;
280
282
283 state = device_impl->stateblock_state;
284
285 /* WineD3D doesn't know d3d7 vertex operation, it uses
286 * render states instead. Set the render states according to
287 * the vertex ops
288 */
289 do_clip = !!(vertex_op & D3DVOP_CLIP);
290 old_clip = !!state->rs[WINED3D_RS_CLIPPING];
291 if (do_clip != old_clip)
293
294 old_lighting = !!state->rs[WINED3D_RS_LIGHTING];
295 if (dst_buffer_impl->version == 3)
296 do_lighting = device_impl->material && (src_buffer_impl->fvf & D3DFVF_NORMAL)
297 && (vertex_op & D3DVOP_LIGHT);
298 else
299 do_lighting = old_lighting && (vertex_op & D3DVOP_LIGHT);
300
301 if (do_lighting != old_lighting)
303
305 0, src_buffer_impl->wined3d_buffer, 0, get_flexible_vertex_size(src_buffer_impl->fvf));
307 hr = wined3d_device_process_vertices(device_impl->wined3d_device, device_impl->state, src_idx, dst_idx,
308 count, dst_buffer_impl->wined3d_buffer, NULL, flags, dst_buffer_impl->fvf);
309
310 /* Restore the states if needed */
311 if (do_clip != old_clip)
313 if (do_lighting != old_lighting)
315
317
318 return hr;
319}
320
321/*****************************************************************************
322 * IDirect3DVertexBuffer7::GetVertexBufferDesc
323 *
324 * Returns the description of a vertex buffer
325 *
326 * Params:
327 * Desc: Address to write the description to
328 *
329 * Returns
330 * DDERR_INVALIDPARAMS if Desc is NULL
331 * D3D_OK on success
332 *
333 *****************************************************************************/
335{
337 struct wined3d_resource_desc wined3d_desc;
339
340 TRACE("iface %p, desc %p.\n", iface, desc);
341
342 if (!desc) return DDERR_INVALIDPARAMS;
343
348
349 /* Now fill the desc structure */
350 desc->dwCaps = buffer->Caps;
351 desc->dwFVF = buffer->fvf;
352 desc->dwNumVertices = wined3d_desc.size / get_flexible_vertex_size(buffer->fvf);
353
354 return D3D_OK;
355}
356
357/*****************************************************************************
358 * IDirect3DVertexBuffer7::Optimize
359 *
360 * Converts an unoptimized vertex buffer into an optimized buffer
361 *
362 * Params:
363 * D3DDevice: Device for which this buffer is optimized
364 * Flags: Not used, should be set to 0
365 *
366 * Returns
367 * D3D_OK, because it's a stub
368 *
369 *****************************************************************************/
370static HRESULT WINAPI d3d_vertex_buffer7_Optimize(IDirect3DVertexBuffer7 *iface,
371 IDirect3DDevice7 *device, DWORD flags)
372{
374 static BOOL hide = FALSE;
375
376 TRACE("iface %p, device %p, flags %#lx.\n", iface, device, flags);
377
378 if (!hide)
379 {
380 FIXME("iface %p, device %p, flags %#lx stub!\n", iface, device, flags);
381 hide = TRUE;
382 }
383
384 /* We could forward this call to WineD3D and take advantage
385 * of it once we use OpenGL vertex buffers
386 */
390
391 return DD_OK;
392}
393
394/*****************************************************************************
395 * IDirect3DVertexBuffer7::ProcessVerticesStrided
396 *
397 * This method processes untransformed strided vertices into a processed
398 * or optimized vertex buffer.
399 *
400 * For more details on the parameters, see
401 * IDirect3DVertexBuffer7::ProcessVertices
402 *
403 * Params:
404 * VertexOp: Operations to perform
405 * DestIndex: Destination index to write the vertices to
406 * Count: Number of input vertices
407 * StrideData: Array containing the input vertices
408 * VertexTypeDesc: Vertex Description or source index?????????
409 * D3DDevice: IDirect3DDevice7 to use for processing
410 * Flags: Can be D3DPV_DONOTCOPYDATA to avoid copying unmodified vertices
411 *
412 * Returns
413 * D3D_OK on success, or DDERR_*
414 *
415 *****************************************************************************/
416static HRESULT WINAPI d3d_vertex_buffer7_ProcessVerticesStrided(IDirect3DVertexBuffer7 *iface,
418 DWORD fvf, IDirect3DDevice7 *device, DWORD flags)
419{
420 FIXME("iface %p, vertex_op %#lx, dst_idx %lu, count %lu, data %p, fvf %#lx, device %p, flags %#lx stub!\n",
421 iface, vertex_op, dst_idx, count, data, fvf, device, flags);
422
423 return DD_OK;
424}
425
426/*****************************************************************************
427 * The VTables
428 *****************************************************************************/
429
430static const struct IDirect3DVertexBuffer7Vtbl d3d_vertex_buffer7_vtbl =
431{
441};
442
445{
447 HRESULT hr = D3D_OK;
448
449 TRACE("Vertex buffer description:\n");
450 TRACE(" dwSize %lu\n", desc->dwSize);
451 TRACE(" dwCaps %#lx\n", desc->dwCaps);
452 TRACE(" FVF %#lx\n", desc->dwFVF);
453 TRACE(" dwNumVertices %lu\n", desc->dwNumVertices);
454
455 if (!(buffer = calloc(1, sizeof(*buffer))))
456 return DDERR_OUTOFMEMORY;
457
458 buffer->IDirect3DVertexBuffer7_iface.lpVtbl = &d3d_vertex_buffer7_vtbl;
459 buffer->ref = 1;
460 buffer->version = ddraw->d3dversion;
461 if (buffer->version == 7)
462 IDirectDraw7_AddRef(&ddraw->IDirectDraw7_iface);
463 buffer->ddraw = ddraw;
464 buffer->Caps = desc->dwCaps;
465 buffer->fvf = desc->dwFVF;
466 buffer->size = get_flexible_vertex_size(desc->dwFVF) * desc->dwNumVertices;
467
468 /* ddraw4 vertex buffers ignore DISCARD and NOOVERWRITE, even on
469 * pretransformed geometry, which means that a GPU-based buffer cannot
470 * perform well.
471 *
472 * While at least one contemporaneous card (Geforce 4) does seem to show a
473 * difference in its performance characteristics based on whether
474 * D3DVBCAPS_SYSTEMMEMORY is set, it also doesn't *improve* performance to
475 * use a non-SYSTEMMEMORY buffer with ddraw4. For wined3d it should always
476 * be better to use sysmem.
477 *
478 * This improves performance in Prince of Persia 3D. */
479 buffer->sysmem = ((buffer->Caps & D3DVBCAPS_SYSTEMMEMORY) || buffer->version < 7);
480
482
484 {
485 WARN("Failed to create wined3d vertex buffer, hr %#lx.\n", hr);
488 goto end;
489 }
490
491 if (!(buffer->wined3d_declaration = ddraw_find_decl(ddraw, desc->dwFVF)))
492 {
493 ERR("Failed to find vertex declaration for fvf %#lx.\n", desc->dwFVF);
494 wined3d_buffer_decref(buffer->wined3d_buffer);
496 goto end;
497 }
498 wined3d_vertex_declaration_incref(buffer->wined3d_declaration);
499
500end:
502 if (hr == D3D_OK)
503 *vertex_buf = buffer;
504 else
505 free(buffer);
506
507 return hr;
508}
509
510struct d3d_vertex_buffer *unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
511{
512 if (!iface)
513 return NULL;
514 assert(iface->lpVtbl == &d3d_vertex_buffer7_vtbl);
515
517}
static int state
Definition: maze.c:121
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DVertexBuffer7_AddRef(p)
Definition: d3d.h:1514
#define D3DVOP_CLIP
Definition: d3dtypes.h:1287
#define D3DVBCAPS_OPTIMIZED
Definition: d3dtypes.h:1282
#define D3DVOP_TRANSFORM
Definition: d3dtypes.h:1286
#define D3DVOP_LIGHT
Definition: d3dtypes.h:1285
#define D3DVBCAPS_SYSTEMMEMORY
Definition: d3dtypes.h:1280
struct d3d_device * unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)
Definition: device.c:6789
unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags)
Definition: utils.c:561
struct d3d_device * unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: device.c:6796
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType)
Definition: utils.c:915
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *This, DWORD fvf)
Definition: ddraw.c:4917
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
Definition: ddraw.c:82
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:1329
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:459
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:520
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, struct wined3d_stateblock *stateblock, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, uint32_t flags, uint32_t dst_fvf)
Definition: device.c:3598
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:304
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:280
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, uint32_t flags)
Definition: resource.c:295
#define assert(_expr)
Definition: assert.h:32
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
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 debugstr_guid
Definition: kernel32.h:35
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:113
#define DDLOCK_DONOTWAIT
Definition: ddraw.h:632
#define DD_OK
Definition: ddraw.h:188
#define DDLOCK_DISCARDCONTENTS
Definition: ddraw.h:630
#define DDLOCK_NOOVERWRITE
Definition: ddraw.h:629
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:81
#define DDLOCK_WAIT
Definition: ddraw.h:624
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define TRACE(s)
Definition: solgame.cpp:4
struct d3d_device_context_state * state
struct list ddraw_entry
DWORD material
struct wined3d_device * wined3d_device
const struct wined3d_stateblock_state * stateblock_state
struct wined3d_vertex_declaration * wined3d_declaration
struct ddraw * ddraw
struct wined3d_buffer * wined3d_buffer
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface
unsigned int version
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:83
int d3dversion
Definition: devices.h:37
Definition: send.c:48
unsigned int size
Definition: wined3d.h:1801
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:221
static HRESULT WINAPI d3d_vertex_buffer7_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface, D3DVERTEXBUFFERDESC *desc)
Definition: vertexbuffer.c:334
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **vertex_buf, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc)
Definition: vertexbuffer.c:443
static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 *iface, REFIID riid, void **obj)
Definition: vertexbuffer.c:33
static HRESULT WINAPI d3d_vertex_buffer7_ProcessVerticesStrided(IDirect3DVertexBuffer7 *iface, DWORD vertex_op, DWORD dst_idx, DWORD count, D3DDRAWPRIMITIVESTRIDEDDATA *data, DWORD fvf, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:416
static HRESULT d3d_vertex_buffer_create_wined3d_buffer(struct d3d_vertex_buffer *buffer, BOOL dynamic, struct wined3d_buffer **wined3d_buffer)
Definition: vertexbuffer.c:113
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:510
static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7 *iface, DWORD vertex_op, DWORD dst_idx, DWORD count, IDirect3DVertexBuffer7 *src_buffer, DWORD src_idx, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:252
static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:74
static ULONG WINAPI d3d_vertex_buffer7_AddRef(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:64
static const struct IDirect3DVertexBuffer7Vtbl d3d_vertex_buffer7_vtbl
Definition: vertexbuffer.c:430
static HRESULT WINAPI d3d_vertex_buffer7_Optimize(IDirect3DVertexBuffer7 *iface, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:370
static struct d3d_vertex_buffer * impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:24
static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface, DWORD flags, void **data, DWORD *data_size)
Definition: vertexbuffer.c:153
#define WINAPI
Definition: msvc.h:6
void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, struct wined3d_vertex_declaration *declaration)
Definition: stateblock.c:1571
void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, enum wined3d_render_state state, unsigned int value)
Definition: stateblock.c:1623
HRESULT CDECL wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: stateblock.c:1939
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
@ WINED3D_RS_LIGHTING
Definition: wined3d.h:347
@ WINED3D_RS_CLIPPING
Definition: wined3d.h:346
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:909
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:51
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:52
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
Definition: wined3d.h:939
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:53
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:924
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:936
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:54
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539
#define E_NOINTERFACE
Definition: winerror.h:3479