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
e70adcd8
Commit
e70adcd8
authored
Jul 24, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Only test pixel shaders if they are supported.
parent
19c574b7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
device.c
dlls/d3d8/tests/device.c
+25
-16
No files found.
dlls/d3d8/tests/device.c
View file @
e70adcd8
...
@@ -854,6 +854,7 @@ static void test_shader(void)
...
@@ -854,6 +854,7 @@ static void test_shader(void)
DWORD
hPixelShader
=
0
,
hVertexShader
=
0
;
DWORD
hPixelShader
=
0
,
hVertexShader
=
0
;
DWORD
hPixelShader2
=
0
,
hVertexShader2
=
0
;
DWORD
hPixelShader2
=
0
,
hVertexShader2
=
0
;
DWORD
hTempHandle
;
DWORD
hTempHandle
;
D3DCAPS8
caps
;
DWORD
data_size
;
DWORD
data_size
;
void
*
data
;
void
*
data
;
...
@@ -886,6 +887,7 @@ static void test_shader(void)
...
@@ -886,6 +887,7 @@ static void test_shader(void)
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
d3dpp
,
&
pDevice
);
D3DCREATE_SOFTWARE_VERTEXPROCESSING
,
&
d3dpp
,
&
pDevice
);
ok
(
hr
==
D3D_OK
,
"IDirect3D8_CreateDevice failed with %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3D8_CreateDevice failed with %s
\n
"
,
DXGetErrorString8
(
hr
));
if
(
!
pDevice
)
goto
cleanup
;
if
(
!
pDevice
)
goto
cleanup
;
IDirect3DDevice8_GetDeviceCaps
(
pDevice
,
&
caps
);
/* First create a vertex shader */
/* First create a vertex shader */
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
simple_vs
,
&
hVertexShader
,
0
);
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
simple_vs
,
&
hVertexShader
,
0
);
...
@@ -940,6 +942,8 @@ static void test_shader(void)
...
@@ -940,6 +942,8 @@ static void test_shader(void)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_GetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_GetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hTempHandle
==
0
,
"Vertex Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
0
);
ok
(
hTempHandle
==
0
,
"Vertex Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
0
);
if
(
caps
.
PixelShaderVersion
>=
D3DPS_VERSION
(
1
,
0
))
{
/* The same with a pixel shader */
/* The same with a pixel shader */
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreatePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreatePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
...
@@ -978,22 +982,6 @@ static void test_shader(void)
...
@@ -978,22 +982,6 @@ static void test_shader(void)
ok
(
hTempHandle
==
0
,
"Pixel Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
0
);
ok
(
hTempHandle
==
0
,
"Pixel Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
0
);
/* What happens if a non-bound shader is deleted? */
/* What happens if a non-bound shader is deleted? */
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
NULL
,
&
hVertexShader
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
NULL
,
&
hVertexShader2
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_SetVertexShader
(
pDevice
,
hVertexShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_DeleteVertexShader
(
pDevice
,
hVertexShader2
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeleteVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_GetVertexShader
(
pDevice
,
&
hTempHandle
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_GetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hTempHandle
==
hVertexShader
,
"Vertex Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
hVertexShader
);
hr
=
IDirect3DDevice8_DeleteVertexShader
(
pDevice
,
hVertexShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeleteVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
/* Now for pixel shaders */
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreatePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreatePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader2
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
pDevice
,
simple_ps
,
&
hPixelShader2
);
...
@@ -1008,6 +996,27 @@ static void test_shader(void)
...
@@ -1008,6 +996,27 @@ static void test_shader(void)
ok
(
hTempHandle
==
hPixelShader
,
"Pixel Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
hPixelShader
);
ok
(
hTempHandle
==
hPixelShader
,
"Pixel Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
hPixelShader
);
hr
=
IDirect3DDevice8_DeletePixelShader
(
pDevice
,
hPixelShader
);
hr
=
IDirect3DDevice8_DeletePixelShader
(
pDevice
,
hPixelShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeletePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeletePixelShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
}
else
{
skip
(
"Pixel shaders not supported
\n
"
);
}
/* What happens if a non-bound shader is deleted? */
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
NULL
,
&
hVertexShader
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_CreateVertexShader
(
pDevice
,
dwVertexDecl
,
NULL
,
&
hVertexShader2
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_SetVertexShader
(
pDevice
,
hVertexShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_DeleteVertexShader
(
pDevice
,
hVertexShader2
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeleteVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
hr
=
IDirect3DDevice8_GetVertexShader
(
pDevice
,
&
hTempHandle
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_GetVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hTempHandle
==
hVertexShader
,
"Vertex Shader %d is set, expected shader %d
\n
"
,
hTempHandle
,
hVertexShader
);
hr
=
IDirect3DDevice8_DeleteVertexShader
(
pDevice
,
hVertexShader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_DeleteVertexShader returned %s
\n
"
,
DXGetErrorString8
(
hr
));
cleanup:
cleanup:
if
(
pD3d
)
IDirect3D8_Release
(
pD3d
);
if
(
pD3d
)
IDirect3D8_Release
(
pD3d
);
...
...
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