added gl_finish cvar, defaults to 0, this was a noticable speed gain (22.5% on timede...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Jul 2004 06:09:26 +0000 (06:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Jul 2004 06:09:26 +0000 (06:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4288 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
glquake.h
vid.h
vid_glx.c
vid_sdl.c
vid_shared.c
vid_wgl.c

index f5117ec..89f2017 100644 (file)
@@ -1384,7 +1384,8 @@ showtris:
        {
                // tell driver to commit it's partially full geometry queue to the rendering queue
                // (this doesn't wait for the commands themselves to complete)
-               qglFlush();
+               if (gl_finish.integer)
+                       qglFlush();
        }
        else
        {
index 034b27d..31cd56f 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -303,7 +303,6 @@ extern int gl_combine_extension;
 #define GL_MAX_ELEMENTS_INDICES                        0x80E9
 #endif
 
-extern cvar_t gl_combine;
 
 extern int gl_textureshader;
 #ifndef GL_TEXTURE_SHADER_NV
diff --git a/vid.h b/vid.h
index 3c84504..5325f9d 100644 (file)
--- a/vid.h
+++ b/vid.h
@@ -52,6 +52,9 @@ extern cvar_t vid_height;
 extern cvar_t vid_bitsperpixel;
 extern cvar_t vid_mouse;
 
+extern cvar_t gl_combine;
+extern cvar_t gl_finish;
+
 extern cvar_t v_gamma;
 extern cvar_t v_contrast;
 extern cvar_t v_brightness;
index c05f0d3..7e670a1 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -607,7 +607,8 @@ void VID_Finish (void)
        int usemouse;
        if (r_render.integer)
        {
-               qglFinish();
+               if (r_speeds.integer || gl_finish.integer)
+                       qglFinish();
                qglXSwapBuffers(vidx11_display, win);
        }
 
index f42e821..b476540 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -474,7 +474,8 @@ void VID_Finish (void)
        Uint8 appstate;
        int vid_usemouse;
 
-       qglFinish();
+       if (r_speeds.integer || gl_finish.integer)
+               qglFinish();
        SDL_GL_SwapBuffers();
 
        //react on appstate changes
index de8bf14..b80d26a 100644 (file)
@@ -65,6 +65,7 @@ cvar_t vid_bitsperpixel = {CVAR_SAVE, "vid_bitsperpixel", "32"};
 
 cvar_t vid_mouse = {CVAR_SAVE, "vid_mouse", "1"};
 cvar_t gl_combine = {CVAR_SAVE, "gl_combine", "1"};
+cvar_t gl_finish = {0, "gl_finish", "0"};
 
 cvar_t in_pitch_min = {0, "in_pitch_min", "-70"};
 cvar_t in_pitch_max = {0, "in_pitch_max", "80"};
@@ -773,6 +774,7 @@ void VID_Shared_Init(void)
        Cvar_RegisterVariable(&vid_bitsperpixel);
        Cvar_RegisterVariable(&vid_mouse);
        Cvar_RegisterVariable(&gl_combine);
+       Cvar_RegisterVariable(&gl_finish);
        Cvar_RegisterVariable(&in_pitch_min);
        Cvar_RegisterVariable(&in_pitch_max);
        Cvar_RegisterVariable(&m_filter);
index 13c9b42..ffdc689 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -307,7 +307,8 @@ void VID_Finish (void)
        int vid_usemouse;
        if (r_render.integer && !scr_skipupdate)
        {
-               qglFinish();
+               if (r_speeds.integer || gl_finish.integer)
+                       qglFinish();
                hdc = GetDC(mainwindow);
                SwapBuffers(hdc);
                ReleaseDC(mainwindow, hdc);