[vlc-commits] Checked D3DCAPS9 before setting D3DPTFILTERCAPS_MINFLINEAR/ D3DPTFILTERCAPS_MAGFLINEAR (direct3d).
Laurent Aimar
git at videolan.org
Thu Apr 28 23:35:07 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Apr 11 20:53:41 2011 +0200| [b282e00cf543685a2bece53e3843b798c2946bae] | committer: Laurent Aimar
Checked D3DCAPS9 before setting D3DPTFILTERCAPS_MINFLINEAR/D3DPTFILTERCAPS_MAGFLINEAR (direct3d).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b282e00cf543685a2bece53e3843b798c2946bae
---
modules/video_output/msw/direct3d.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 4dc294c..52de59a 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -970,8 +970,20 @@ static int Direct3DCreateScene(vout_display_t *vd, const video_format_t *fmt)
IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
// Set linear filtering quality
- IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
- IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
+ if (sys->d3dcaps.TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) {
+ msg_Dbg(vd, "Using D3DTEXF_LINEAR for minification");
+ IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
+ } else {
+ msg_Dbg(vd, "Using D3DTEXF_POINT for minification");
+ IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
+ }
+ if (sys->d3dcaps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) {
+ msg_Dbg(vd, "Using D3DTEXF_LINEAR for magnification");
+ IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
+ } else {
+ msg_Dbg(vd, "Using D3DTEXF_POINT for magnification");
+ IDirect3DDevice9_SetSamplerState(d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
+ }
// set maximum ambient light
IDirect3DDevice9_SetRenderState(d3ddev, D3DRS_AMBIENT, D3DCOLOR_XRGB(255,255,255));
More information about the vlc-commits
mailing list