Stefan Dösinger : wined3d: Disable MAG filters on formats that do not support them.
Alexandre Julliard
julliard at winehq.org
Wed Apr 9 05:31:40 CDT 2008
Module: wine
Branch: master
Commit: 481bcdfe2a939cfc02f305fa7357c1c61f1bf0b5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=481bcdfe2a939cfc02f305fa7357c1c61f1bf0b5
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sun Apr 6 00:37:51 2008 +0200
wined3d: Disable MAG filters on formats that do not support them.
---
dlls/wined3d/basetexture.c | 2 +-
dlls/wined3d/device.c | 6 ++++++
dlls/wined3d/directx.c | 3 +++
dlls/wined3d/wined3d_private.h | 2 ++
4 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c
index ab7fd55..bc004c0 100644
--- a/dlls/wined3d/basetexture.c
+++ b/dlls/wined3d/basetexture.c
@@ -434,7 +434,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
if (state < WINED3DTEXF_NONE || state > WINED3DTEXF_ANISOTROPIC) {
FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state);
}
- glValue = magLookup[state - WINED3DTEXF_NONE];
+ glValue = (*This->baseTexture.magLookup)[state - WINED3DTEXF_NONE];
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
/* We need to reset the Anisotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 489b36e..034b04d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -792,8 +792,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
+ object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
+ object->baseTexture.magLookup = &magLookup_noFilter;
}
/** Non-power2 support **/
@@ -942,8 +944,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
+ object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
+ object->baseTexture.magLookup = &magLookup_noFilter;
}
/* Calculate levels for mip mapping */
@@ -1095,8 +1099,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
+ object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
+ object->baseTexture.magLookup = &magLookup_noFilter;
}
/* Calculate levels for mip mapping */
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d39118c..4071b1f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -163,6 +163,9 @@ DWORD minMipLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]
};
DWORD magLookup[WINED3DTEXF_ANISOTROPIC + 1];
+DWORD magLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1] = {
+ GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST
+};
/* drawStridedSlow attributes */
glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED];
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4aeda0c..18c7a09 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -113,6 +113,7 @@ extern DWORD *stateLookup[MAX_LOOKUPS];
typedef DWORD magLookup_t[WINED3DTEXF_ANISOTROPIC + 1];
extern magLookup_t magLookup;
+extern magLookup_t magLookup_noFilter;
typedef DWORD minMipLookup_t[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
extern minMipLookup_t minMipLookup;
@@ -1095,6 +1096,7 @@ typedef struct IWineD3DBaseTextureClass
WINED3DFORMAT shader_conversion_group;
float pow2Matrix[16];
minMipLookup_t *minMipLookup;
+ magLookup_t *magLookup;
} IWineD3DBaseTextureClass;
typedef struct IWineD3DBaseTextureImpl
More information about the wine-cvs
mailing list