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
This commit is contained in:
@@ -331,7 +331,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
|
||||
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, ", ");
|
||||
|
||||
@@ -695,9 +695,6 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
|
||||
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 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
|
||||
}
|
||||
}
|
||||
|
||||
if(lib && lib->lib)
|
||||
glAttachObjectARB(shader->object, lib->lib);
|
||||
|
||||
glLinkProgramARB(shader->object);
|
||||
glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
|
||||
if (!status) {
|
||||
|
||||
Reference in New Issue
Block a user