diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-04-09 05:42:26 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-04-09 05:42:26 +0400 |
commit | d8c4763fb0d7d880342fcb2cfa619b17cbaabf6a (patch) | |
tree | c129780cc9e75b8866313e4eab2fc9d1f2075783 | |
parent | b5d3f183b0fd6f72d84fbcdd594f80e70422eb24 (diff) |
More stack cleanup on GPU_buffers
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index dc986badb16..1eddd90a902 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -71,9 +71,6 @@ typedef enum { #define MAX_GPU_ATTRIB_DATA 32 -/* material number is an 16-bit signed short and the range (assume material number is non-negative) */ -#define MAX_MATERIALS MAXMAT - /* -1 - undefined, 0 - vertex arrays, 1 - VBOs */ static int useVBOs = -1; static GPUBufferState GLStates = 0; @@ -565,7 +562,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object, GPUBufferPool *pool; GPUBuffer *buffer; float *varray; - int mat_orig_to_new[MAX_MATERIALS]; + int *mat_orig_to_new; int *cur_index_per_mat; int i; int success; @@ -585,6 +582,8 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object, return NULL; } + mat_orig_to_new = MEM_mallocN(sizeof(*mat_orig_to_new) * dm->totmat, + "GPU_buffer_setup.mat_orig_to_new"); cur_index_per_mat = MEM_mallocN(sizeof(int) * object->totmaterial, "GPU_buffer_setup.cur_index_per_mat"); for (i = 0; i < object->totmaterial; i++) { @@ -657,6 +656,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object, } MEM_freeN(cur_index_per_mat); + MEM_freeN(mat_orig_to_new); BLI_mutex_unlock(&buffer_mutex); |