Added a checkbox in the user preferences for turning off VBO support
authorLukas Steiblys <imbusy@imbusy.org>
Mon, 14 Sep 2009 10:53:39 +0000 (10:53 +0000)
committerLukas Steiblys <imbusy@imbusy.org>
Mon, 14 Sep 2009 10:53:39 +0000 (10:53 +0000)
release/ui/space_userpref.py
source/blender/gpu/gpu_buffers.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 1e7a9b581d423853e04c35543fcee50692314f77..636f9626957913f7b3663f663e878344cbb03395 100644 (file)
@@ -306,6 +306,7 @@ class USERPREF_PT_system(bpy.types.Panel):
                sub1.itemL(text="OpenGL:")
                sub1.itemR(system, "clip_alpha", slider=True)
                sub1.itemR(system, "use_mipmaps")
+               sub1.itemR(system, "use_vbos")
                sub1.itemL(text="Window Draw Method:")
                sub1.row().itemR(system, "window_draw_method", expand=True)
                sub1.itemL(text="Textures:")
index bf48cbe72a838263fcf1069644d58ee34e1d5abd..d71c8e49acd66de05a330ab14a82ea332b419359 100644 (file)
@@ -36,7 +36,8 @@
 #define MAX_FREE_GPU_BUFFERS 8
 
 #ifdef _DEBUG
-#define DEBUG_VBO(X) printf(X)
+/*#define DEBUG_VBO(X) printf(X)*/
+#define DEBUG_VBO(X)
 #else
 #define DEBUG_VBO(X)
 #endif
index 1a8fca7a63753dce9d861a4a4a52dced3915836d..5781c852657036965d6db293f5c6068621291aef 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "GL/glew.h"
 
+#include "DNA_userdef_types.h"
+
 #include "gpu_buffers.h"
 #include "MEM_guardedalloc.h"
 #include "BKE_DerivedMesh.h"
@@ -1166,6 +1168,10 @@ void GPU_color_switch( int mode )
 
 int GPU_buffer_legacy( DerivedMesh *dm )
 {
+       int test= (U.gameflags & USER_DISABLE_VBO);
+       if( test )
+               return 1;
+
        if( dm->drawObject == 0 )
                dm->drawObject = GPU_drawobject_new(dm);
        return dm->drawObject->legacy;
index 826eea43a4d72e1f5300aa3e0e3ba50943f2b11b..16ab3e1e9bd01bfe2790aff3b96cc051a8b7a8ed 100644 (file)
@@ -446,6 +446,7 @@ extern UserDef U; /* from blenkernel blender.c */
 #define USER_DEPRECATED_FLAG   1
 #define USER_DISABLE_SOUND             2
 #define USER_DISABLE_MIPMAP            4
+#define USER_DISABLE_VBO               8
 
 /* wm draw method */
 #define USER_DRAW_TRIPLE               0
index ffc3f1696fc6c7ee23036b690469d147b54fbd27..4825076528fc3a190c7aa3b1f5fd4a6c2a56178a 100644 (file)
@@ -2143,6 +2143,10 @@ static void rna_def_userdef_system(BlenderRNA *brna)
        RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
        RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3d View (looks nicer but uses more memory and slows image reloading.)");
 
+       prop= RNA_def_property(srna, "use_vbos", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
+       RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering.");
+
        prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
        RNA_def_property_enum_items(prop, gl_texture_clamp_items);