22 #include "wine/port.h" 56 unsigned int i, primitive_size;
61 if (viewport->active_device !=
device)
63 WARN(
"Viewport %p active device is %p.\n",
64 viewport, viewport->active_device);
71 TRACE(
"ExecuteData :\n");
83 instr +=
sizeof(*current);
111 unsigned int index_pos =
buffer->index_pos, index_count;
123 index_count =
count * primitive_size;
125 if (
buffer->index_size < index_count)
127 unsigned int new_size =
max(
buffer->index_size * 2, index_count);
131 desc.byte_width = new_size *
sizeof(*indices);
137 desc.structure_byte_stride = 0;
143 buffer->index_size = new_size;
146 buffer->index_buffer = new_buffer;
149 else if (
buffer->index_size - index_count < index_pos)
154 box.left = index_pos *
sizeof(*indices);
155 box.right = (index_pos + index_count) *
sizeof(*
indices);
164 TRACE(
" v1: %d v2: %d v3: %d\n",ci->u1.
v1, ci->u2.
v2, ci->u3.
v3);
170 TRACE(
"EDGEENABLE1 ");
172 TRACE(
"EDGEENABLE2 ");
174 TRACE(
"EDGEENABLE3 ");
187 switch (primitive_size)
190 indices[(
i * primitive_size) + 2] = ci->u3.
v3;
193 indices[(
i * primitive_size) + 1] = ci->u2.
v2;
208 buffer->index_pos = index_pos + index_count;
230 ERR(
"Invalid matrix handle (a %#x -> %p, b %#x -> %p, c %#x -> %p).\n",
235 TRACE(
"dst %p, src1 %p, src2 %p.\n",
a,
b,
c);
253 ERR(
"Invalid matrix handle %#x.\n", ci->u2.
dwArg[0]);
279 WARN(
"Failed to set light state.\n");
293 WARN(
"Failed to set render state.\n");
307 TRACE(
" start %u, dest %u, count %u, flags %#x.\n",
313 if (!once++)
FIXME(
"D3DPROCESSVERTICES_UPDATEEXTENTS not implemented.\n");
316 FIXME(
"D3DPROCESSVERTICES_NOCOLOR not implemented.\n");
347 box.bottom =
box.back = 1;
355 FIXME(
"Unhandled vertex processing op %#x.\n",
op);
443 ERR(
"Unhandled OpCode %#x.\n",
current->bOpcode);
517 if (
buffer->dst_vertex_buffer)
564 TRACE(
"iface %p, desc %p.\n", iface,
desc);
571 TRACE(
" Returning description :\n");
588 TRACE(
"iface %p.\n", iface);
614 TRACE(
"iface %p, data %p.\n", iface,
data);
619 if (
buffer->vertex_size <
data->dwVertexCount)
621 unsigned int new_size =
max(
data->dwVertexCount,
buffer->vertex_size * 2);
630 desc.structure_byte_stride = 0;
647 if (
buffer->dst_vertex_buffer)
652 buffer->src_vertex_buffer = src_buffer;
653 buffer->dst_vertex_buffer = dst_buffer;
654 buffer->vertex_size = new_size;
655 buffer->src_vertex_pos = 0;
657 else if (
buffer->vertex_size -
data->dwVertexCount <
buffer->src_vertex_pos)
659 buffer->src_vertex_pos = 0;
662 if (
data->dwVertexCount)
701 TRACE(
"iface %p, data %p.\n", iface,
data);
708 TRACE(
"Returning data :\n");
731 TRACE(
"iface %p, offset %p, callback %p, context %p, reserved %#x.\n",
734 WARN(
"Not implemented.\n");
756 WARN(
"Not implemented.\n");
779 execute_buffer->
ref = 1;
799 ERR(
"Failed to allocate execute buffer data.\n");
static struct d3d_execute_buffer * impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
GLuint GLuint GLsizei GLenum const GLvoid * indices
void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value)
static HRESULT WINAPI d3d_execute_buffer_SetExecuteData(IDirect3DExecuteBuffer *iface, D3DEXECUTEDATA *data)
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc)
#define WINED3D_BIND_VERTEX_BUFFER
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
#define DDERR_UNSUPPORTED
static HRESULT WINAPI d3d_execute_buffer_Unlock(IDirect3DExecuteBuffer *iface)
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d_device *device, struct d3d_viewport *viewport)
#define WINED3DUSAGE_DYNAMIC
GLuint GLuint GLsizei count
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
WINE_DEFAULT_DEBUG_CHANNEL(ddraw)
void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration *declaration)
HRESULT(CALLBACK * LPD3DVALIDATECALLBACK)(void *ctx, DWORD offset)
static HRESULT WINAPI d3d_execute_buffer_Lock(IDirect3DExecuteBuffer *iface, D3DEXECUTEBUFFERDESC *desc)
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights) DECLSPEC_HIDDEN
#define WINED3D_RESOURCE_ACCESS_MAP_W
#define DDERR_OUTOFMEMORY
#define IDirect3DTexture2_Load(p, a)
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
D3DLIGHTSTATETYPE dlstLightStateType
#define WINED3D_RESOURCE_ACCESS_CPU
#define WINED3D_BIND_INDEX_BUFFER
#define IDirect3DDevice3_SetTransform(p, a, b)
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)
IDirect3DExecuteBuffer IDirect3DExecuteBuffer_iface
static const WCHAR desc[]
DWORD dwInstructionLength
#define WINED3DUSAGE_STATICDECL
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
struct _D3DTLVERTEX D3DTLVERTEX
static ULONG WINAPI d3d_execute_buffer_AddRef(IDirect3DExecuteBuffer *iface)
DWORD dwInstructionOffset
struct _D3DVERTEX D3DVERTEX
struct d3d_device * d3ddev
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
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)
static HRESULT WINAPI d3d_execute_buffer_Initialize(IDirect3DExecuteBuffer *iface, IDirect3DDevice *device, D3DEXECUTEBUFFERDESC *desc)
#define IDirect3DDevice3_SetRenderState(p, a, b)
#define WINED3D_MAP_DISCARD
GLboolean GLboolean GLboolean b
#define WINED3DUSAGE_WRITEONLY
static HRESULT WINAPI d3d_execute_buffer_GetExecuteData(IDirect3DExecuteBuffer *iface, D3DEXECUTEDATA *data)
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
#define WINED3D_RESOURCE_ACCESS_MAP_R
static HRESULT WINAPI d3d_execute_buffer_Optimize(IDirect3DExecuteBuffer *iface, DWORD reserved)
struct task_struct * current
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define D3DPROCESSVERTICES_UPDATEEXTENTS
#define D3DTRIFLAG_EDGEENABLE1
D3DMATRIXHANDLE hSrcMatrix1
#define InterlockedDecrement
#define WINED3D_MAP_WRITE
D3DTRANSFORMSTATETYPE dtstTransformStateType
D3DTEXTUREHANDLE hSrcTexture
#define memcpy(s1, s2, n)
#define D3DPROCESSVERTICES_COPY
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3D_MAP_NOOVERWRITE
#define D3DPROCESSVERTICES_NOCOLOR
#define D3DPROCESSVERTICES_TRANSFORMLIGHT
#define InterlockedIncrement
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
static HRESULT WINAPI d3d_execute_buffer_Validate(IDirect3DExecuteBuffer *iface, DWORD *offset, LPD3DVALIDATECALLBACK callback, void *context, DWORD reserved)
void multiply_matrix(D3DMATRIX *dst, const D3DMATRIX *src1, const D3DMATRIX *src2) DECLSPEC_HIDDEN
#define IDirect3DExecuteBuffer_AddRef(p)
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)
static void _dump_executedata(const D3DEXECUTEDATA *lpData)
#define IDirect3DDevice3_SetLightState(p, a, b)
D3DMATRIXHANDLE hSrcMatrix2
#define D3DPROCESSVERTICES_OPMASK
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
static IPrintDialogCallback callback
D3DTEXTUREHANDLE hDestTexture
D3DMATRIXHANDLE hDestMatrix
GLboolean GLboolean GLboolean GLboolean a
#define D3DPROCESSVERTICES_TRANSFORM
D3DEXECUTEBUFFERDESC desc
static const struct IDirect3DExecuteBufferVtbl d3d_execute_buffer_vtbl
D3DRENDERSTATETYPE drstRenderStateType
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define DDERR_INVALIDPARAMS
static HRESULT WINAPI d3d_execute_buffer_QueryInterface(IDirect3DExecuteBuffer *iface, REFIID iid, void **out)
static ULONG WINAPI d3d_execute_buffer_Release(IDirect3DExecuteBuffer *iface)
static BOOL heap_free(void *mem)
#define D3DTRIFLAG_EDGEENABLE2
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *This, DWORD fvf)
static void _dump_D3DEXECUTEBUFFERDESC(const D3DEXECUTEBUFFERDESC *lpDesc)