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
c868f2d3
Commit
c868f2d3
authored
Mar 14, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Use a separate device for volume_dxt5_test().
parent
c2148f9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
19 deletions
+29
-19
visual.c
dlls/d3d9/tests/visual.c
+29
-19
No files found.
dlls/d3d9/tests/visual.c
View file @
c868f2d3
...
...
@@ -14748,14 +14748,18 @@ static void volume_srgb_test(IDirect3DDevice9 *device)
ok
(
SUCCEEDED
(
hr
),
"Failed to set srgb state, hr %#x.
\n
"
,
hr
);
}
static
void
volume_dxt5_test
(
IDirect3DDevice9
*
device
)
static
void
volume_dxt5_test
(
void
)
{
HRESULT
hr
;
IDirect3D9
*
d3d9
;
IDirect3DVolumeTexture9
*
texture
;
IDirect3DDevice9
*
device
;
D3DLOCKED_BOX
box
;
IDirect3D9
*
d3d
;
unsigned
int
i
;
ULONG
refcount
;
DWORD
color
;
HWND
window
;
HRESULT
hr
;
static
const
char
texture_data
[]
=
{
/* A 8x4x2 texture consisting of 4 4x4 blocks. The colors of the blocks are red, green, blue and white. */
...
...
@@ -14772,26 +14776,31 @@ static void volume_dxt5_test(IDirect3DDevice9 *device)
quads
[]
=
{
{{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
0
.
0
f
,
0
.
25
f
}},
{{
0
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
0
.
0
f
,
0
.
25
f
}},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
1
.
0
f
,
0
.
25
f
}},
{{
0
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
0
.
0
f
,
0
.
25
f
}},
{{
0
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
0
.
25
f
}},
{{
0
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
0
.
0
f
,
0
.
75
f
}},
{{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
0
.
0
f
,
0
.
75
f
}},
{{
0
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
1
.
0
f
,
0
.
75
f
}},
{{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
0
.
0
f
,
0
.
75
f
}},
{{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
0
.
75
f
}},
};
static
const
DWORD
expected_colors
[]
=
{
0x00ff0000
,
0x0000ff00
,
0x000000ff
,
0x00ffffff
};
hr
=
IDirect3DDevice9_GetDirect3D
(
device
,
&
d3d9
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get d3d9 interface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3D9_CheckDeviceFormat
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_VOLUMETEXTURE
,
D3DFMT_DXT5
);
IDirect3D9_Release
(
d3d9
);
if
(
FAILED
(
hr
))
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
FAILED
(
IDirect3D9_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
0
,
D3DRTYPE_VOLUMETEXTURE
,
D3DFMT_DXT5
)
))
{
skip
(
"Volume dxt5 textures are not supported, skipping test.
\n
"
);
return
;
skip
(
"DXT5 volume textures are not supported, skipping test.
\n
"
);
goto
done
;
}
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice9_CreateVolumeTexture
(
device
,
8
,
4
,
2
,
1
,
0
,
D3DFMT_DXT5
,
...
...
@@ -14817,7 +14826,7 @@ static void volume_dxt5_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MAGFILTER
,
D3DTEXF_POINT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set mag filter, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x00ff00ff
,
0
.
0
f
,
0
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0x00ff00ff
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
...
...
@@ -14837,11 +14846,12 @@ static void volume_dxt5_test(IDirect3DDevice9 *device)
"Expected color 0x%08x, got 0x%08x, case %u.
\n
"
,
expected_colors
[
i
],
color
,
i
);
}
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_COLOROP
,
D3DTOP_DISABLE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set color op, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set texture, hr %#x.
\n
"
,
hr
);
IDirect3DVolumeTexture9_Release
(
texture
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
volume_v16u16_test
(
IDirect3DDevice9
*
device
)
...
...
@@ -15501,11 +15511,11 @@ START_TEST(visual)
zenable_test
(
device_ptr
);
fog_special_test
(
device_ptr
);
volume_srgb_test
(
device_ptr
);
volume_dxt5_test
(
device_ptr
);
cleanup_device
(
device_ptr
);
device_ptr
=
NULL
;
volume_dxt5_test
();
add_dirty_rect_test
();
multisampled_depth_buffer_test
();
resz_test
();
...
...
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