mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:40:59 +00:00
wined3d: Disable texture filtering on textures that do not support it.
OpenGL always offers filtering on all formats, and if the hardware doesn't support it the driver falls back to software. Direct3D on the other hand silently disables filtering, so that's what we should do too.
This commit is contained in:
parent
4bb54a1ab7
commit
0cbd08b2b9
|
@ -789,7 +789,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
|
|||
D3DINITIALIZEBASETEXTURE(object->baseTexture);
|
||||
object->width = Width;
|
||||
object->height = Height;
|
||||
|
||||
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
|
||||
object->baseTexture.minMipLookup = &minMipLookup;
|
||||
} else {
|
||||
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
|
||||
}
|
||||
|
||||
/** Non-power2 support **/
|
||||
if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO)) {
|
||||
|
@ -935,7 +940,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
|
|||
object->baseTexture.pow2Matrix[10] = 1.0;
|
||||
object->baseTexture.pow2Matrix[15] = 1.0;
|
||||
|
||||
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
|
||||
object->baseTexture.minMipLookup = &minMipLookup;
|
||||
} else {
|
||||
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping */
|
||||
if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) {
|
||||
|
@ -1084,7 +1093,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
|
|||
object->baseTexture.pow2Matrix[10] = ((float)EdgeLength) / ((float)pow2EdgeLength);
|
||||
object->baseTexture.pow2Matrix[15] = 1.0;
|
||||
|
||||
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
|
||||
object->baseTexture.minMipLookup = &minMipLookup;
|
||||
} else {
|
||||
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
|
||||
}
|
||||
|
||||
/* Calculate levels for mip mapping */
|
||||
if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) {
|
||||
|
|
|
@ -155,6 +155,12 @@ int maxLookup[MAX_LOOKUPS];
|
|||
DWORD *stateLookup[MAX_LOOKUPS];
|
||||
|
||||
DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
|
||||
DWORD minMipLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1] = {
|
||||
{GL_NEAREST, GL_NEAREST, GL_NEAREST},
|
||||
{GL_NEAREST, GL_NEAREST, GL_NEAREST},
|
||||
{GL_NEAREST, GL_NEAREST, GL_NEAREST},
|
||||
{GL_NEAREST, GL_NEAREST, GL_NEAREST},
|
||||
};
|
||||
|
||||
/* drawStridedSlow attributes */
|
||||
glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED];
|
||||
|
|
|
@ -114,6 +114,7 @@ extern DWORD *stateLookup[MAX_LOOKUPS];
|
|||
|
||||
typedef DWORD minMipLookup_t[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
|
||||
extern minMipLookup_t minMipLookup;
|
||||
extern minMipLookup_t minMipLookup_noFilter;
|
||||
|
||||
void init_type_lookup(WineD3D_GL_Info *gl_info);
|
||||
#define WINED3D_ATR_TYPE(type) GLINFO_LOCATION.glTypeLookup[type].d3dType
|
||||
|
|
Loading…
Reference in a new issue