Commit 849149d5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Add support for appending vertex declaration elements.

parent a11c8758
...@@ -83,8 +83,6 @@ static HRESULT d3d10_input_layout_to_wined3d_declaration(const D3D10_INPUT_ELEME ...@@ -83,8 +83,6 @@ static HRESULT d3d10_input_layout_to_wined3d_declaration(const D3D10_INPUT_ELEME
e->usage = 0; e->usage = 0;
e->usage_idx = 0; e->usage_idx = 0;
if (f->AlignedByteOffset == D3D10_APPEND_ALIGNED_ELEMENT)
FIXME("D3D10_APPEND_ALIGNED_ELEMENT not supported\n");
if (f->InputSlotClass != D3D10_INPUT_PER_VERTEX_DATA) if (f->InputSlotClass != D3D10_INPUT_PER_VERTEX_DATA)
FIXME("Ignoring input slot class (%#x)\n", f->InputSlotClass); FIXME("Ignoring input slot class (%#x)\n", f->InputSlotClass);
if (f->InstanceDataStepRate) if (f->InstanceDataStepRate)
......
...@@ -216,6 +216,19 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara ...@@ -216,6 +216,19 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
return E_FAIL; return E_FAIL;
} }
if (e->offset == WINED3D_APPEND_ALIGNED_ELEMENT)
{
if (!i)
{
e->offset = 0;
}
else
{
struct wined3d_vertex_declaration_element *prev = &declaration->elements[i - 1];
e->offset = (prev->offset + prev->format->byte_count + 3) & ~3;
}
}
if (e->offset & 0x3) if (e->offset & 0x3)
{ {
WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL.\n", i, e->offset); WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL.\n", i, e->offset);
......
...@@ -2422,8 +2422,8 @@ struct wined3d_vertex_declaration_element ...@@ -2422,8 +2422,8 @@ struct wined3d_vertex_declaration_element
{ {
const struct wined3d_format *format; const struct wined3d_format *format;
BOOL ffp_valid; BOOL ffp_valid;
WORD input_slot; unsigned int input_slot;
WORD offset; unsigned int offset;
UINT output_slot; UINT output_slot;
BYTE method; BYTE method;
BYTE usage; BYTE usage;
......
...@@ -1494,6 +1494,8 @@ enum wined3d_display_rotation ...@@ -1494,6 +1494,8 @@ enum wined3d_display_rotation
#define WINED3D_SURFACE_DISCARD 0x00000002 #define WINED3D_SURFACE_DISCARD 0x00000002
#define WINED3D_SURFACE_PIN_SYSMEM 0x00000004 #define WINED3D_SURFACE_PIN_SYSMEM 0x00000004
#define WINED3D_APPEND_ALIGNED_ELEMENT 0xffffffff
struct wined3d_display_mode struct wined3d_display_mode
{ {
UINT width; UINT width;
...@@ -1670,8 +1672,8 @@ struct wined3d_clip_status ...@@ -1670,8 +1672,8 @@ struct wined3d_clip_status
struct wined3d_vertex_element struct wined3d_vertex_element
{ {
enum wined3d_format_id format; enum wined3d_format_id format;
WORD input_slot; unsigned int input_slot;
WORD offset; unsigned int offset;
UINT output_slot; /* D3D 8 & 10 */ UINT output_slot; /* D3D 8 & 10 */
BYTE method; BYTE method;
BYTE usage; BYTE usage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment