[PATCH] WineD3D: Set the texture wrap default with the NP2 =

Stefan Doesinger stefan at codeweavers.com
Tue Aug 12 17:18:25 CDT 2008


emulation properly=0A=
=0A=
---=0A=
 dlls/wined3d/texture.c |   14 ++++++++++++++=0A=
 1 files changed, 14 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c=0A=
index 5dc9821..35dfcae 100644=0A=
--- a/dlls/wined3d/texture.c=0A=
+++ b/dlls/wined3d/texture.c=0A=
@@ -227,6 +227,20 @@ static HRESULT WINAPI =
IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface) {=0A=
         for (i =3D 0; i < This->baseTexture.levels; ++i) {=0A=
             IWineD3DSurface_SetGlTextureDesc(This->surfaces[i], =
This->baseTexture.textureName, =
IWineD3DTexture_GetTextureDimensions(iface));=0A=
         }=0A=
+        /* Conditinal non power of two textures use a different =
clamping default. If we're using the GL_WINE_normalized_texrect=0A=
+         * partial driver emulation, we're dealing with a GL_TEXTURE_2D =
texture which has the address mode set to repeat - something=0A=
+         * that prevents us from hitting the accelerated codepath. Thus =
manually set the GL state=0A=
+         */=0A=
+        if(IWineD3DBaseTexture_IsCondNP2(iface)) {=0A=
+            ENTER_GL();=0A=
+            =
glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), =
GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);=0A=
+            checkGLcall("glTexParameteri(dimension, GL_TEXTURE_WRAP_S, =
GL_CLAMP_TO_EDGE)");=0A=
+            =
glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), =
GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);=0A=
+            checkGLcall("glTexParameteri(dimension, GL_TEXTURE_WRAP_S, =
GL_CLAMP_TO_EDGE)");=0A=
+            LEAVE_GL();=0A=
+            This->baseTexture.states[WINED3DTEXSTA_ADDRESSU]      =3D =
WINED3DTADDRESS_CLAMP;=0A=
+            This->baseTexture.states[WINED3DTEXSTA_ADDRESSV]      =3D =
WINED3DTADDRESS_CLAMP;=0A=
+        }=0A=
     }=0A=
 =0A=
     return hr;=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0055_01C902BC.93882490--




More information about the wine-patches mailing list