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
f329a2b5
Commit
f329a2b5
authored
Apr 10, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Use a separate device for maxmip_test().
parent
4cb68d23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
24 deletions
+38
-24
visual.c
dlls/d3d9/tests/visual.c
+38
-24
No files found.
dlls/d3d9/tests/visual.c
View file @
f329a2b5
...
...
@@ -3472,12 +3472,18 @@ out:
}
}
static
void
maxmip_test
(
IDirect3DDevice9
*
device
)
static
void
maxmip_test
(
void
)
{
IDirect3DTexture9
*
texture
=
NULL
;
IDirect3DSurface9
*
surface
=
NULL
;
IDirect3DTexture9
*
texture
;
IDirect3DSurface9
*
surface
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
D3DCOLOR
color
;
ULONG
refcount
;
D3DCAPS9
caps
;
HWND
window
;
HRESULT
hr
;
DWORD
color
;
static
const
struct
{
struct
...
...
@@ -3515,15 +3521,29 @@ static void maxmip_test(IDirect3DDevice9 *device)
}},
};
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
128
,
128
,
3
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateTexture failed with %08x
\n
"
,
hr
);
if
(
!
texture
)
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
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create test texture
\n
"
);
return
;
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_MIPMAP
))
{
skip
(
"No mipmap support, skipping tests.
\n
"
);
IDirect3DDevice9_Release
(
device
);
goto
done
;
}
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
128
,
128
,
3
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DTexture9_GetSurfaceLevel returned %#x.
\n
"
,
hr
);
fill_surface
(
surface
,
0xffff0000
,
0
);
...
...
@@ -3542,6 +3562,8 @@ static void maxmip_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
|
D3DFVF_TEX1
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetFVF failed with %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable lighting, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MIPFILTER
,
D3DTEXF_NONE
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetSamplerState failed with %08x
\n
"
,
hr
);
...
...
@@ -3696,13 +3718,12 @@ static void maxmip_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (0x%08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetTexture failed with %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MIPFILTER
,
D3DTEXF_NONE
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetSamplerState failed with %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_MAXMIPLEVEL
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetSamplerState failed with %08x
\n
"
,
hr
);
IDirect3DTexture9_Release
(
texture
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
release_buffer_test
(
void
)
...
...
@@ -16660,18 +16681,11 @@ START_TEST(visual)
skip
(
"No cube texture support
\n
"
);
}
z_range_test
(
device_ptr
);
if
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_MIPMAP
)
{
maxmip_test
(
device_ptr
);
}
else
{
skip
(
"No mipmap support
\n
"
);
}
cleanup_device
(
device_ptr
);
device_ptr
=
NULL
;
maxmip_test
();
offscreen_test
();
ds_size_test
();
alpha_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