Merge lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0 into lp:unity/5.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: no longer in the source branch.
Merged at revision: 2395
Proposed branch: lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0
Merge into: lp:unity/5.0
Prerequisite: lp:~thumper/unity/regional-damage-sru
Diff against target: 31 lines (+14/-0)
1 file modified
plugins/unityshell/src/unityshell.cpp (+14/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Sam Spilsbury (community) Approve
Review via email: mp+117555@code.launchpad.net

This proposal supersedes a proposal from 2012-08-01.

Commit message

unityshell: fix the nvidia crash on glDrawArrays disabling/enabling the client state on nuxPrologue/Epilogue (LP: #982626) (LP: #1031554)

Description of the change

Fix some crashes with the NVIDIA driver, happening on glDrawArray call.
Thanks to Sam for the hint.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Test coverage would be nice so that people don't accidentally nuke this code, though it would kinda involve wrapping those gl calls. Dunno if we want to do that.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just tested this fix upstream in Unity 6.0/Nux 3.0. It works. And is identical to this one.

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The prerequisite lp:~thumper/unity/regional-damage-sru has not yet been merged into lp:unity/5.0.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Posted in a previous version of this proposal

I see a LOT of conflicts - the diff generated by this branch is also terrible. Is it all just because the prerequisite branch is not yet merged?

review: Needs Information
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

sil, I forgot to make this request against the correct branch (lp:unity/5.0), this MR is already superseded, follow the top link to get the new request ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-08-01 01:09:21 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-08-01 01:09:21 +0000
@@ -505,6 +505,15 @@
505505
506 glMatrixMode(GL_MODELVIEW);506 glMatrixMode(GL_MODELVIEW);
507 glPushMatrix();507 glPushMatrix();
508
509 /* This is needed to Fix a crash in glDrawArrays with the NVIDIA driver
510 * see bugs #1031554 and #982626.
511 * The NVIDIA driver looks to see if the legacy GL_VERTEX_ARRAY,
512 * GL_TEXTURE_COORDINATES_ARRAY and other such client states are enabled
513 * first before checking if a vertex buffer is bound and will prefer the
514 * client buffers over the the vertex buffer object. */
515 glDisableClientState(GL_VERTEX_ARRAY);
516 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
508#endif517#endif
509518
510 glGetError();519 glGetError();
@@ -534,6 +543,11 @@
534 glReadBuffer(GL_BACK);543 glReadBuffer(GL_BACK);
535544
536 glPopAttrib();545 glPopAttrib();
546
547 /* Re-enable the client states that have been disabled in nuxPrologue , for
548 * NVIDIA compatibility reasons */
549 glEnableClientState(GL_VERTEX_ARRAY);
550 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
537#else551#else
538 glDepthRangef(0, 1);552 glDepthRangef(0, 1);
539 //glViewport(-1, -1, 2, 2);553 //glViewport(-1, -1, 2, 2);

Subscribers

People subscribed via source and target branches