summaryrefslogtreecommitdiff
path: root/drivers/gles3/storage/mesh_storage.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/storage/mesh_storage.h')
-rw-r--r--drivers/gles3/storage/mesh_storage.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gles3/storage/mesh_storage.h b/drivers/gles3/storage/mesh_storage.h
index 6b0d0c83b2..dfb9046e7b 100644
--- a/drivers/gles3/storage/mesh_storage.h
+++ b/drivers/gles3/storage/mesh_storage.h
@@ -54,7 +54,6 @@ struct Mesh {
struct Attrib {
bool enabled;
bool integer;
- GLuint index;
GLint size;
GLenum type;
GLboolean normalized;
@@ -69,6 +68,7 @@ struct Mesh {
GLuint skin_buffer = 0;
uint32_t vertex_count = 0;
uint32_t vertex_buffer_size = 0;
+ uint32_t attribute_buffer_size = 0;
uint32_t skin_buffer_size = 0;
// Cache vertex arrays so they can be created
@@ -84,8 +84,8 @@ struct Mesh {
uint32_t version_count = 0;
GLuint index_buffer = 0;
- GLuint index_array = 0;
uint32_t index_count = 0;
+ uint32_t index_buffer_size = 0;
struct LOD {
float edge_length = 0.0;
@@ -357,6 +357,12 @@ public:
}
}
+ _FORCE_INLINE_ GLenum mesh_surface_get_index_type(void *p_surface) const {
+ Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface);
+
+ return s->vertex_count <= 65536 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
+ }
+
// Use this to cache Vertex Array Objects so they are only generated once
_FORCE_INLINE_ void mesh_surface_get_vertex_arrays_and_format(void *p_surface, uint32_t p_input_mask, GLuint &r_vertex_array_gl) {
Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface);