Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-17 13:25:05 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-17 13:25:44 +0300
commit1b8e0d03d413a54ceb7d6397c696b59bb7c6f91b (patch)
tree1c6701e983f95b7236a85c300871d21c9f4fad47 /source/blender/gpu/intern/gpu_buffers.c
parent0b121d6a5ddb0605011cf89782d46df656f0deeb (diff)
Fix no longer being possible to display a suzanne with 8 levels of
subdivision. Classic integet overflow/size_t substitution case. Machines are getting powerful enough to easily expose these kinds of error now.
Diffstat (limited to 'source/blender/gpu/intern/gpu_buffers.c')
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c8
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 cd3a5d6d725..e86ca0fba94 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -75,7 +75,7 @@ typedef struct {
} GPUBufferTypeSettings;
-static int gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type);
+static size_t gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type);
const GPUBufferTypeSettings gpu_buffer_type_settings[] = {
/* vertex */
@@ -471,7 +471,7 @@ void GPU_drawobject_free(DerivedMesh *dm)
dm->drawObject = NULL;
}
-static GPUBuffer *gpu_try_realloc(GPUBufferPool *pool, GPUBuffer *buffer, int size, bool use_VBOs)
+static GPUBuffer *gpu_try_realloc(GPUBufferPool *pool, GPUBuffer *buffer, size_t size, bool use_VBOs)
{
gpu_buffer_free_intern(buffer);
gpu_buffer_pool_delete_last(pool);
@@ -498,7 +498,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
const GPUBufferTypeSettings *ts = &gpu_buffer_type_settings[type];
GLenum target = ts->gl_buffer_type;
int num_components = ts->num_components;
- int size = gpu_buffer_size_from_type(dm, type);
+ size_t size = gpu_buffer_size_from_type(dm, type);
bool use_VBOs = (GLEW_ARB_vertex_buffer_object) && !(U.gameflags & USER_DISABLE_VBO);
GLboolean uploaded;
@@ -607,7 +607,7 @@ static GPUBuffer **gpu_drawobject_buffer_from_type(GPUDrawObject *gdo, GPUBuffer
}
/* get the amount of space to allocate for a buffer of a particular type */
-static int gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type)
+static size_t gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type)
{
switch (type) {
case GPU_BUFFER_VERTEX: