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
7f302ac4
Commit
7f302ac4
authored
Mar 21, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Use a separate device for cnd_test().
parent
7715684f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
33 deletions
+64
-33
visual.c
dlls/d3d9/tests/visual.c
+64
-33
No files found.
dlls/d3d9/tests/visual.c
View file @
7f302ac4
...
@@ -5709,13 +5709,19 @@ done:
...
@@ -5709,13 +5709,19 @@ done:
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
void
cnd_test
(
IDirect3DDevice9
*
device
)
static
void
cnd_test
(
void
)
{
{
IDirect3DPixelShader9
*
shader_11
,
*
shader_12
,
*
shader_13
,
*
shader_14
;
IDirect3DPixelShader9
*
shader_11_coissue
,
*
shader_12_coissue
,
*
shader_13_coissue
,
*
shader_14_coissue
;
IDirect3DPixelShader9
*
shader_11_coissue_2
,
*
shader_12_coissue_2
,
*
shader_13_coissue_2
,
*
shader_14_coissue_2
;
IDirect3DPixelShader9
*
shader_11_coissue_2
,
*
shader_12_coissue_2
,
*
shader_13_coissue_2
,
*
shader_14_coissue_2
;
HRESULT
hr
;
IDirect3DPixelShader9
*
shader_11_coissue
,
*
shader_12_coissue
,
*
shader_13_coissue
,
*
shader_14_coissue
;
IDirect3DPixelShader9
*
shader_11
,
*
shader_12
,
*
shader_13
,
*
shader_14
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
ULONG
refcount
;
D3DCAPS9
caps
;
HWND
window
;
DWORD
color
;
DWORD
color
;
HRESULT
hr
;
/* ps 1.x shaders are rather picky with writemasks and source swizzles.
/* ps 1.x shaders are rather picky with writemasks and source swizzles.
* The dp3 is used to copy r0.r to all components of r1, then copy r1.a to
* The dp3 is used to copy r0.r to all components of r1, then copy r1.a to
* r0.a. Essentially it does a mov r0.a, r0.r, which isn't allowed as-is
* r0.a. Essentially it does a mov r0.a, r0.r, which isn't allowed as-is
...
@@ -5888,36 +5894,59 @@ static void cnd_test(IDirect3DDevice9 *device)
...
@@ -5888,36 +5894,59 @@ static void cnd_test(IDirect3DDevice9 *device)
0x00000001
,
0x80080000
,
0xa0ff0000
,
/* mov r0.a, c0.a */
0x00000001
,
0x80080000
,
0xa0ff0000
,
/* mov r0.a, c0.a */
0x0000ffff
/* end */
0x0000ffff
/* end */
};
};
float
quad1
[]
=
{
static
const
float
quad1
[]
=
-
1
.
0
,
-
1
.
0
,
0
.
1
,
0
.
0
,
0
.
0
,
1
.
0
,
{
0
.
0
,
-
1
.
0
,
0
.
1
,
1
.
0
,
0
.
0
,
1
.
0
,
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
-
1
.
0
,
0
.
0
,
0
.
1
,
0
.
0
,
1
.
0
,
0
.
0
,
-
1
.
0
f
,
0
.
0
f
,
0
.
1
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
,
0
.
0
,
0
.
1
,
1
.
0
,
1
.
0
,
0
.
0
0
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
1
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
};
};
float
quad2
[]
=
{
static
const
float
quad2
[]
=
0
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,
1
.
0
,
-
1
.
0
f
,
0
.
0
f
,
0
.
1
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
-
1
.
0
,
1
.
0
,
0
.
1
,
0
.
0
,
1
.
0
,
0
.
0
,
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
,
1
.
0
,
0
.
1
,
1
.
0
,
1
.
0
,
0
.
0
0
.
0
f
,
0
.
0
f
,
0
.
1
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
1
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
};
};
float
test_data_c1
[
4
]
=
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
};
static
const
float
test_data_c1
[
4
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
float
test_data_c2
[
4
]
=
{
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
};
static
const
float
test_data_c2
[
4
]
=
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
float
test_data_c1_coi
[
4
]
=
{
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
};
static
const
float
test_data_c1_coi
[
4
]
=
{
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
float
test_data_c2_coi
[
4
]
=
{
1
.
0
,
0
.
0
,
1
.
0
,
1
.
0
};
static
const
float
test_data_c2_coi
[
4
]
=
{
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
};
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff00ffff
,
0
.
0
,
0
);
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
if
(
caps
.
PixelShaderVersion
<
D3DPS_VERSION
(
1
,
4
))
{
skip
(
"No ps_1_4 support, skipping tests.
\n
"
);
IDirect3DDevice9_Release
(
device
);
goto
done
;
}
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xff00ffff
,
1
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Clear returned %08x
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Clear returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreatePixelShader
(
device
,
shader_code_11
,
&
shader_11
);
hr
=
IDirect3DDevice9_CreatePixelShader
(
device
,
shader_code_11
,
&
shader_11
);
...
@@ -6155,9 +6184,6 @@ static void cnd_test(IDirect3DDevice9 *device)
...
@@ -6155,9 +6184,6 @@ static void cnd_test(IDirect3DDevice9 *device)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_EndScene returned %08x
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_EndScene returned %08x
\n
"
,
hr
);
}
}
hr
=
IDirect3DDevice9_SetPixelShader
(
device
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetPixelShader returned %08x
\n
"
,
hr
);
/* 1.4 shader */
/* 1.4 shader */
color
=
getPixelColor
(
device
,
158
,
118
);
color
=
getPixelColor
(
device
,
158
,
118
);
ok
(
color
==
0x00ffffff
,
"pixel 158, 118 has color %08x, expected 0x00ffffff
\n
"
,
color
);
ok
(
color
==
0x00ffffff
,
"pixel 158, 118 has color %08x, expected 0x00ffffff
\n
"
,
color
);
...
@@ -6225,6 +6251,11 @@ static void cnd_test(IDirect3DDevice9 *device)
...
@@ -6225,6 +6251,11 @@ static void cnd_test(IDirect3DDevice9 *device)
IDirect3DPixelShader9_Release
(
shader_13
);
IDirect3DPixelShader9_Release
(
shader_13
);
IDirect3DPixelShader9_Release
(
shader_12
);
IDirect3DPixelShader9_Release
(
shader_12
);
IDirect3DPixelShader9_Release
(
shader_11
);
IDirect3DPixelShader9_Release
(
shader_11
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
}
static
void
nested_loop_test
(
void
)
static
void
nested_loop_test
(
void
)
...
@@ -15915,7 +15946,6 @@ START_TEST(visual)
...
@@ -15915,7 +15946,6 @@ START_TEST(visual)
volume_v16u16_test
(
device_ptr
);
volume_v16u16_test
(
device_ptr
);
if
(
caps
.
PixelShaderVersion
>=
D3DPS_VERSION
(
1
,
4
))
{
if
(
caps
.
PixelShaderVersion
>=
D3DPS_VERSION
(
1
,
4
))
{
constant_clamp_ps_test
(
device_ptr
);
constant_clamp_ps_test
(
device_ptr
);
cnd_test
(
device_ptr
);
}
}
}
}
else
skip
(
"No ps_1_1 support
\n
"
);
else
skip
(
"No ps_1_1 support
\n
"
);
...
@@ -15923,6 +15953,7 @@ START_TEST(visual)
...
@@ -15923,6 +15953,7 @@ START_TEST(visual)
cleanup_device
(
device_ptr
);
cleanup_device
(
device_ptr
);
device_ptr
=
NULL
;
device_ptr
=
NULL
;
cnd_test
();
dp2add_ps_test
();
dp2add_ps_test
();
unbound_sampler_test
();
unbound_sampler_test
();
nested_loop_test
();
nested_loop_test
();
...
...
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