Commit 3f5936f6 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

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).
parent 8e259d9f
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment