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
a0b81e1c
Commit
a0b81e1c
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: Add a test for POSITIONT vertex fixups.
parent
b475047c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
1 deletion
+92
-1
visual.c
dlls/d3d9/tests/visual.c
+92
-1
No files found.
dlls/d3d9/tests/visual.c
View file @
a0b81e1c
...
@@ -5481,8 +5481,13 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
...
@@ -5481,8 +5481,13 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
{
0
,
12
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_COLOR
,
0
},
{
0
,
12
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
D3DDECL_END
()
};
};
static
const
D3DVERTEXELEMENT9
decl_elements_positiont
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITIONT
,
0
},
{
0
,
16
,
D3DDECLTYPE_D3DCOLOR
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
};
IDirect3DVertexDeclaration9
*
dcl_float
=
NULL
,
*
dcl_short
=
NULL
,
*
dcl_ubyte
=
NULL
,
*
dcl_color
=
NULL
;
IDirect3DVertexDeclaration9
*
dcl_float
=
NULL
,
*
dcl_short
=
NULL
,
*
dcl_ubyte
=
NULL
,
*
dcl_color
=
NULL
;
IDirect3DVertexDeclaration9
*
dcl_color_2
=
NULL
,
*
dcl_ubyte_2
=
NULL
;
IDirect3DVertexDeclaration9
*
dcl_color_2
=
NULL
,
*
dcl_ubyte_2
=
NULL
,
*
dcl_positiont
;
IDirect3DVertexBuffer9
*
vb
,
*
vb2
;
IDirect3DVertexBuffer9
*
vb
,
*
vb2
;
struct
vertex
quad1
[]
=
/* D3DCOLOR */
struct
vertex
quad1
[]
=
/* D3DCOLOR */
{
{
...
@@ -5551,6 +5556,12 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
...
@@ -5551,6 +5556,12 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
0
.
0
,
0
.
0
,
0
.
1
,
0
.
0
,
0
.
0
,
0
.
1
,
0
.
0
,
1
.
0
,
0
.
1
0
.
0
,
1
.
0
,
0
.
1
};
};
struct
tvertex
quad_transformed
[]
=
{
{
90
,
110
,
0
.
1
,
2
.
0
,
0x00ffff00
},
{
570
,
110
,
0
.
1
,
2
.
0
,
0x00ffff00
},
{
90
,
300
,
0
.
1
,
2
.
0
,
0x00ffff00
},
{
570
,
300
,
0
.
1
,
2
.
0
,
0x00ffff00
}
};
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffffffff
,
0
.
0
,
0
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffffffff
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
...
@@ -5567,6 +5578,8 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
...
@@ -5567,6 +5578,8 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
ok
(
SUCCEEDED
(
hr
),
"CreateVertexDeclaration failed (%08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateVertexDeclaration failed (%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
decl_elements_d3dcolor_2streams
,
&
dcl_color_2
);
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
decl_elements_d3dcolor_2streams
,
&
dcl_color_2
);
ok
(
SUCCEEDED
(
hr
),
"CreateVertexDeclaration failed (%08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateVertexDeclaration failed (%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
decl_elements_positiont
,
&
dcl_positiont
);
ok
(
SUCCEEDED
(
hr
),
"CreateVertexDeclaration failed (%08x)
\n
"
,
hr
);
size
=
max
(
sizeof
(
quad1
),
max
(
sizeof
(
quad2
),
max
(
sizeof
(
quad3
),
max
(
sizeof
(
quad4
),
sizeof
(
quads
)))));
size
=
max
(
sizeof
(
quad1
),
max
(
sizeof
(
quad2
),
max
(
sizeof
(
quad3
),
max
(
sizeof
(
quad4
),
sizeof
(
quads
)))));
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
size
,
hr
=
IDirect3DDevice9_CreateVertexBuffer
(
device
,
size
,
...
@@ -5725,6 +5738,83 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
...
@@ -5725,6 +5738,83 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
"D3DDECLTYPE_FLOAT4 returned color %08x, expected 0x00ff0000
\n
"
,
color
);
"D3DDECLTYPE_FLOAT4 returned color %08x, expected 0x00ff0000
\n
"
,
color
);
}
}
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff0000ff
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Clear failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
hr
=
IDirect3DVertexBuffer9_Lock
(
vb
,
0
,
sizeof
(
quad_transformed
),
(
void
**
)
&
data
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DVertexBuffer9_Lock failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
memcpy
(
data
,
quad_transformed
,
sizeof
(
quad_transformed
));
hr
=
IDirect3DVertexBuffer9_Unlock
(
vb
);
ok
(
hr
==
D3D_OK
,
"IDirect3DVertexBuffer9_Unlock failed (%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexDeclaration
(
device
,
dcl_positiont
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetVertexDeclaration failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetVertexDeclaration failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DDevice9_SetStreamSource
(
device
,
0
,
vb
,
0
,
sizeof
(
quad_transformed
[
0
]));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetStreamSource failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
hr
=
IDirect3DDevice9_DrawPrimitive
(
device
,
D3DPT_TRIANGLESTRIP
,
0
,
2
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_DrawPrimitive failed, hr = %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetVertexDeclaration failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
}
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
color
=
getPixelColor
(
device
,
88
,
108
);
ok
(
color
==
0x000000ff
,
"pixel 88/108 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
92
,
108
);
ok
(
color
==
0x000000ff
,
"pixel 92/108 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
88
,
112
);
ok
(
color
==
0x000000ff
,
"pixel 88/112 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
92
,
112
);
ok
(
color
==
0x00ffff00
,
"pixel 92/112 has color %08x, expected 0x00ffff00
\n
"
,
color
);
color
=
getPixelColor
(
device
,
568
,
108
);
ok
(
color
==
0x000000ff
,
"pixel 568/108 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
572
,
108
);
ok
(
color
==
0x000000ff
,
"pixel 572/108 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
568
,
112
);
ok
(
color
==
0x00ffff00
,
"pixel 568/112 has color %08x, expected 0x00ffff00
\n
"
,
color
);
color
=
getPixelColor
(
device
,
572
,
112
);
ok
(
color
==
0x000000ff
,
"pixel 572/112 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
88
,
298
);
ok
(
color
==
0x000000ff
,
"pixel 88/298 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
92
,
298
);
ok
(
color
==
0x00ffff00
,
"pixel 92/298 has color %08x, expected 0x00ffff00
\n
"
,
color
);
color
=
getPixelColor
(
device
,
88
,
302
);
ok
(
color
==
0x000000ff
,
"pixel 88/302 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
92
,
302
);
ok
(
color
==
0x000000ff
,
"pixel 92/302 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
568
,
298
);
ok
(
color
==
0x00ffff00
,
"pixel 568/298 has color %08x, expected 0x00ffff00
\n
"
,
color
);
color
=
getPixelColor
(
device
,
572
,
298
);
ok
(
color
==
0x000000ff
,
"pixel 572/298 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
568
,
302
);
ok
(
color
==
0x000000ff
,
"pixel 568/302 has color %08x, expected 0x000000ff
\n
"
,
color
);
color
=
getPixelColor
(
device
,
572
,
302
);
ok
(
color
==
0x000000ff
,
"pixel 572/302 has color %08x, expected 0x000000ff
\n
"
,
color
);
/* This test is pointless without those two declarations: */
/* This test is pointless without those two declarations: */
if
(
!
dcl_color_2
||
!
dcl_ubyte_2
)
goto
out
;
if
(
!
dcl_color_2
||
!
dcl_ubyte_2
)
goto
out
;
...
@@ -5800,6 +5890,7 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
...
@@ -5800,6 +5890,7 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
if
(
dcl_color
)
IDirect3DVertexDeclaration9_Release
(
dcl_color
);
if
(
dcl_color
)
IDirect3DVertexDeclaration9_Release
(
dcl_color
);
if
(
dcl_color_2
)
IDirect3DVertexDeclaration9_Release
(
dcl_color_2
);
if
(
dcl_color_2
)
IDirect3DVertexDeclaration9_Release
(
dcl_color_2
);
if
(
dcl_ubyte_2
)
IDirect3DVertexDeclaration9_Release
(
dcl_ubyte_2
);
if
(
dcl_ubyte_2
)
IDirect3DVertexDeclaration9_Release
(
dcl_ubyte_2
);
if
(
dcl_positiont
)
IDirect3DVertexDeclaration9_Release
(
dcl_positiont
);
}
}
struct
vertex_float16color
{
struct
vertex_float16color
{
...
...
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