Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8ff517ee
Commit
8ff517ee
authored
Dec 20, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Vertex attributes are 4 byte aligned.
parent
a0b81e1c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
4 deletions
+59
-4
vertexdeclaration.c
dlls/d3d9/tests/vertexdeclaration.c
+47
-0
vertexdeclaration.c
dlls/d3d9/vertexdeclaration.c
+1
-1
device.c
dlls/wined3d/device.c
+4
-0
vertexbuffer.c
dlls/wined3d/vertexbuffer.c
+1
-3
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+6
-0
No files found.
dlls/d3d9/tests/vertexdeclaration.c
View file @
8ff517ee
...
...
@@ -736,6 +736,52 @@ static void test_fvf_decl_management(
return
;
}
static
void
test_vertex_declaration_alignment
(
IDirect3DDevice9
*
device
)
{
HRESULT
hr
;
IDirect3DVertexDeclaration9
*
result_decl
=
NULL
;
int
i
;
CONST
D3DVERTEXELEMENT9
test_elements
[
5
][
3
]
=
{
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
0
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
16
,
D3DDECLTYPE_D3DCOLOR
,
0
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
},
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
0
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
17
,
D3DDECLTYPE_D3DCOLOR
,
0
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
},
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
0
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
18
,
D3DDECLTYPE_D3DCOLOR
,
0
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
},
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
0
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
19
,
D3DDECLTYPE_D3DCOLOR
,
0
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
},
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
0
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
20
,
D3DDECLTYPE_D3DCOLOR
,
0
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
}
};
HRESULT
results
[
5
]
=
{
D3D_OK
,
E_FAIL
,
E_FAIL
,
E_FAIL
,
D3D_OK
};
for
(
i
=
0
;
i
<
sizeof
(
test_elements
)
/
sizeof
(
test_elements
[
0
]);
i
++
)
{
result_decl
=
NULL
;
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
test_elements
[
i
],
&
result_decl
);
ok
(
hr
==
results
[
i
],
"CreateVertexDeclaration for declaration %d returned %#x, expected %#x
\n
"
,
i
,
hr
,
results
[
i
]);
if
(
result_decl
)
IDirect3DVertexDeclaration9_Release
(
result_decl
);
}
}
START_TEST
(
vertexdeclaration
)
{
static
D3DVERTEXELEMENT9
simple_decl
[]
=
{
...
...
@@ -770,4 +816,5 @@ START_TEST(vertexdeclaration)
test_get_declaration
(
decl_ptr
,
simple_decl
,
simple_decl_num_elements
);
test_fvf_decl_conversion
(
device_ptr
);
test_fvf_decl_management
(
device_ptr
);
test_vertex_declaration_alignment
(
device_ptr
);
}
dlls/d3d9/vertexdeclaration.c
View file @
8ff517ee
...
...
@@ -368,7 +368,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9
if
(
FAILED
(
hr
))
{
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateVertexDeclaration failed
\n
"
,
This
);
WARN
(
"(%p) call to IWineD3DDevice_CreateVertexDeclaration failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
elements
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
...
...
dlls/wined3d/device.c
View file @
8ff517ee
...
...
@@ -1716,6 +1716,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice*
D3DCREATEOBJECTINSTANCE
(
object
,
VertexDeclaration
)
hr
=
IWineD3DVertexDeclaration_SetDeclaration
((
IWineD3DVertexDeclaration
*
)
object
,
elements
,
element_count
);
if
(
FAILED
(
hr
))
{
*
ppVertexDeclaration
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
return
hr
;
}
...
...
dlls/wined3d/vertexbuffer.c
View file @
8ff517ee
...
...
@@ -572,9 +572,7 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
switch
(
This
->
conv_map
[
j
])
{
case
CONV_NONE
:
/* Done already */
/* Vertex attribute sizes are always multiples of 4, but we can't skip 3 additional bytes
* because the attributes don't have to start at aligned offsets
*/
j
+=
3
;
break
;
case
CONV_D3DCOLOR
:
fixup_d3dcolor
((
DWORD
*
)
(
data
+
i
*
This
->
stride
+
j
));
...
...
dlls/wined3d/vertexdeclaration.c
View file @
8ff517ee
...
...
@@ -159,6 +159,12 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
*/
if
(
This
->
pDeclarationWine
[
i
].
Stream
>=
MAX_STREAMS
)
continue
;
if
(
This
->
pDeclarationWine
[
i
].
Offset
&
0x3
)
{
WARN
(
"Declaration element %d is not 4 byte aligned(%d), returning E_FAIL
\n
"
,
i
,
This
->
pDeclarationWine
[
i
].
Offset
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pDeclarationWine
);
return
E_FAIL
;
}
if
(
!
isPreLoaded
[
This
->
pDeclarationWine
[
i
].
Stream
])
{
This
->
streams
[
This
->
num_streams
]
=
This
->
pDeclarationWine
[
i
].
Stream
;
This
->
num_streams
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment