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/GPU_buffers.h
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/GPU_buffers.h')
-rw-r--r--source/blender/gpu/GPU_buffers.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index 12e66264661..779521aa00c 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -39,6 +39,8 @@
# define DEBUG_VBO(X)
#endif
+#include <stddef.h>
+
struct BMesh;
struct CCGElem;
struct CCGKey;
@@ -50,7 +52,7 @@ struct PBVH;
struct MVert;
typedef struct GPUBuffer {
- int size; /* in bytes */
+ size_t size; /* in bytes */
void *pointer; /* used with vertex arrays */
unsigned int id; /* used with vertex buffer objects */
bool use_vbo; /* true for VBOs, false for vertex arrays */
@@ -58,12 +60,12 @@ typedef struct GPUBuffer {
typedef struct GPUBufferMaterial {
/* range of points used for this material */
- int start;
- int totelements;
- int totloops;
- int *polys; /* array of polygons for this material */
- int totpolys; /* total polygons in polys */
- int counter; /* general purpose counter, initialize first! */
+ unsigned int start;
+ unsigned int totelements;
+ unsigned int totloops;
+ unsigned int *polys; /* array of polygons for this material */
+ unsigned int totpolys; /* total polygons in polys */
+ unsigned int counter; /* general purpose counter, initialize first! */
/* original material index */
short mat_nr;
@@ -106,23 +108,22 @@ typedef struct GPUDrawObject {
#endif
int colType;
- int index_setup; /* how indices are setup, starting from start of buffer or start of material */
GPUBufferMaterial *materials;
int totmaterial;
- int tot_triangle_point;
- int tot_loose_point;
+ unsigned int tot_triangle_point;
+ unsigned int tot_loose_point;
/* different than total loops since ngons get tesselated still */
- int tot_loop_verts;
+ unsigned int tot_loop_verts;
/* caches of the original DerivedMesh values */
- int totvert;
- int totedge;
+ unsigned int totvert;
+ unsigned int totedge;
- int loose_edge_offset;
- int tot_loose_edge_drawn;
- int tot_edge_drawn;
+ unsigned int loose_edge_offset;
+ unsigned int tot_loose_edge_drawn;
+ unsigned int tot_edge_drawn;
} GPUDrawObject;
/* currently unused */