Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
ffe36a38
Commit
ffe36a38
authored
12 years ago
by
Józef Kucia
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3dx9: Implement volume texture filtering in D3DXFilterTexture.
parent
e8bfaf17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/d3dx9_36/tests/texture.c
+27
-0
27 additions, 0 deletions
dlls/d3dx9_36/tests/texture.c
dlls/d3dx9_36/texture.c
+44
-5
44 additions, 5 deletions
dlls/d3dx9_36/texture.c
with
71 additions
and
5 deletions
dlls/d3dx9_36/tests/texture.c
+
27
−
0
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
))
{
...
...
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/texture.c
+
44
−
5
View file @
ffe36a38
...
...
@@ -61,8 +61,8 @@ static HRESULT get_surface(D3DRESOURCETYPE type, LPDIRECT3DBASETEXTURE9 tex,
}
}
HRESULT
WINAPI
D3DXFilterTexture
(
LPDIRECT3DBASETEXTURE
9
texture
,
CONST
PALETTEENTRY
*
palette
,
HRESULT
WINAPI
D3DXFilterTexture
(
IDirect3DBaseTexture
9
*
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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment