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
Alexey Alyaev
wine
Commits
54f049a6
Commit
54f049a6
authored
14 years ago
by
Owen Rudge
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3dx9: Add basic implementation of D3DXFilterTexture, plus tests.
parent
30d5e375
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
1 addition, 1 deletion
dlls/d3dx9_36/d3dx9_36.spec
dlls/d3dx9_36/tests/texture.c
+55
-0
55 additions, 0 deletions
dlls/d3dx9_36/tests/texture.c
dlls/d3dx9_36/texture.c
+66
-0
66 additions, 0 deletions
dlls/d3dx9_36/texture.c
with
122 additions
and
1 deletion
dlls/d3dx9_36/d3dx9_36.spec
+
1
−
1
View file @
54f049a6
...
...
@@ -128,7 +128,7 @@
@ stub D3DXFillTextureTX
@ stub D3DXFillVolumeTexture
@ stub D3DXFillVolumeTextureTX
@ st
ub
D3DXFilterTexture
@ st
dcall
D3DXFilterTexture
(ptr ptr long long)
@ stdcall D3DXFindShaderComment(ptr long ptr ptr)
@ stub D3DXFloat16To32Array
@ stub D3DXFloat32To16Array
...
...
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/tests/texture.c
+
55
−
0
View file @
54f049a6
...
...
@@ -315,6 +315,60 @@ static void test_D3DXCreateTexture(IDirect3DDevice9 *device)
}
}
static
void
test_D3DXFilterTexture
(
IDirect3DDevice9
*
device
)
{
IDirect3DTexture9
*
tex
;
HRESULT
hr
;
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
256
,
256
,
5
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_MANAGED
,
&
tex
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
0
,
D3DX_FILTER_NONE
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
0
,
D3DX_FILTER_BOX
+
1
);
/* Invalid filter */
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
5
,
D3DX_FILTER_NONE
);
/* Last miplevel */
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
20
,
D3DX_FILTER_NONE
);
/* Invalid miplevel */
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
}
else
skip
(
"Failed to create texture
\n
"
);
IDirect3DTexture9_Release
(
tex
);
hr
=
D3DXFilterTexture
(
NULL
,
NULL
,
0
,
D3DX_FILTER_NONE
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
/* Test different pools */
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
256
,
256
,
0
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
tex
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
0
,
D3DX_FILTER_NONE
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
IDirect3DTexture9_Release
(
tex
);
}
else
skip
(
"Failed to create texture
\n
"
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
256
,
256
,
0
,
0
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SCRATCH
,
&
tex
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
D3DXFilterTexture
((
IDirect3DBaseTexture9
*
)
tex
,
NULL
,
0
,
D3DX_FILTER_NONE
);
ok
(
hr
==
D3D_OK
,
"D3DXFilterTexture returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
IDirect3DTexture9_Release
(
tex
);
}
else
skip
(
"Failed to create texture
\n
"
);
}
START_TEST
(
texture
)
{
HWND
wnd
;
...
...
@@ -348,6 +402,7 @@ START_TEST(texture)
test_D3DXCheckTextureRequirements
(
device
);
test_D3DXCreateTexture
(
device
);
test_D3DXFilterTexture
(
device
);
IDirect3DDevice9_Release
(
device
);
IDirect3D9_Release
(
d3d
);
...
...
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/texture.c
+
66
−
0
View file @
54f049a6
...
...
@@ -44,6 +44,72 @@ UINT make_pow2(UINT num)
return
result
;
}
HRESULT
WINAPI
D3DXFilterTexture
(
LPDIRECT3DBASETEXTURE9
texture
,
CONST
PALETTEENTRY
*
palette
,
UINT
srclevel
,
DWORD
filter
)
{
UINT
level
=
srclevel
+
1
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %d, %d)
\n
"
,
texture
,
palette
,
srclevel
,
filter
);
if
(
!
texture
)
return
D3DERR_INVALIDCALL
;
if
((
filter
&
0xFFFF
)
>
D3DX_FILTER_BOX
&&
filter
!=
D3DX_DEFAULT
)
return
D3DERR_INVALIDCALL
;
if
(
srclevel
>=
IDirect3DBaseTexture9_GetLevelCount
(
texture
))
return
D3DERR_INVALIDCALL
;
switch
(
IDirect3DBaseTexture9_GetType
(
texture
))
{
case
D3DRTYPE_TEXTURE
:
{
IDirect3DSurface9
*
topsurf
,
*
mipsurf
;
D3DSURFACE_DESC
desc
;
if
(
filter
==
D3DX_DEFAULT
)
{
IDirect3DTexture9_GetLevelDesc
((
IDirect3DTexture9
*
)
texture
,
srclevel
,
&
desc
);
if
(
is_pow2
(
desc
.
Width
)
&&
is_pow2
(
desc
.
Height
))
filter
=
D3DX_FILTER_BOX
;
else
filter
=
D3DX_FILTER_BOX
|
D3DX_FILTER_DITHER
;
}
hr
=
IDirect3DTexture9_GetSurfaceLevel
((
IDirect3DTexture9
*
)
texture
,
srclevel
,
&
topsurf
);
if
(
FAILED
(
hr
))
return
D3DERR_INVALIDCALL
;
while
(
IDirect3DTexture9_GetSurfaceLevel
((
IDirect3DTexture9
*
)
texture
,
level
,
&
mipsurf
)
==
D3D_OK
)
{
hr
=
D3DXLoadSurfaceFromSurface
(
mipsurf
,
palette
,
NULL
,
topsurf
,
palette
,
NULL
,
filter
,
0
);
IDirect3DSurface9_Release
(
mipsurf
);
if
(
FAILED
(
hr
))
break
;
level
++
;
}
IDirect3DSurface9_Release
(
topsurf
);
if
(
level
==
srclevel
+
1
)
return
D3DERR_INVALIDCALL
;
return
D3D_OK
;
}
default:
FIXME
(
"Implement volume and cube texture filtering
\n
"
);
return
E_NOTIMPL
;
}
}
HRESULT
WINAPI
D3DXCheckTextureRequirements
(
LPDIRECT3DDEVICE9
device
,
UINT
*
width
,
UINT
*
height
,
...
...
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