63 unsigned int idx, idx2;
67 BOOL has_blend_idx = has_blend &&
78 DWORD texcoords = (
fvf & 0xFFFF0000) >> 16;
85 if (has_blend_idx) num_blends--;
88 size = has_pos + (has_blend && num_blends > 0) + has_blend_idx + has_normal +
89 has_psize + has_diffuse + has_specular + num_textures + 1;
113 if (has_blend && (num_blends > 0)) {
123 ERR(
"Unexpected amount of blend values: %u\n", num_blends);
166 for (idx2 = 0; idx2 < num_textures; idx2++) {
167 unsigned int numcoords = (texcoords >> (idx2*2)) & 0x03;
329 TRACE(
"d3d9_elements %p, wined3d_elements %p, element_count %p\n", d3d9_elements, wined3d_elements, element_count);
339 if (!(*wined3d_elements =
heap_alloc(
count *
sizeof(**wined3d_elements))))
341 FIXME(
"Memory allocation failed\n");
349 WARN(
"Invalid element type %#x.\n", d3d9_elements[
i].
Type);
354 (*wined3d_elements)[
i].input_slot = d3d9_elements[
i].
Stream;
355 (*wined3d_elements)[
i].offset = d3d9_elements[
i].
Offset;
358 (*wined3d_elements)[
i].instance_data_step_rate = 0;
359 (*wined3d_elements)[
i].method = d3d9_elements[
i].
Method;
360 (*wined3d_elements)[
i].usage = d3d9_elements[
i].
Usage;
361 (*wined3d_elements)[
i].usage_idx = d3d9_elements[
i].
UsageIndex;
364 *element_count =
count;
373 UINT wined3d_element_count;
380 WARN(
"Failed to create wined3d vertex declaration elements, hr %#x.\n",
hr);
387 element_count = wined3d_element_count + 1;
391 ERR(
"Failed to allocate vertex declaration elements memory.\n");
405 WARN(
"Failed to create wined3d vertex declaration, hr %#x.\n",
hr);
421 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
427 WARN(
"Failed to initialize vertex declaration, hr %#x.\n",
hr);
432 TRACE(
"Created vertex declaration %p.\n",
object);
IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9_iface
static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaration, struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements)
#define D3DFVF_LASTBETA_UBYTE4
coclass MSXML2::XSLTemplate40 object
GLuint GLuint GLsizei count
void WINAPI wined3d_mutex_lock(void)
HRESULT CDECL wined3d_vertex_declaration_create(struct wined3d_device *device, const struct wined3d_vertex_element *elements, UINT element_count, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration)
#define IDirect3DDevice9Ex_Release(p)
struct d3d9_vertex_declaration * unsafe_impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
static ULONG WINAPI d3d9_vertex_declaration_AddRef(IDirect3DVertexDeclaration9 *iface)
static void * heap_alloc(size_t len)
#define D3DFVF_TEXCOUNT_MASK
unsigned int component_count
#define IDirect3DVertexDeclaration9_AddRef(p)
#define D3DFVF_POSITION_MASK
D3DVERTEXELEMENT9 * elements
HRESULT vdecl_convert_fvf(DWORD fvf, D3DVERTEXELEMENT9 **ppVertexElements)
#define D3DFVF_TEXTUREFORMAT2
IDirect3DDevice9Ex * parent_device
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)
unsigned int component_size
#define IDirect3DDevice9Ex_AddRef(p)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
#define D3DFVF_TEXTUREFORMAT4
WINE_DEFAULT_DEBUG_CHANNEL(d3d8)
HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration)
static const struct @225 d3d_dtype_lookup[]
#define STDMETHODCALLTYPE
enum wined3d_format_id format
#define IDirect3DDevice9_AddRef(p)
#define InterlockedDecrement
#define WINED3D_OUTPUT_SLOT_SEMANTIC
#define memcpy(s1, s2, n)
static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elements, struct wined3d_vertex_element **wined3d_elements, UINT *element_count)
static HRESULT WINAPI d3d9_vertex_declaration_GetDevice(IDirect3DVertexDeclaration9 *iface, IDirect3DDevice9 **device)
static HRESULT WINAPI d3d9_vertex_declaration_QueryInterface(IDirect3DVertexDeclaration9 *iface, REFIID riid, void **out)
#define D3DERR_OUTOFVIDEOMEMORY
static struct d3d9_vertex_declaration * impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
#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
static float(__cdecl *square_half_float)(float x
static void STDMETHODCALLTYPE d3d9_vertexdeclaration_wined3d_object_destroyed(void *parent)
#define D3DFVF_TEXCOUNT_SHIFT
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
#define D3DFVF_TEXTUREFORMAT3
static HRESULT WINAPI d3d9_vertex_declaration_GetDeclaration(IDirect3DVertexDeclaration9 *iface, D3DVERTEXELEMENT9 *elements, UINT *element_count)
static const struct IDirect3DVertexDeclaration9Vtbl d3d9_vertex_declaration_vtbl
void WINAPI wined3d_mutex_unlock(void)
#define D3DFVF_LASTBETA_D3DCOLOR
static const struct wined3d_parent_ops d3d9_vertexdeclaration_wined3d_parent_ops
static ULONG WINAPI d3d9_vertex_declaration_Release(IDirect3DVertexDeclaration9 *iface)
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
static BOOL heap_free(void *mem)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define D3DFVF_TEXTUREFORMAT1