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
dffce5c0
Commit
dffce5c0
authored
Sep 23, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Sep 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Test creating shaders with wrong type or version.
parent
d9c9b5c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
device.c
dlls/d3d8/tests/device.c
+83
-0
No files found.
dlls/d3d8/tests/device.c
View file @
dffce5c0
...
@@ -2701,6 +2701,88 @@ done:
...
@@ -2701,6 +2701,88 @@ done:
DestroyWindow
(
focus_window
);
DestroyWindow
(
focus_window
);
}
}
static
void
test_wrong_shader
(
void
)
{
HRESULT
hr
;
HWND
hwnd
=
NULL
;
IDirect3D8
*
d3d
=
NULL
;
IDirect3DDevice8
*
device
=
NULL
;
D3DPRESENT_PARAMETERS
d3dpp
;
D3DDISPLAYMODE
d3ddm
;
DWORD
vs
,
ps
;
static
const
DWORD
vs_2_0
[]
=
{
0xfffe0200
,
/* vs_2_0 */
0x0200001f
,
0x80000000
,
0x900f0000
,
/* dcl_position v0 */
0x02000001
,
0x800f0001
,
0xa0e40001
,
/* mov r1, c1 */
0x03000002
,
0xd00f0000
,
0x80e40001
,
0xa0e40002
,
/* add oD0, r1, c2 */
0x02000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x0000ffff
/* end */
};
static
const
DWORD
ps_2_0
[]
=
{
0xffff0200
,
/* ps_2_0 */
0x02000001
,
0x800f0001
,
0xa0e40001
,
/* mov r1, c1 */
0x03000002
,
0x800f0000
,
0x80e40001
,
0xa0e40002
,
/* add r0, r1, c2 */
0x02000001
,
0x800f0800
,
0x80e40000
,
/* mov oC0, r0 */
0x0000ffff
/* end */
};
static
const
DWORD
decl
[]
=
{
D3DVSD_STREAM
(
0
),
D3DVSD_REG
(
D3DVSDE_POSITION
,
D3DVSDT_FLOAT3
),
D3DVSD_END
()
};
d3d
=
pDirect3DCreate8
(
D3D_SDK_VERSION
);
ok
(
d3d
!=
NULL
,
"Failed to create IDirect3D8 object
\n
"
);
hwnd
=
CreateWindow
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
160
,
160
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"Failed to create window
\n
"
);
if
(
!
d3d
||
!
hwnd
)
goto
cleanup
;
IDirect3D8_GetAdapterDisplayMode
(
d3d
,
D3DADAPTER_DEFAULT
,
&
d3ddm
);
ZeroMemory
(
&
d3dpp
,
sizeof
(
d3dpp
));
d3dpp
.
Windowed
=
TRUE
;
d3dpp
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
d3dpp
.
BackBufferWidth
=
800
;
d3dpp
.
BackBufferHeight
=
600
;
d3dpp
.
BackBufferFormat
=
d3ddm
.
Format
;
hr
=
IDirect3D8_CreateDevice
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
hwnd
,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
d3dpp
,
&
device
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_INVALIDCALL
||
broken
(
hr
==
D3DERR_NOTAVAILABLE
),
"IDirect3D8_CreateDevice failed with %#08x
\n
"
,
hr
);
if
(
!
device
)
{
skip
(
"could not create device, IDirect3D8_CreateDevice returned %#08x
\n
"
,
hr
);
goto
cleanup
;
}
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
simple_ps
,
&
vs
,
0
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice8_CreateVertexShader returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
device
,
simple_vs
,
&
ps
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice8_CreatePixelShader returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
vs_2_0
,
&
vs
,
0
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice8_CreateVertexShader returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
device
,
ps_2_0
,
&
ps
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice8_CreatePixelShader returned %#08x
\n
"
,
hr
);
cleanup:
if
(
device
)
{
UINT
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
if
(
d3d
)
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
device
)
START_TEST
(
device
)
{
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
@@ -2751,6 +2833,7 @@ START_TEST(device)
...
@@ -2751,6 +2833,7 @@ START_TEST(device)
test_wndproc_windowed
();
test_wndproc_windowed
();
test_depth_stencil_size
();
test_depth_stencil_size
();
test_window_style
();
test_window_style
();
test_wrong_shader
();
}
}
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
}
}
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