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);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define STDMETHODCALLTYPE
static UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, struct wined3d_vertex_element **wined3d_elements)
#define D3DFVF_TEXCOUNT_SHIFT
#define D3DFVF_LASTBETA_UBYTE4
#define D3DFVF_TEXTUREFORMAT4
#define D3DFVF_TEXTUREFORMAT3
#define D3DFVF_TEXCOUNT_MASK
#define D3DFVF_TEXTUREFORMAT1
#define D3DFVF_TEXTUREFORMAT2
#define D3DFVF_POSITION_MASK
static HRESULT WINAPI d3d9_vertex_declaration_GetDeclaration(IDirect3DVertexDeclaration9 *iface, D3DVERTEXELEMENT9 *elements, UINT *element_count)
unsigned int component_count
enum wined3d_format_id format
struct d3d9_vertex_declaration * unsafe_impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
static const struct IDirect3DVertexDeclaration9Vtbl d3d9_vertex_declaration_vtbl
static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaration, struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements)
static void STDMETHODCALLTYPE d3d9_vertexdeclaration_wined3d_object_destroyed(void *parent)
static struct d3d9_vertex_declaration * impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
static const struct @229 d3d_dtype_lookup[]
static const struct wined3d_parent_ops d3d9_vertexdeclaration_wined3d_parent_ops
static HRESULT WINAPI d3d9_vertex_declaration_GetDevice(IDirect3DVertexDeclaration9 *iface, IDirect3DDevice9 **device)
HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration)
static HRESULT WINAPI d3d9_vertex_declaration_QueryInterface(IDirect3DVertexDeclaration9 *iface, REFIID riid, void **out)
static ULONG WINAPI d3d9_vertex_declaration_AddRef(IDirect3DVertexDeclaration9 *iface)
HRESULT vdecl_convert_fvf(DWORD fvf, D3DVERTEXELEMENT9 **ppVertexElements)
static ULONG WINAPI d3d9_vertex_declaration_Release(IDirect3DVertexDeclaration9 *iface)
unsigned int component_size
#define IDirect3DDevice9Ex_Release(p)
#define IDirect3DVertexDeclaration9_AddRef(p)
#define IDirect3DDevice9Ex_AddRef(p)
#define IDirect3DDevice9_AddRef(p)
@ D3DDECLUSAGE_BLENDWEIGHT
@ D3DDECLUSAGE_BLENDINDICES
#define D3DFVF_LASTBETA_D3DCOLOR
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLuint GLuint GLsizei count
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
#define memcpy(s1, s2, n)
static float(__cdecl *square_half_float)(float x
#define IsEqualGUID(rguid1, rguid2)
#define D3DERR_OUTOFVIDEOMEMORY
IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9_iface
IDirect3DDevice9Ex * parent_device
D3DVERTEXELEMENT9 * elements
#define CONTAINING_RECORD(address, type, field)
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)
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
@ WINED3DFMT_R16G16_UNORM
@ WINED3DFMT_R10G10B10X2_UINT
@ WINED3DFMT_R32G32_FLOAT
@ WINED3DFMT_R16G16_SNORM
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_R16G16B16A16_SINT
@ WINED3DFMT_R32G32B32_FLOAT
@ WINED3DFMT_R16G16B16A16_FLOAT
@ WINED3DFMT_R8G8B8A8_UNORM
@ WINED3DFMT_R16G16B16A16_UNORM
@ WINED3DFMT_R16G16_FLOAT
@ WINED3DFMT_R8G8B8A8_UINT
@ WINED3DFMT_R10G10B10X2_SNORM
@ WINED3DFMT_R32G32B32A32_FLOAT
@ WINED3DFMT_R16G16B16A16_SNORM
#define WINED3D_OUTPUT_SLOT_SEMANTIC
@ WINED3D_INPUT_PER_VERTEX_DATA
void WINAPI wined3d_mutex_unlock(void)
void WINAPI wined3d_mutex_lock(void)