Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
50f785ef
Commit
50f785ef
authored
Dec 11, 2011
by
Michael Mc Donnell
Committed by
Alexandre Julliard
Dec 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Add a D3DXValidMesh test.
parent
64de0876
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
1 deletion
+133
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
mesh.c
dlls/d3dx9_36/mesh.c
+7
-0
mesh.c
dlls/d3dx9_36/tests/mesh.c
+125
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
50f785ef
...
...
@@ -300,7 +300,7 @@
@ stub D3DXUVAtlasCreate(ptr long long long long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr)
@ stub D3DXUVAtlasPack(ptr long long long long ptr ptr long ptr long ptr)
@ stub D3DXUVAtlasPartition(ptr long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr ptr)
@ st
ub
D3DXValidMesh(ptr ptr ptr)
@ st
dcall
D3DXValidMesh(ptr ptr ptr)
@ stub D3DXValidPatchMesh(ptr ptr ptr ptr)
@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr float float)
@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr float)
...
...
dlls/d3dx9_36/mesh.c
View file @
50f785ef
...
...
@@ -5939,6 +5939,13 @@ error:
return
hr
;
}
HRESULT
WINAPI
D3DXValidMesh
(
LPD3DXMESH
mesh
,
CONST
DWORD
*
adjacency
,
LPD3DXBUFFER
*
errors_and_warnings
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
mesh
,
adjacency
,
*
errors_and_warnings
);
return
E_NOTIMPL
;
}
static
BOOL
weld_float1
(
void
*
to
,
void
*
from
,
FLOAT
epsilon
)
{
FLOAT
*
v1
=
to
;
...
...
dlls/d3dx9_36/tests/mesh.c
View file @
50f785ef
...
...
@@ -9930,6 +9930,130 @@ cleanup:
free_test_context
(
test_context
);
}
static
void
test_valid_mesh
(
void
)
{
HRESULT
hr
;
struct
test_context
*
test_context
=
NULL
;
UINT
i
;
const
DWORD
options
=
D3DXMESH_32BIT
|
D3DXMESH_SYSTEMMEM
;
const
D3DVERTEXELEMENT9
declaration
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
D3DDECL_END
()
};
const
unsigned
int
VERTS_PER_FACE
=
3
;
/* mesh0 (one face)
*
* 0--1
* | /
* |/
* 2
*/
const
D3DXVECTOR3
vertices0
[]
=
{
{
0
.
0
f
,
3
.
0
f
,
0
.
f
},
{
2
.
0
f
,
3
.
0
f
,
0
.
f
},
{
0
.
0
f
,
0
.
0
f
,
0
.
f
},
};
const
DWORD
indices0
[]
=
{
0
,
1
,
2
};
const
unsigned
int
num_vertices0
=
ARRAY_SIZE
(
vertices0
);
const
unsigned
int
num_faces0
=
ARRAY_SIZE
(
indices0
)
/
VERTS_PER_FACE
;
const
DWORD
adjacency0
[]
=
{
-
1
,
-
1
,
-
1
};
const
HRESULT
exp_hr0
=
D3D_OK
;
/* mesh1 (Simple bow-tie)
*
* 0--1 1--3
* | / \ |
* |/ \|
* 2 4
*/
const
D3DXVECTOR3
vertices1
[]
=
{
{
0
.
0
f
,
3
.
0
f
,
0
.
f
},
{
2
.
0
f
,
3
.
0
f
,
0
.
f
},
{
0
.
0
f
,
0
.
0
f
,
0
.
f
},
{
4
.
0
f
,
3
.
0
f
,
0
.
f
},
{
4
.
0
f
,
0
.
0
f
,
0
.
f
},
};
const
DWORD
indices1
[]
=
{
0
,
1
,
2
,
1
,
3
,
4
};
const
unsigned
int
num_vertices1
=
ARRAY_SIZE
(
vertices1
);
const
unsigned
int
num_faces1
=
ARRAY_SIZE
(
indices1
)
/
VERTS_PER_FACE
;
const
DWORD
adjacency1
[]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
const
HRESULT
exp_hr1
=
D3DXERR_INVALIDMESH
;
/* Common mesh data */
ID3DXMesh
*
mesh
=
NULL
;
UINT
vertex_size
=
sizeof
(
D3DXVECTOR3
);
ID3DXBuffer
*
errors_and_warnings
=
NULL
;
struct
{
const
D3DXVECTOR3
*
vertices
;
const
DWORD
*
indices
;
const
UINT
num_vertices
;
const
UINT
num_faces
;
const
DWORD
*
adjacency
;
const
HRESULT
exp_hr
;
}
tc
[]
=
{
{
vertices0
,
indices0
,
num_vertices0
,
num_faces0
,
adjacency0
,
exp_hr0
,
},
{
vertices1
,
indices1
,
num_vertices1
,
num_faces1
,
adjacency1
,
exp_hr1
,
},
};
test_context
=
new_test_context
();
if
(
!
test_context
)
{
skip
(
"Couldn't create test context
\n
"
);
goto
cleanup
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tc
);
i
++
)
{
hr
=
init_test_mesh
(
tc
[
i
].
num_faces
,
tc
[
i
].
num_vertices
,
options
,
declaration
,
test_context
->
device
,
&
mesh
,
tc
[
i
].
vertices
,
vertex_size
,
tc
[
i
].
indices
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Couldn't initialize test mesh %d. Got %x expected D3D_OK
\n
"
,
i
,
hr
);
goto
cleanup
;
}
hr
=
D3DXValidMesh
(
mesh
,
tc
[
i
].
adjacency
,
&
errors_and_warnings
);
todo_wine
ok
(
hr
==
tc
[
i
].
exp_hr
,
"D3DXValidMesh test case %d failed. "
"Got %x
\n
, expected %x
\n
"
,
i
,
hr
,
tc
[
i
].
exp_hr
);
/* Note errors_and_warnings is deliberately not checked because that
* would require copying wast amounts of the text output. */
if
(
errors_and_warnings
)
{
ID3DXBuffer_Release
(
errors_and_warnings
);
errors_and_warnings
=
NULL
;
}
mesh
->
lpVtbl
->
Release
(
mesh
);
mesh
=
NULL
;
}
cleanup:
if
(
mesh
)
mesh
->
lpVtbl
->
Release
(
mesh
);
free_test_context
(
test_context
);
}
START_TEST
(
mesh
)
{
D3DXBoundProbeTest
();
...
...
@@ -9954,4 +10078,5 @@ START_TEST(mesh)
test_convert_point_reps_to_adjacency
();
test_weld_vertices
();
test_clone_mesh
();
test_valid_mesh
();
}
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