wined3d: We only need to enable texturing for a target if we're going to draw with it (without a shader).
Henri Verbeet
hverbeet at codeweavers.com
Wed Oct 15 06:35:31 CDT 2008
Also, these enables cause problems if they're done while the context is
setup for blitting.
---
dlls/wined3d/drawprim.c | 1 -
dlls/wined3d/surface.c | 12 ------------
2 files changed, 0 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 31bbb85..c212f14 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -673,7 +673,6 @@ void depth_blt(IWineD3DDevice *iface, GLuint texture, GLsizei w, GLsizei h) {
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
glBindTexture(GL_TEXTURE_2D, texture);
- glEnable(GL_TEXTURE_2D);
This->shader_backend->shader_select_depth_blt(iface);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c22a547..6f0c107 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2217,7 +2217,6 @@ static void d3dfmt_p8_upload_palette(IWineD3DSurface *iface, CONVERT_TYPES conve
GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, device->paletteConversionShader));
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE1));
- glEnable(GL_TEXTURE_1D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@@ -2379,8 +2378,6 @@ static void WINAPI IWineD3DSurfaceImpl_BindTexture(IWineD3DSurface *iface) {
ENTER_GL();
- glEnable(This->glDescription.target);
-
if (!This->glDescription.level) {
if (!This->glDescription.textureName) {
glGenTextures(1, &This->glDescription.textureName);
@@ -2452,7 +2449,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
GLint prevRead;
ENTER_GL();
TRACE("(%p) Reading render target into texture\n", This);
- glEnable(GL_TEXTURE_2D);
glGenTextures(1, &tmpTexture);
glBindTexture(GL_TEXTURE_2D, tmpTexture);
@@ -2818,10 +2814,6 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
IWineD3DSurface_PreLoad((IWineD3DSurface *) This);
ENTER_GL();
- /* TODO: Do we need GL_TEXTURE_2D enabled fpr copyteximage? */
- glEnable(This->glDescription.target);
- checkGLcall("glEnable(This->glDescription.target)");
-
/* Bind the target texture */
glBindTexture(This->glDescription.target, This->glDescription.textureName);
checkGLcall("glBindTexture");
@@ -2891,10 +2883,6 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
}
vcheckGLcall("glCopyTexSubImage2D");
- /* Leave the opengl state valid for blitting */
- glDisable(This->glDescription.target);
- checkGLcall("glDisable(This->glDescription.target)");
-
LEAVE_GL();
}
--
1.5.6.4
--------------090803080906080406060005--
More information about the wine-patches
mailing list