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
438fa44d
Commit
438fa44d
authored
Feb 28, 2008
by
Jason Green
Committed by
Alexandre Julliard
Feb 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add tests showing the D3DUSAGE_RENDERTARGET and D3DUSAGE_AUTOGENMIPMAP are mutually exlusive.
parent
8c758a62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
texture.c
dlls/d3d9/tests/texture.c
+46
-1
No files found.
dlls/d3d9/tests/texture.c
View file @
438fa44d
...
...
@@ -115,19 +115,55 @@ static void test_cube_texture_from_pool(IDirect3DDevice9 *device_ptr, DWORD caps
if
(
texture_ptr
)
IDirect3DCubeTexture9_Release
(
texture_ptr
);
}
static
void
test_cube_texture_mipmap_gen
(
IDirect3DDevice9
*
device_ptr
)
{
IDirect3DCubeTexture9
*
texture_ptr
=
NULL
;
IDirect3D9
*
d3d9
;
HRESULT
hr
;
hr
=
IDirect3DDevice9_GetDirect3D
(
device_ptr
,
&
d3d9
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_GetDirect3D returned 0x%08x
\n
"
,
hr
);
hr
=
IDirect3D9_CheckDeviceFormat
(
d3d9
,
0
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
D3DUSAGE_AUTOGENMIPMAP
,
D3DRTYPE_CUBETEXTURE
,
D3DFMT_X8R8G8B8
);
if
(
FAILED
(
hr
))
{
skip
(
"No cube mipmap generation support
\n
"
);
return
;
}
/* testing shows that autogenmipmap and rendertarget are mutually exclusive options */
hr
=
IDirect3DDevice9_CreateCubeTexture
(
device_ptr
,
64
,
0
,
(
D3DUSAGE_RENDERTARGET
|
D3DUSAGE_AUTOGENMIPMAP
),
D3DFMT_X8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture_ptr
,
0
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
if
(
texture_ptr
)
IDirect3DCubeTexture9_Release
(
texture_ptr
);
texture_ptr
=
NULL
;
hr
=
IDirect3DDevice9_CreateCubeTexture
(
device_ptr
,
64
,
0
,
D3DUSAGE_AUTOGENMIPMAP
,
D3DFMT_X8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture_ptr
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateTexture failed (0x%08x)
\n
"
,
hr
);
if
(
texture_ptr
)
IDirect3DCubeTexture9_Release
(
texture_ptr
);
texture_ptr
=
NULL
;
}
static
void
test_cube_textures
(
IDirect3DDevice9
*
device_ptr
,
DWORD
caps
)
{
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_DEFAULT
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_MANAGED
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SYSTEMMEM
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SCRATCH
,
FALSE
);
test_cube_texture_mipmap_gen
(
device_ptr
);
}
static
void
test_mipmap_gen
(
IDirect3DDevice9
*
device
)
{
HRESULT
hr
;
IDirect3D9
*
d3d9
;
IDirect3DTexture9
*
texture
;
IDirect3DTexture9
*
texture
=
NULL
;
IDirect3DSurface9
*
surface
;
DWORD
levels
;
D3DSURFACE_DESC
desc
;
...
...
@@ -146,6 +182,15 @@ static void test_mipmap_gen(IDirect3DDevice9 *device)
return
;
}
/* testing shows that autogenmipmap and rendertarget are mutually exclusive options */
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
64
,
64
,
0
,
(
D3DUSAGE_RENDERTARGET
|
D3DUSAGE_AUTOGENMIPMAP
),
D3DFMT_X8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture
,
0
);
todo_wine
ok
(
hr
==
D3DERR_INVALIDCALL
,
"IDirect3DDevice9_CreateTexture returned 0x%08x, expected 0x%08x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
if
(
texture
)
IDirect3DTexture9_Release
(
texture
);
texture
=
NULL
;
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
64
,
64
,
0
,
D3DUSAGE_AUTOGENMIPMAP
,
D3DFMT_X8R8G8B8
,
D3DPOOL_MANAGED
,
&
texture
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateTexture failed(%08x)
\n
"
,
hr
);
...
...
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