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).
This commit is contained in:
parent
8e259d9fcd
commit
3f5936f6f7
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue