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

This commit is contained in:
Stefan Dösinger 2008-04-06 00:18:53 +02:00 committed by Alexandre Julliard
parent 98b56c3ff0
commit 4bb54a1ab7
3 changed files with 10 additions and 2 deletions

View File

@ -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",

View File

@ -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)) {

View File

@ -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