38 TRACE(
"instance data step rate: %u\n",
element->instance_data_step_rate);
190 for (
i = 0;
i < element_count; ++
i)
202 ERR(
"Failed to allocate elements memory.\n");
209 for (
i = 0;
i < element_count; ++
i)
231 if (!
e->format->gl_vtx_format)
233 FIXME(
"The application tries to use an unsupported format (%s), returning E_FAIL.\n",
245 for (
j = 1;
j <=
i; ++
j)
250 e->offset = (prev->
offset + prev->
format->byte_count + 3) & ~3;
258 WARN(
"Declaration element %u is not 4 byte aligned(%u), returning E_FAIL.\n",
i,
e->offset);
279 TRACE(
"device %p, elements %p, element_count %u, parent %p, parent_ops %p, declaration %p.\n",
282 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
288 WARN(
"Failed to initialize vertex declaration, hr %#x.\n",
hr);
293 TRACE(
"Created vertex declaration %p.\n",
object);
335 BOOL has_blend_idx = has_blend &&
345 DWORD texcoords = (fvf & 0xffff0000) >> 16;
350 if (has_blend_idx) num_blends--;
353 size = has_pos + (has_blend && num_blends > 0) + has_blend_idx + has_normal +
354 has_psize + has_diffuse + has_specular + num_textures;
372 if (has_blend && (num_blends > 0))
393 ERR(
"Unexpected amount of blend values: %u\n", num_blends);
420 switch ((texcoords >> (
idx * 2)) & 0x03)
449 TRACE(
"device %p, fvf %#x, parent %p, parent_ops %p, declaration %p.\n",
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
enum wined3d_format_id format
static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaration, struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements)
const struct wined3d_format * wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage)
const char * debug_d3dformat(enum wined3d_format_id format_id)
const char * debug_d3dinput_classification(enum wined3d_input_classification classification)
const char * debug_d3ddeclmethod(enum wined3d_decl_method method)
const char * debug_d3ddeclusage(enum wined3d_decl_usage usage)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLsizeiptr const GLvoid GLenum usage
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
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 * u
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 GLint GLint j
static void * heap_calloc(SIZE_T count, SIZE_T size)
const struct wined3d_gl_info * gl_info
struct wined3d_vertex_element * elements
BOOL supported[WINED3D_GL_EXT_COUNT]
const struct wined3d_format * format
struct wined3d_vertex_declaration_element * elements
const struct wined3d_parent_ops * parent_ops
enum wined3d_format_id format
enum wined3d_input_classification input_slot_class
unsigned int instance_data_step_rate
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)
void *CDECL wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration)
static unsigned int convert_fvf_to_declaration(const struct wined3d_gl_info *gl_info, DWORD fvf, struct wined3d_vertex_element **elements)
static void wined3d_vertex_declaration_destroy_object(void *object)
static void dump_wined3d_vertex_element(const struct wined3d_vertex_element *element)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
HRESULT CDECL wined3d_vertex_declaration_create_from_fvf(struct wined3d_device *device, DWORD fvf, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration)
static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *element)
static void append_decl_element(struct wined3d_fvf_convert_state *state, enum wined3d_format_id format_id, enum wined3d_decl_usage usage, UINT usage_idx)
#define WINED3DFVF_TEXTUREFORMAT4
#define WINED3DFVF_TEXTUREFORMAT3
@ WINED3D_DECL_USAGE_BLEND_INDICES
@ WINED3D_DECL_USAGE_NORMAL
@ WINED3D_DECL_USAGE_PSIZE
@ WINED3D_DECL_USAGE_BLEND_WEIGHT
@ WINED3D_DECL_USAGE_POSITION
@ WINED3D_DECL_USAGE_COLOR
@ WINED3D_DECL_USAGE_POSITIONT
@ WINED3D_DECL_USAGE_TEXCOORD
#define WINED3DFVF_SPECULAR
#define WINED3DFVF_TEXCOUNT_SHIFT
@ WINED3D_DECL_METHOD_DEFAULT
#define WINED3DFVF_DIFFUSE
#define WINED3DFVF_POSITION_MASK
#define WINED3DFVF_TEXTUREFORMAT1
#define WINED3DFVF_LASTBETA_UBYTE4
#define WINED3DFVF_TEXCOUNT_MASK
#define WINED3DFVF_XYZRHW
#define WINED3DFVF_NORMAL
@ WINED3DFMT_R32G32_FLOAT
@ 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_R32G32B32A32_FLOAT
@ WINED3DFMT_R16G16B16A16_SNORM
#define WINED3D_APPEND_ALIGNED_ELEMENT
#define WINED3D_OUTPUT_SLOT_SEMANTIC
#define WINED3DFVF_LASTBETA_D3DCOLOR
#define WINED3DFVF_TEXTUREFORMAT2
@ WINED3D_INPUT_PER_VERTEX_DATA