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
c1843c87
Commit
c1843c87
authored
Nov 08, 2010
by
Matteo Bruni
Committed by
Alexandre Julliard
Nov 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement D3DXCheckVolumeTextureRequirements.
parent
363d180a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
184 additions
and
1 deletion
+184
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
texture.c
dlls/d3dx9_36/tests/texture.c
+109
-0
texture.c
dlls/d3dx9_36/texture.c
+74
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
c1843c87
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
@ stdcall D3DXCheckCubeTextureRequirements(ptr ptr ptr long ptr ptr)
@ stdcall D3DXCheckCubeTextureRequirements(ptr ptr ptr long ptr ptr)
@ stdcall D3DXCheckTextureRequirements(ptr ptr ptr ptr long ptr ptr)
@ stdcall D3DXCheckTextureRequirements(ptr ptr ptr ptr long ptr ptr)
@ stdcall D3DXCheckVersion(long long)
@ stdcall D3DXCheckVersion(long long)
@ st
ub D3DXCheckVolumeTextureRequirements
@ st
dcall D3DXCheckVolumeTextureRequirements(ptr ptr ptr ptr ptr long ptr ptr)
@ stub D3DXCleanMesh
@ stub D3DXCleanMesh
@ stdcall D3DXColorAdjustContrast(ptr ptr float)
@ stdcall D3DXColorAdjustContrast(ptr ptr float)
@ stdcall D3DXColorAdjustSaturation(ptr ptr float)
@ stdcall D3DXColorAdjustSaturation(ptr ptr float)
...
...
dlls/d3dx9_36/tests/texture.c
View file @
c1843c87
...
@@ -278,6 +278,114 @@ static void test_D3DXCheckCubeTextureRequirements(IDirect3DDevice9 *device)
...
@@ -278,6 +278,114 @@ static void test_D3DXCheckCubeTextureRequirements(IDirect3DDevice9 *device)
ok
(
format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_X8R8G8B8
);
ok
(
format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_X8R8G8B8
);
}
}
static
void
test_D3DXCheckVolumeTextureRequirements
(
IDirect3DDevice9
*
device
)
{
UINT
width
,
height
,
depth
,
mipmaps
;
D3DFORMAT
format
;
D3DCAPS9
caps
;
HRESULT
hr
;
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_VOLUMEMAP
))
{
skip
(
"No volume textures support
\n
"
);
return
;
}
/* general tests */
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
D3DX_DEFAULT
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXCheckVolumeTextureRequirements
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
D3DX_DEFAULT
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
/* width, height, depth */
width
=
height
=
depth
=
D3DX_DEFAULT
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
&
height
,
&
depth
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
256
,
"Returned width %d, expected %d
\n
"
,
width
,
256
);
ok
(
height
==
256
,
"Returned height %d, expected %d
\n
"
,
height
,
256
);
ok
(
depth
==
1
,
"Returned depth %d, expected %d
\n
"
,
depth
,
1
);
width
=
D3DX_DEFAULT
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
256
,
"Returned width %d, expected %d
\n
"
,
width
,
256
);
width
=
D3DX_DEFAULT
;
height
=
0
;
depth
=
0
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
&
height
,
&
depth
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
ok
(
height
==
1
,
"Returned height %d, expected %d
\n
"
,
height
,
1
);
ok
(
depth
==
1
,
"Returned height %d, expected %d
\n
"
,
depth
,
1
);
width
=
0
;
height
=
0
;
depth
=
0
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
&
height
,
&
depth
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
ok
(
height
==
1
,
"Returned height %d, expected %d
\n
"
,
height
,
1
);
ok
(
depth
==
1
,
"Returned height %d, expected %d
\n
"
,
depth
,
1
);
width
=
0
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
1
,
"Returned width %d, expected %d
\n
"
,
width
,
1
);
width
=
0xFFFFFFFE
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
width
==
caps
.
MaxVolumeExtent
,
"Returned width %d, expected %d
\n
"
,
width
,
caps
.
MaxVolumeExtent
);
/* format */
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
format
=
D3DFMT_UNKNOWN
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_A8R8G8B8
);
format
=
D3DX_DEFAULT
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_A8R8G8B8
);
format
=
D3DFMT_R8G8B8
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
&
format
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
format
,
D3DFMT_X8R8G8B8
);
/* mipmaps */
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_MIPVOLUMEMAP
))
{
skip
(
"No volume textures mipmapping support
\n
"
);
return
;
}
width
=
height
=
depth
=
64
;
mipmaps
=
9
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
&
height
,
&
depth
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
7
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
7
);
width
=
284
;
height
=
143
;
depth
=
55
;
mipmaps
=
20
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
&
width
,
&
height
,
&
depth
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
10
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
10
);
mipmaps
=
0
;
hr
=
D3DXCheckVolumeTextureRequirements
(
device
,
NULL
,
NULL
,
NULL
,
&
mipmaps
,
0
,
NULL
,
D3DPOOL_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXCheckVolumeTextureRequirements returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
ok
(
mipmaps
==
9
,
"Returned mipmaps %d, expected %d
\n
"
,
mipmaps
,
9
);
}
static
void
test_D3DXCreateTexture
(
IDirect3DDevice9
*
device
)
static
void
test_D3DXCreateTexture
(
IDirect3DDevice9
*
device
)
{
{
IDirect3DTexture9
*
texture
;
IDirect3DTexture9
*
texture
;
...
@@ -581,6 +689,7 @@ START_TEST(texture)
...
@@ -581,6 +689,7 @@ START_TEST(texture)
test_D3DXCheckTextureRequirements
(
device
);
test_D3DXCheckTextureRequirements
(
device
);
test_D3DXCheckCubeTextureRequirements
(
device
);
test_D3DXCheckCubeTextureRequirements
(
device
);
test_D3DXCheckVolumeTextureRequirements
(
device
);
test_D3DXCreateTexture
(
device
);
test_D3DXCreateTexture
(
device
);
test_D3DXFilterTexture
(
device
);
test_D3DXFilterTexture
(
device
);
...
...
dlls/d3dx9_36/texture.c
View file @
c1843c87
...
@@ -383,6 +383,80 @@ HRESULT WINAPI D3DXCheckCubeTextureRequirements(LPDIRECT3DDEVICE9 device,
...
@@ -383,6 +383,80 @@ HRESULT WINAPI D3DXCheckCubeTextureRequirements(LPDIRECT3DDEVICE9 device,
return
hr
;
return
hr
;
}
}
HRESULT
WINAPI
D3DXCheckVolumeTextureRequirements
(
LPDIRECT3DDEVICE9
device
,
UINT
*
width
,
UINT
*
height
,
UINT
*
depth
,
UINT
*
miplevels
,
DWORD
usage
,
D3DFORMAT
*
format
,
D3DPOOL
pool
)
{
D3DCAPS9
caps
;
UINT
w
=
width
?
*
width
:
D3DX_DEFAULT
;
UINT
h
=
height
?
*
height
:
D3DX_DEFAULT
;
UINT
d
=
(
depth
&&
*
depth
)
?
*
depth
:
1
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %p, %p, %p, %u, %p, %u)
\n
"
,
device
,
width
,
height
,
depth
,
miplevels
,
usage
,
format
,
pool
);
if
(
!
device
||
FAILED
(
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
)))
return
D3DERR_INVALIDCALL
;
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_VOLUMEMAP
))
return
D3DERR_NOTAVAILABLE
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
w
,
&
h
,
NULL
,
usage
,
format
,
pool
);
if
(
d
==
D3DX_DEFAULT
)
d
=
1
;
/* ensure width/height is power of 2 */
if
((
caps
.
TextureCaps
&
D3DPTEXTURECAPS_VOLUMEMAP_POW2
)
&&
(
!
is_pow2
(
w
)
||
!
is_pow2
(
h
)
||
!
is_pow2
(
d
)))
{
w
=
make_pow2
(
w
);
h
=
make_pow2
(
h
);
d
=
make_pow2
(
d
);
}
if
(
w
>
caps
.
MaxVolumeExtent
)
w
=
caps
.
MaxVolumeExtent
;
if
(
h
>
caps
.
MaxVolumeExtent
)
h
=
caps
.
MaxVolumeExtent
;
if
(
d
>
caps
.
MaxVolumeExtent
)
d
=
caps
.
MaxVolumeExtent
;
if
(
miplevels
)
{
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_MIPVOLUMEMAP
))
*
miplevels
=
1
;
else
{
UINT
max_mipmaps
=
1
;
UINT
max_dimen
=
max
(
max
(
w
,
h
),
d
);
while
(
max_dimen
>
1
)
{
max_dimen
>>=
1
;
max_mipmaps
++
;
}
if
(
*
miplevels
==
0
||
*
miplevels
>
max_mipmaps
)
*
miplevels
=
max_mipmaps
;
}
}
if
(
width
)
*
width
=
w
;
if
(
height
)
*
height
=
h
;
if
(
depth
)
*
depth
=
d
;
return
hr
;
}
HRESULT
WINAPI
D3DXCreateTexture
(
LPDIRECT3DDEVICE9
pDevice
,
HRESULT
WINAPI
D3DXCreateTexture
(
LPDIRECT3DDEVICE9
pDevice
,
UINT
width
,
UINT
width
,
UINT
height
,
UINT
height
,
...
...
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