Stefan Dösinger : wined3d: Make the min mip lookup type a texture property.

Alexandre Julliard julliard at winehq.org
Wed Apr 9 05:31:36 CDT 2008


Module: wine
Branch: master
Commit: 4bb54a1ab70b10e130b9037af6598beeec8e5891
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4bb54a1ab70b10e130b9037af6598beeec8e5891

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Apr  6 00:18:53 2008 +0200

wined3d: Make the min mip lookup type a texture property.

---

 dlls/wined3d/basetexture.c     |    3 ++-
 dlls/wined3d/device.c          |    5 +++++
 dlls/wined3d/wined3d_private.h |    4 +++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c
index 0ad0433..7609099 100644
--- a/dlls/wined3d/basetexture.c
+++ b/dlls/wined3d/basetexture.c
@@ -463,7 +463,8 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
                   This->baseTexture.states[WINED3DTEXSTA_MINFILTER],
                   This->baseTexture.states[WINED3DTEXSTA_MIPFILTER]);
         }
-        glValue = minMipLookup[min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC)]
+        glValue = (*This->baseTexture.minMipLookup)
+                [min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC)]
                 [min(max(samplerStates[WINED3DSAMP_MIPFILTER],WINED3DTEXF_NONE), WINED3DTEXF_LINEAR)];
 
         TRACE("ValueMIN=%d, ValueMIP=%d, setting MINFILTER to %x\n",
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 8e1e24a..82bdf2f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -789,6 +789,7 @@ static HRESULT  WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
     D3DINITIALIZEBASETEXTURE(object->baseTexture);    
     object->width  = Width;
     object->height = Height;
+    object->baseTexture.minMipLookup = &minMipLookup;
 
     /** Non-power2 support **/
     if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO)) {
@@ -934,6 +935,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
     object->baseTexture.pow2Matrix[10] = 1.0;
     object->baseTexture.pow2Matrix[15] = 1.0;
 
+    object->baseTexture.minMipLookup = &minMipLookup;
+
     /* Calculate levels for mip mapping */
     if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) {
         if(!GL_SUPPORT(SGIS_GENERATE_MIPMAP)) {
@@ -1081,6 +1084,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
     object->baseTexture.pow2Matrix[10] = ((float)EdgeLength) / ((float)pow2EdgeLength);
     object->baseTexture.pow2Matrix[15] = 1.0;
 
+    object->baseTexture.minMipLookup = &minMipLookup;
+
     /* Calculate levels for mip mapping */
     if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) {
         if(!GL_SUPPORT(SGIS_GENERATE_MIPMAP)) {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 19ad58d..46075fa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -112,7 +112,8 @@ extern int minLookup[MAX_LOOKUPS];
 extern int maxLookup[MAX_LOOKUPS];
 extern DWORD *stateLookup[MAX_LOOKUPS];
 
-extern DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
+typedef DWORD minMipLookup_t[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
+extern minMipLookup_t minMipLookup;
 
 void init_type_lookup(WineD3D_GL_Info *gl_info);
 #define WINED3D_ATR_TYPE(type)          GLINFO_LOCATION.glTypeLookup[type].d3dType
@@ -1090,6 +1091,7 @@ typedef struct IWineD3DBaseTextureClass
     UINT                    srgb_mode_change_count;
     WINED3DFORMAT           shader_conversion_group;
     float                   pow2Matrix[16];
+    minMipLookup_t          *minMipLookup;
 } IWineD3DBaseTextureClass;
 
 typedef struct IWineD3DBaseTextureImpl




More information about the wine-cvs mailing list