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
74a02a85
Commit
74a02a85
authored
Mar 22, 2018
by
Matteo Bruni
Committed by
Alexandre Julliard
Mar 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Add a test for FindNextValidTechnique().
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c3342644
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
effect.c
dlls/d3dx9_36/tests/effect.c
+88
-0
No files found.
dlls/d3dx9_36/tests/effect.c
View file @
74a02a85
...
@@ -7832,6 +7832,93 @@ static void test_create_effect_from_file(void)
...
@@ -7832,6 +7832,93 @@ static void test_create_effect_from_file(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
void
test_effect_find_next_valid_technique
(
void
)
{
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
IDirect3DDevice9
*
device
;
D3DXTECHNIQUE_DESC
desc
;
ID3DXEffect
*
effect
;
IDirect3D9
*
d3d
;
D3DXHANDLE
tech
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
if
(
!
(
window
=
CreateWindowA
(
"static"
,
"d3dx9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
)))
{
skip
(
"Failed to create window.
\n
"
);
return
;
}
if
(
!
(
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create IDirect3D9 object.
\n
"
);
DestroyWindow
(
window
);
return
;
}
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
hr
=
IDirect3D9_CreateDevice
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
window
,
D3DCREATE_HARDWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create IDirect3DDevice9 object, hr %#x.
\n
"
,
hr
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
return
;
}
hr
=
D3DXCreateEffectEx
(
device
,
test_effect_unsupported_shader_blob
,
sizeof
(
test_effect_unsupported_shader_blob
),
NULL
,
NULL
,
NULL
,
0
,
NULL
,
&
effect
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
NULL
,
&
tech
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
GetTechniqueDesc
(
effect
,
tech
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
desc
.
Name
,
"tech1"
),
"Got unexpected technique %s.
\n
"
,
desc
.
Name
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
tech
,
&
tech
);
ok
(
hr
==
S_FALSE
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
GetTechniqueDesc
(
effect
,
tech
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
desc
.
Name
,
"tech0"
),
"Got unexpected technique %s.
\n
"
,
desc
.
Name
);
effect
->
lpVtbl
->
SetInt
(
effect
,
"i"
,
1
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
tech
=
(
D3DXHANDLE
)
0xdeadbeef
;
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
NULL
,
&
tech
);
ok
(
hr
==
S_FALSE
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
GetTechniqueDesc
(
effect
,
tech
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
desc
.
Name
,
"tech0"
),
"Got unexpected technique %s.
\n
"
,
desc
.
Name
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
tech
,
&
tech
);
ok
(
hr
==
S_FALSE
,
"Got result %#x.
\n
"
,
hr
);
effect
->
lpVtbl
->
SetInt
(
effect
,
"i"
,
0
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
tech
,
&
tech
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
GetTechniqueDesc
(
effect
,
tech
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"Got result %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
desc
.
Name
,
"tech1"
),
"Got unexpected technique %s.
\n
"
,
desc
.
Name
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
tech
,
&
tech
);
ok
(
hr
==
S_FALSE
,
"Got result %#x.
\n
"
,
hr
);
hr
=
effect
->
lpVtbl
->
FindNextValidTechnique
(
effect
,
"nope"
,
&
tech
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got result %#x.
\n
"
,
hr
);
effect
->
lpVtbl
->
Release
(
effect
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
START_TEST
(
effect
)
START_TEST
(
effect
)
{
{
IDirect3DDevice9
*
device
;
IDirect3DDevice9
*
device
;
...
@@ -7870,4 +7957,5 @@ START_TEST(effect)
...
@@ -7870,4 +7957,5 @@ START_TEST(effect)
test_effect_clone
();
test_effect_clone
();
test_refcount
();
test_refcount
();
test_create_effect_from_file
();
test_create_effect_from_file
();
test_effect_find_next_valid_technique
();
}
}
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