Stefan Dösinger : wined3d: Don' t set unloaded arrays to zero.

Alexandre Julliard julliard at winehq.org
Wed Jun 10 10:16:59 CDT 2009


Module: wine
Branch: master
Commit: 3f5936f6f7dc5560e0ad56e25bd0c9c421f0fba4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3f5936f6f7dc5560e0ad56e25bd0c9c421f0fba4

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun May 31 16:38:05 2009 +0200

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 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 1e09385..c468d2b 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);
 }




More information about the wine-cvs mailing list