Added -d debug option for blenderplayer, and remove some
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Sep 2008 12:40:17 +0000 (12:40 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Sep 2008 12:40:17 +0000 (12:40 +0000)
invalid/unnecessary opengl calls on shader errors.

source/blender/gpu/intern/gpu_extensions.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

index d900f9c63f299090f35420e86053002554a261ad..c6e9c5aeafd886bc989537de50d34d2ae89b4947 100644 (file)
@@ -706,7 +706,6 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
                glGetObjectParameterivARB(shader->vertex, GL_OBJECT_COMPILE_STATUS_ARB, &status);
 
                if (!status) {
-                       glValidateProgramARB(shader->vertex);
                        glGetInfoLogARB(shader->vertex, sizeof(log), &length, log);
                        shader_print_errors("compile", log, vertexcode);
 
@@ -723,7 +722,6 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
                glGetObjectParameterivARB(shader->fragment, GL_OBJECT_COMPILE_STATUS_ARB, &status);
 
                if (!status) {
-                       glValidateProgramARB(shader->fragment);
                        glGetInfoLogARB(shader->fragment, sizeof(log), &length, log);
                        shader_print_errors("compile", log, fragcode);
 
@@ -771,7 +769,6 @@ GPUShader *GPU_shader_create_lib(const char *code)
        glGetObjectParameterivARB(shader->lib, GL_OBJECT_COMPILE_STATUS_ARB, &status);
 
        if (!status) {
-               glValidateProgramARB(shader->lib);
                glGetInfoLogARB(shader->lib, sizeof(log), &length, log);
                shader_print_errors("compile", log, code);
 
index c4e738c18961acfdb751cfa9c2b5e072e1a70108..8fd23318df15ada90418938364cea9ca7f87cc0b 100644 (file)
@@ -52,6 +52,7 @@
 extern "C"
 {
 #endif  // __cplusplus
+#include "MEM_guardedalloc.h"
 #include "BKE_global.h"        
 #include "BKE_icons.h" 
 #include "BKE_node.h"  
@@ -185,6 +186,7 @@ void usage(char* program)
 #ifdef _WIN32
        printf("  -c: keep console window open\n");
 #endif
+       printf("  -d: turn debugging on\n");
        printf("  -g: game engine options:\n");
        printf("       Name            Default      Description\n");
        printf("       ----------------------------------------\n");
@@ -414,6 +416,12 @@ int main(int argc, char** argv)
                                        }
                                }
                                break;
+
+                       case 'd':
+                               i++;
+                               G.f |= G_DEBUG;     /* std output printf's */
+                               MEM_set_memory_debug();
+                               break;
                                
                        case 'p':
                                // Parse window position and size options