From 3f5936f6f7dc5560e0ad56e25bd0c9c421f0fba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 31 May 2009 16:38:05 +0200 Subject: [PATCH] wined3d: Don't set unloaded arrays to zero. This causes memory corruption on MacOS, even if the app does not reference undeclared arrays. Trying to avoid potential breakage in broken apps which provoke undefined behavior is pointless if it causes actual breakage in well-behaved apps (on ill-behaved drivers). --- dlls/wined3d/state.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1e09385069e..c468d2b4c5f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3828,14 +3828,6 @@ static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, Win { GL_EXTCALL(glDisableVertexAttribArrayARB(i)); checkGLcall("glDisableVertexAttribArrayARB(reg)"); - /* Some Windows drivers(NV GF 7) use the latest value that was used when drawing with the now - * deactivated stream disabled, some other drivers(ATI, NV GF 8) set the undefined values to 0x00. - * Let's set them to 0x00 to avoid hitting some undefined aspects of OpenGL. All that is really - * important here is the glDisableVertexAttribArrayARB call above. The test shows that the refrast - * keeps dereferencing the pointers, which would cause crashes in some games like Half Life 2: Episode Two. - */ - GL_EXTCALL(glVertexAttrib4NubARB(i, 0, 0, 0, 0)); - checkGLcall("glVertexAttrib4NubARB(i, 0, 0, 0, 0)"); context->numbered_array_mask &= ~(1 << i); }