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
be65d6ab
Commit
be65d6ab
authored
Nov 27, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core/tests: Don't reuse the device.
parent
35a88f5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
27 deletions
+91
-27
device.c
dlls/d3d10core/tests/device.c
+91
-27
No files found.
dlls/d3d10core/tests/device.c
View file @
be65d6ab
...
...
@@ -74,11 +74,19 @@ cleanup:
return
device
;
}
static
void
test_device_interfaces
(
ID3D10Device
*
device
)
static
void
test_device_interfaces
(
void
)
{
ID3D10Device
*
device
;
ULONG
refcount
;
IUnknown
*
obj
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
if
(
SUCCEEDED
(
hr
=
ID3D10Device_QueryInterface
(
device
,
&
IID_IUnknown
,
(
void
**
)
&
obj
)))
IUnknown_Release
(
obj
);
ok
(
SUCCEEDED
(
hr
),
"ID3D10Device does not implement IUnknown
\n
"
);
...
...
@@ -94,15 +102,26 @@ static void test_device_interfaces(ID3D10Device *device)
if
(
SUCCEEDED
(
hr
=
ID3D10Device_QueryInterface
(
device
,
&
IID_ID3D10Device
,
(
void
**
)
&
obj
)))
IUnknown_Release
(
obj
);
ok
(
SUCCEEDED
(
hr
),
"ID3D10Device does not implement ID3D10Device
\n
"
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
}
static
void
test_create_texture2d
(
ID3D10Device
*
device
)
static
void
test_create_texture2d
(
void
)
{
D3D10_TEXTURE2D_DESC
desc
;
ID3D10Texture2D
*
texture
;
IDXGISurface
*
surface
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
desc
.
Width
=
512
;
desc
.
Height
=
512
;
desc
.
MipLevels
=
1
;
...
...
@@ -154,15 +173,26 @@ static void test_create_texture2d(ID3D10Device *device)
ok
(
FAILED
(
hr
),
"Texture should not implement IDXGISurface
\n
"
);
if
(
SUCCEEDED
(
hr
))
IDXGISurface_Release
(
surface
);
ID3D10Texture2D_Release
(
texture
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_texture3d
(
ID3D10Device
*
device
)
static
void
test_create_texture3d
(
void
)
{
D3D10_TEXTURE3D_DESC
desc
;
ID3D10Texture3D
*
texture
;
IDXGISurface
*
surface
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
desc
.
Width
=
64
;
desc
.
Height
=
64
;
desc
.
Depth
=
64
;
...
...
@@ -200,16 +230,27 @@ static void test_create_texture3d(ID3D10Device *device)
ok
(
FAILED
(
hr
),
"Texture should not implement IDXGISurface.
\n
"
);
if
(
SUCCEEDED
(
hr
))
IDXGISurface_Release
(
surface
);
ID3D10Texture3D_Release
(
texture
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_depthstencil_view
(
ID3D10Device
*
device
)
static
void
test_create_depthstencil_view
(
void
)
{
D3D10_DEPTH_STENCIL_VIEW_DESC
dsv_desc
;
D3D10_TEXTURE2D_DESC
texture_desc
;
ID3D10DepthStencilView
*
dsview
;
ID3D10Texture2D
*
texture
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
texture_desc
.
Width
=
512
;
texture_desc
.
Height
=
512
;
texture_desc
.
MipLevels
=
1
;
...
...
@@ -236,9 +277,12 @@ static void test_create_depthstencil_view(ID3D10Device *device)
ID3D10DepthStencilView_Release
(
dsview
);
ID3D10Texture2D_Release
(
texture
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_rendertarget_view
(
ID3D10Device
*
device
)
static
void
test_create_rendertarget_view
(
void
)
{
D3D10_RENDER_TARGET_VIEW_DESC
rtv_desc
;
D3D10_TEXTURE2D_DESC
texture_desc
;
...
...
@@ -246,8 +290,16 @@ static void test_create_rendertarget_view(ID3D10Device *device)
ID3D10RenderTargetView
*
rtview
;
ID3D10Texture2D
*
texture
;
ID3D10Buffer
*
buffer
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
buffer_desc
.
ByteWidth
=
1024
;
buffer_desc
.
Usage
=
D3D10_USAGE_DEFAULT
;
buffer_desc
.
BindFlags
=
D3D10_BIND_RENDER_TARGET
;
...
...
@@ -295,9 +347,12 @@ static void test_create_rendertarget_view(ID3D10Device *device)
ID3D10RenderTargetView_Release
(
rtview
);
ID3D10Texture2D_Release
(
texture
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_shader_resource_view
(
ID3D10Device
*
device
)
static
void
test_create_shader_resource_view
(
void
)
{
D3D10_SHADER_RESOURCE_VIEW_DESC
srv_desc
;
D3D10_TEXTURE2D_DESC
texture_desc
;
...
...
@@ -305,8 +360,16 @@ static void test_create_shader_resource_view(ID3D10Device *device)
D3D10_BUFFER_DESC
buffer_desc
;
ID3D10Texture2D
*
texture
;
ID3D10Buffer
*
buffer
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
buffer_desc
.
ByteWidth
=
1024
;
buffer_desc
.
Usage
=
D3D10_USAGE_DEFAULT
;
buffer_desc
.
BindFlags
=
D3D10_BIND_SHADER_RESOURCE
;
...
...
@@ -358,9 +421,12 @@ static void test_create_shader_resource_view(ID3D10Device *device)
ID3D10ShaderResourceView_Release
(
srview
);
ID3D10Texture2D_Release
(
texture
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_shader
(
ID3D10Device
*
device
)
static
void
test_create_shader
(
void
)
{
#if 0
float4 light;
...
...
@@ -471,8 +537,16 @@ float4 main(const float4 color : COLOR) : SV_TARGET
ID3D10VertexShader
*
vs
=
NULL
;
ID3D10PixelShader
*
ps
=
NULL
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device, skipping tests.
\n
"
);
return
;
}
hr
=
ID3D10Device_CreateVertexShader
(
device
,
vs_4_0
,
sizeof
(
vs_4_0
),
&
vs
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create SM4 vertex shader, hr %#x
\n
"
,
hr
);
if
(
vs
)
...
...
@@ -491,28 +565,18 @@ float4 main(const float4 color : COLOR) : SV_TARGET
ok
(
SUCCEEDED
(
hr
),
"Failed to create SM4 vertex shader, hr %#x
\n
"
,
hr
);
if
(
ps
)
ID3D10PixelShader_Release
(
ps
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
START_TEST
(
device
)
{
ID3D10Device
*
device
;
ULONG
refcount
;
device
=
create_device
();
if
(
!
device
)
{
skip
(
"Failed to create device, skipping tests
\n
"
);
return
;
}
test_device_interfaces
(
device
);
test_create_texture2d
(
device
);
test_create_texture3d
(
device
);
test_create_depthstencil_view
(
device
);
test_create_rendertarget_view
(
device
);
test_create_shader_resource_view
(
device
);
test_create_shader
(
device
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
test_device_interfaces
();
test_create_texture2d
();
test_create_texture3d
();
test_create_depthstencil_view
();
test_create_rendertarget_view
();
test_create_shader_resource_view
();
test_create_shader
();
}
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