[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16542] trunk/blender/source/blender/gpu/ intern: Workaround for an Nvidia driver bug on 32 bit linux ( maybe windows too).

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Sep 15 20:15:11 CEST 2008


Revision: 16542
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16542
Author:   blendix
Date:     2008-09-15 20:15:11 +0200 (Mon, 15 Sep 2008)

Log Message:
-----------
Workaround for an Nvidia driver bug on 32 bit linux (maybe windows too).
I reversed the order of attaching shader objects for linking to solve an
issue in the driver before, but now it appears it needs to be the other
way around again? I don't know if these are the same cards that now want
it different again due to changes in the glsl code, but I found another
workaround for the first bug in a forum post (leaving out parameter names
in the declarations), so with some luck both cases work?

http://developer.nvidia.com/forums/index.php?showtopic=596

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_codegen.c
    trunk/blender/source/blender/gpu/intern/gpu_extensions.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_codegen.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_codegen.c	2008-09-15 17:52:20 UTC (rev 16541)
+++ trunk/blender/source/blender/gpu/intern/gpu_codegen.c	2008-09-15 18:15:11 UTC (rev 16542)
@@ -331,7 +331,7 @@
 			else
 				BLI_dynstr_append(ds, GPU_DATATYPE_STR[function->paramtype[a]]);
 				
-			BLI_dynstr_printf(ds, " param%d", a);
+			//BLI_dynstr_printf(ds, " param%d", a);
 			
 			if(a != function->totparam-1)
 				BLI_dynstr_append(ds, ", ");

Modified: trunk/blender/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_extensions.c	2008-09-15 17:52:20 UTC (rev 16541)
+++ trunk/blender/source/blender/gpu/intern/gpu_extensions.c	2008-09-15 18:15:11 UTC (rev 16542)
@@ -695,9 +695,6 @@
 		return NULL;
 	}
 
-	if(lib && lib->lib)
-		glAttachObjectARB(shader->object, lib->lib);
-
 	if(vertexcode) {
 		glAttachObjectARB(shader->object, shader->vertex);
 		glShaderSourceARB(shader->vertex, 1, (const char**)&vertexcode, NULL);
@@ -730,6 +727,9 @@
 		}
 	}
 
+	if(lib && lib->lib)
+		glAttachObjectARB(shader->object, lib->lib);
+
 	glLinkProgramARB(shader->object);
 	glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
 	if (!status) {





More information about the Bf-blender-cvs mailing list