[Bf-blender-cvs] [c30c3fd] master: Attempt to fix T45718, crash when enabling GLSL mode with UV layers.

Antony Riakiotakis noreply at git.blender.org
Fri Aug 7 16:16:39 CEST 2015


Commit: c30c3fde51fb5ca6780ef436678c9d4aa07f400c
Author: Antony Riakiotakis
Date:   Fri Aug 7 16:16:23 2015 +0200
Branches: master
https://developer.blender.org/rBc30c3fde51fb5ca6780ef436678c9d4aa07f400c

Attempt to fix T45718, crash when enabling GLSL mode with UV layers.

I can't  reproduce issue here but crash is most likely caused by passing
a NULL pointer to glUniform2fv.

This is caused by OpenSubdiv changes to the codegen module, which pass
mtex layers to the uniform system
even when not needed.

Since Sergey is demoing OpenSubdiv in a few days, I'll
go with the easy fix for now which is just checking for NULL pointer, but
this needs to be fixed properly at some point.

===================================================================

M	source/blender/gpu/intern/gpu_extensions.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index c6bee77..d9112ac 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -1932,7 +1932,7 @@ int GPU_shader_get_uniform(GPUShader *shader, const char *name)
 
 void GPU_shader_uniform_vector(GPUShader *UNUSED(shader), int location, int length, int arraysize, const float *value)
 {
-	if (location == -1)
+	if (location == -1 || value == NULL)
 		return;
 
 	GPU_ASSERT_NO_GL_ERRORS("Pre Uniform Vector");




More information about the Bf-blender-cvs mailing list