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
7742fe28
Commit
7742fe28
authored
Jan 26, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Add a small test for CreateRenderTargetView().
parent
2953d814
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
device.c
dlls/d3d10core/tests/device.c
+60
-0
No files found.
dlls/d3d10core/tests/device.c
View file @
7742fe28
...
...
@@ -140,6 +140,65 @@ static void test_create_texture(ID3D10Device *device)
ID3D10Texture2D_Release
(
texture
);
}
static
void
test_create_rendertarget_view
(
ID3D10Device
*
device
)
{
D3D10_RENDER_TARGET_VIEW_DESC
rtv_desc
;
D3D10_TEXTURE2D_DESC
texture_desc
;
D3D10_BUFFER_DESC
buffer_desc
;
ID3D10RenderTargetView
*
rtview
;
ID3D10Texture2D
*
texture
;
ID3D10Buffer
*
buffer
;
HRESULT
hr
;
buffer_desc
.
ByteWidth
=
1024
;
buffer_desc
.
Usage
=
D3D10_USAGE_DEFAULT
;
buffer_desc
.
BindFlags
=
D3D10_BIND_RENDER_TARGET
;
buffer_desc
.
CPUAccessFlags
=
0
;
buffer_desc
.
MiscFlags
=
0
;
hr
=
ID3D10Device_CreateBuffer
(
device
,
&
buffer_desc
,
NULL
,
&
buffer
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a buffer, hr %#x
\n
"
,
hr
);
rtv_desc
.
Format
=
DXGI_FORMAT_R32G32B32A32_FLOAT
;
rtv_desc
.
ViewDimension
=
D3D10_RTV_DIMENSION_BUFFER
;
rtv_desc
.
Buffer
.
ElementOffset
=
0
;
rtv_desc
.
Buffer
.
ElementWidth
=
64
;
hr
=
ID3D10Device_CreateRenderTargetView
(
device
,
(
ID3D10Resource
*
)
buffer
,
&
rtv_desc
,
&
rtview
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a rendertarget view, hr %#x
\n
"
,
hr
);
ID3D10RenderTargetView_Release
(
rtview
);
ID3D10Buffer_Release
(
buffer
);
texture_desc
.
Width
=
512
;
texture_desc
.
Height
=
512
;
texture_desc
.
MipLevels
=
1
;
texture_desc
.
ArraySize
=
1
;
texture_desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
texture_desc
.
SampleDesc
.
Count
=
1
;
texture_desc
.
SampleDesc
.
Quality
=
0
;
texture_desc
.
Usage
=
D3D10_USAGE_DEFAULT
;
texture_desc
.
BindFlags
=
D3D10_BIND_RENDER_TARGET
;
texture_desc
.
CPUAccessFlags
=
0
;
texture_desc
.
MiscFlags
=
0
;
hr
=
ID3D10Device_CreateTexture2D
(
device
,
&
texture_desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 2d texture, hr %#x
\n
"
,
hr
);
/* For texture resources it's allowed to specify NULL as desc */
hr
=
ID3D10Device_CreateRenderTargetView
(
device
,
(
ID3D10Resource
*
)
texture
,
NULL
,
&
rtview
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a rendertarget view, hr %#x
\n
"
,
hr
);
ID3D10RenderTargetView_GetDesc
(
rtview
,
&
rtv_desc
);
ok
(
rtv_desc
.
Format
==
texture_desc
.
Format
,
"Expected format %#x, got %#x
\n
"
,
texture_desc
.
Format
,
rtv_desc
.
Format
);
ok
(
rtv_desc
.
ViewDimension
==
D3D10_RTV_DIMENSION_TEXTURE2D
,
"Expected view dimension D3D10_RTV_DIMENSION_TEXTURE2D, got %#x
\n
"
,
rtv_desc
.
ViewDimension
);
ok
(
rtv_desc
.
Texture2D
.
MipSlice
==
0
,
"Expected mip slice 0, got %#x
\n
"
,
rtv_desc
.
Texture2D
.
MipSlice
);
ID3D10RenderTargetView_Release
(
rtview
);
ID3D10Texture2D_Release
(
texture
);
}
START_TEST
(
device
)
{
ID3D10Device
*
device
;
...
...
@@ -154,6 +213,7 @@ START_TEST(device)
test_device_interfaces
(
device
);
test_create_texture
(
device
);
test_create_rendertarget_view
(
device
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
...
...
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