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
ffe36a38
Commit
ffe36a38
authored
Jul 13, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Jul 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement volume texture filtering in D3DXFilterTexture.
parent
e8bfaf17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
5 deletions
+71
-5
texture.c
dlls/d3dx9_36/tests/texture.c
+27
-0
texture.c
dlls/d3dx9_36/texture.c
+44
-5
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
ffe36a38
...
...
@@ -751,6 +751,7 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
{
IDirect3DTexture9
*
tex
;
IDirect3DCubeTexture9
*
cubetex
;
IDirect3DVolumeTexture9
*
voltex
;
HRESULT
hr
;
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
256
,
256
,
5
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_MANAGED
,
&
tex
,
NULL
);
...
...
@@ -835,6 +836,32 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
else
skip
(
"Failed to create texture
\n
"
);
/* Volume texture test */
hr
=
IDirect3DDevice9_CreateVolumeTexture
(
device
,
256
,
256
,
4
,
0
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_MANAGED
,
&
voltex
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
level_count
=
IDirect3DVolumeTexture9_GetLevelCount
(
voltex
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
voltex
,
NULL
,
0
,
D3DX_FILTER_NONE
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
voltex
,
NULL
,
0
,
D3DX_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
voltex
,
NULL
,
0
,
D3DX_FILTER_BOX
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
voltex
,
NULL
,
level_count
-
1
,
D3DX_DEFAULT
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
voltex
,
NULL
,
level_count
,
D3DX_DEFAULT
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
IDirect3DVolumeTexture9_Release
(
voltex
);
}
else
skip
(
"Failed to create volume texture
\n
"
);
/* Test textures with D3DUSAGE_AUTOGENMIPMAP usage */
if
(
!
is_autogenmipmap_supported
(
device
,
D3DRTYPE_TEXTURE
))
{
...
...
dlls/d3dx9_36/texture.c
View file @
ffe36a38
...
...
@@ -61,8 +61,8 @@ static HRESULT get_surface(D3DRESOURCETYPE type, LPDIRECT3DBASETEXTURE9 tex,
}
}
HRESULT
WINAPI
D3DXFilterTexture
(
LPDIRECT3DBASETEXTURE9
texture
,
CONST
PALETTEENTRY
*
palette
,
HRESULT
WINAPI
D3DXFilterTexture
(
IDirect3DBaseTexture9
*
texture
,
const
PALETTEENTRY
*
palette
,
UINT
srclevel
,
DWORD
filter
)
{
...
...
@@ -70,7 +70,7 @@ HRESULT WINAPI D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 texture,
HRESULT
hr
;
D3DRESOURCETYPE
type
;
TRACE
(
"(%p, %p, %
d, %d
)
\n
"
,
texture
,
palette
,
srclevel
,
filter
);
TRACE
(
"(%p, %p, %
u, %#x
)
\n
"
,
texture
,
palette
,
srclevel
,
filter
);
if
(
!
texture
)
return
D3DERR_INVALIDCALL
;
...
...
@@ -137,9 +137,48 @@ HRESULT WINAPI D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 texture,
return
D3D_OK
;
}
case
D3DRTYPE_VOLUMETEXTURE
:
{
D3DVOLUME_DESC
desc
;
int
level
,
level_count
;
IDirect3DVolume9
*
top_volume
,
*
mip_volume
;
IDirect3DVolumeTexture9
*
volume_texture
=
(
IDirect3DVolumeTexture9
*
)
texture
;
IDirect3DVolumeTexture9_GetLevelDesc
(
volume_texture
,
srclevel
,
&
desc
);
if
(
filter
==
D3DX_DEFAULT
)
{
if
(
is_pow2
(
desc
.
Width
)
&&
is_pow2
(
desc
.
Height
)
&&
is_pow2
(
desc
.
Depth
))
filter
=
D3DX_FILTER_BOX
;
else
filter
=
D3DX_FILTER_BOX
|
D3DX_FILTER_DITHER
;
}
hr
=
IDirect3DVolumeTexture9_GetVolumeLevel
(
volume_texture
,
srclevel
,
&
top_volume
);
if
(
FAILED
(
hr
))
return
hr
;
level_count
=
IDirect3DVolumeTexture9_GetLevelCount
(
volume_texture
);
for
(
level
=
srclevel
+
1
;
level
<
level_count
;
level
++
)
{
IDirect3DVolumeTexture9_GetVolumeLevel
(
volume_texture
,
level
,
&
mip_volume
);
hr
=
D3DXLoadVolumeFromVolume
(
mip_volume
,
palette
,
NULL
,
top_volume
,
palette
,
NULL
,
filter
,
0
);
IDirect3DVolume9_Release
(
top_volume
);
top_volume
=
mip_volume
;
if
(
FAILED
(
hr
))
break
;
}
IDirect3DVolume9_Release
(
top_volume
);
if
(
FAILED
(
hr
))
return
hr
;
return
D3D_OK
;
}
default:
FIXME
(
"Implement volume texture filtering
\n
"
);
return
E_NOTIMPL
;
return
D3DERR_INVALIDCALL
;
}
}
...
...
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