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
3c7e48a1
Commit
3c7e48a1
authored
Jun 11, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test the default diffuse color for vertex shaders.
parent
2f17d5b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
visual.c
dlls/d3d9/tests/visual.c
+40
-4
No files found.
dlls/d3d9/tests/visual.c
View file @
3c7e48a1
...
...
@@ -7388,6 +7388,7 @@ static void test_vshader_input(void)
{
IDirect3DVertexDeclaration9
*
decl_twotexcrd
,
*
decl_onetexcrd
,
*
decl_twotex_wrongidx
,
*
decl_twotexcrd_rightorder
;
IDirect3DVertexDeclaration9
*
decl_texcoord_color
,
*
decl_color_color
,
*
decl_color_ubyte
,
*
decl_color_float
;
IDirect3DVertexDeclaration9
*
decl_nocolor
;
IDirect3DVertexShader9
*
swapped_shader
,
*
texcoord_color_shader
,
*
color_color_shader
;
D3DADAPTER_IDENTIFIER9
identifier
;
IDirect3DPixelShader9
*
ps
;
...
...
@@ -7576,6 +7577,13 @@ static void test_vshader_input(void)
1
.
0
f
,
0
.
0
f
,
0
.
1
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
1
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
};
static
const
struct
vec3
quad_nocolor
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
},
{
1
.
0
f
,
1
.
0
f
,
0
.
1
f
},
};
static
const
D3DVERTEXELEMENT9
decl_elements_twotexcrd
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
...
...
@@ -7627,6 +7635,11 @@ static void test_vshader_input(void)
{
0
,
12
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_COLOR
,
0
},
D3DDECL_END
()
};
static
const
D3DVERTEXELEMENT9
decl_elements_nocolor
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
D3DDECL_END
()
};
static
const
float
normalize
[
4
]
=
{
1
.
0
f
/
256
.
0
f
,
1
.
0
f
/
256
.
0
f
,
1
.
0
f
/
256
.
0
f
,
1
.
0
f
/
256
.
0
f
};
static
const
float
no_normalize
[
4
]
=
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
...
...
@@ -7670,6 +7683,8 @@ static void test_vshader_input(void)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateVertexDeclaration returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
decl_elements_color_float
,
&
decl_color_float
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateVertexDeclaration returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateVertexDeclaration
(
device
,
decl_elements_nocolor
,
&
decl_nocolor
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateVertexDeclaration returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreatePixelShader
(
device
,
ps3_code
,
&
ps
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreatePixelShader returned %08x
\n
"
,
hr
);
...
...
@@ -7876,10 +7891,6 @@ static void test_vshader_input(void)
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
IDirect3DDevice9_SetVertexShader
(
device
,
NULL
);
IDirect3DDevice9_SetVertexDeclaration
(
device
,
NULL
);
IDirect3DDevice9_SetPixelShader
(
device
,
NULL
);
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0x00
,
0xff
,
0x80
,
0x40
),
1
),
"Input test: Quad 1(color-texcoord) returned color 0x%08x, expected 0x00ff8040
\n
"
,
color
);
...
...
@@ -7896,6 +7907,30 @@ static void test_vshader_input(void)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Present failed with %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexDeclaration
(
device
,
decl_nocolor
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set vertex declaration, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xff0000ff
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad_nocolor
,
sizeof
(
quad_nocolor
[
0
]));
ok
(
SUCCEEDED
(
hr
),
"Failed to draw, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
/* WARP ends up using the color attribute from the previous draw. Let's mark
* that behavior as broken. */
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color_match
(
color
,
0x00000000
,
1
)
||
broken
(
color_match
(
color
,
0x00ffff00
,
1
)),
"Got unexpected color 0x%08x for no color attribute test.
\n
"
,
color
);
IDirect3DDevice9_SetVertexShader
(
device
,
NULL
);
IDirect3DDevice9_SetVertexDeclaration
(
device
,
NULL
);
IDirect3DDevice9_SetPixelShader
(
device
,
NULL
);
IDirect3DVertexShader9_Release
(
texcoord_color_shader
);
IDirect3DVertexShader9_Release
(
color_color_shader
);
}
...
...
@@ -7909,6 +7944,7 @@ static void test_vshader_input(void)
IDirect3DVertexDeclaration9_Release
(
decl_color_color
);
IDirect3DVertexDeclaration9_Release
(
decl_color_ubyte
);
IDirect3DVertexDeclaration9_Release
(
decl_color_float
);
IDirect3DVertexDeclaration9_Release
(
decl_nocolor
);
IDirect3DPixelShader9_Release
(
ps
);
refcount
=
IDirect3DDevice9_Release
(
device
);
...
...
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