[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55665] trunk/blender/source/blender/ editors/interface/interface_draw.c: fix/workaround [#34346] Blender total crashes when File/ User preferences twice and go to System tab

Ton Roosendaal ton at blender.org
Fri Mar 29 10:36:37 CET 2013


Hi Campbell,

That's an interesting discovery, but the same code you can find for other cases in Blender, for example for the transform widgets, and probably bone drawing options too.

So I wonder what precisely the issue is here - does it have to do with opening a 2nd window?

-Ton-

------------------------------------------------------------------------
Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute   Entrepotdok 57A  1018AD Amsterdam   The Netherlands

On 29 Mar, 2013, at 8:14, Campbell Barton wrote:

> Revision: 55665
>          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55665
> Author:   campbellbarton
> Date:     2013-03-29 07:14:18 +0000 (Fri, 29 Mar 2013)
> Log Message:
> -----------
> fix/workaround [#34346] Blender total crashes when File/User preferences twice and go to System tab
> 
> Modified Paths:
> --------------
>    trunk/blender/source/blender/editors/interface/interface_draw.c
> 
> Modified: trunk/blender/source/blender/editors/interface/interface_draw.c
> ===================================================================
> --- trunk/blender/source/blender/editors/interface/interface_draw.c	2013-03-29 06:25:22 UTC (rev 55664)
> +++ trunk/blender/source/blender/editors/interface/interface_draw.c	2013-03-29 07:14:18 UTC (rev 55665)
> @@ -61,6 +61,15 @@
> /* own include */
> #include "interface_intern.h"
> 
> +/* only for bug workaround [#34346] */
> +#if !defined(WIN32) && !defined(__APPLE__)
> +#  define GPU_OSS_BUG_WOKAROUND
> +#endif
> +
> +#ifdef GPU_OSS_BUG_WOKAROUND
> +#  include "GPU_extensions.h"
> +#endif
> +
> static int roundboxtype = UI_CNR_ALL;
> 
> void uiSetRoundBox(int type)
> @@ -1236,6 +1245,7 @@
> 
> void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
> {
> +	static int use_displist = -1;
> 	static GLuint displist = 0;
> 	int a, old[8];
> 	GLfloat diff[4], diffn[4] = {1.0f, 1.0f, 1.0f, 1.0f};
> @@ -1285,20 +1295,30 @@
> 	
> 	glScalef(size, size, size);
> 	
> -	if (displist == 0) {
> -		GLUquadricObj   *qobj;
> +#ifdef GPU_OSS_BUG_WOKAROUND
> +	if (use_displist == -1) {
> +		use_displist = !GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE);
> +	}
> +#endif
> +
> +	if (displist == 0 || use_displist == 0) {
> +		GLUquadricObj *qobj;
> +
> +		if (use_displist) {
> +			displist = glGenLists(1);
> +			glNewList(displist, GL_COMPILE_AND_EXECUTE);
> +		}
> 		
> -		displist = glGenLists(1);
> -		glNewList(displist, GL_COMPILE_AND_EXECUTE);
> -		
> 		qobj = gluNewQuadric();
> -		gluQuadricDrawStyle(qobj, GLU_FILL); 
> +		gluQuadricDrawStyle(qobj, GLU_FILL);
> 		glShadeModel(GL_SMOOTH);
> 		gluSphere(qobj, 100.0, 32, 24);
> 		glShadeModel(GL_FLAT);
> 		gluDeleteQuadric(qobj);  
> 		
> -		glEndList();
> +		if (use_displist) {
> +			glEndList();
> +		}
> 	}
> 	else {
> 		glCallList(displist);
> 
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs



More information about the Bf-committers mailing list