2.5: automatic draw method now uses overlap for Intel on all platforms.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 16 Jul 2010 10:13:04 +0000 (10:13 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 16 Jul 2010 10:13:04 +0000 (10:13 +0000)
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_extensions.c
source/blender/windowmanager/intern/wm_draw.c

index 5275f8988a83d042f25f7cab324cf98802e7e70f..a7f43d3b0aee0021d8e04c1f55bde3804e54f29f 100644 (file)
@@ -75,17 +75,17 @@ typedef enum GPUDeviceType {
 } GPUDeviceType;
 
 typedef enum GPUOSType {
-       GPU_OS_WIN =                    (1<<16),
-       GPU_OS_MAC =                    (1<<17),
-       GPU_OS_UNIX =                   (1<<18),
+       GPU_OS_WIN =                    (1<<8),
+       GPU_OS_MAC =                    (1<<9),
+       GPU_OS_UNIX =                   (1<<10),
        GPU_OS_ANY =                    (0xff00)
 } GPUOSType;
 
 typedef enum GPUDriverType {
-       GPU_DRIVER_OFFICIAL =   (1<<24),
-       GPU_DRIVER_OPENSOURCE = (1<<25),
-       GPU_DRIVER_SOFTWARE =   (1<<26),
-       GPU_DRIVER_UNKNOWN =    (0xff0000)
+       GPU_DRIVER_OFFICIAL =   (1<<16),
+       GPU_DRIVER_OPENSOURCE = (1<<17),
+       GPU_DRIVER_SOFTWARE =   (1<<18),
+       GPU_DRIVER_ANY =                (0xff0000)
 } GPUDriverType;
 
 int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
index 0b7ea605ec8c1c23016cda8284d7e4f6354e0b05..a96920aa8393b1255d20dec624edf546c520627f 100644 (file)
@@ -152,8 +152,8 @@ void GPU_extensions_init()
                GG.driver = GPU_DRIVER_SOFTWARE;
        }
        else {
-               GG.device = GPU_DEVICE_UNKNOWN;
-               GG.driver = GPU_DRIVER_UNKNOWN;
+               GG.device = GPU_DEVICE_ANY;
+               GG.driver = GPU_DRIVER_ANY;
        }
 
        GG.os = GPU_OS_UNIX;
index 38322b66bbb1cd8f17199a7382369ae59fa7dd4c..7e0ee7226c53b207c58be466d633109cc143bded 100644 (file)
@@ -677,13 +677,22 @@ static int wm_draw_update_test_window(wmWindow *win)
 
 static int wm_automatic_draw_method(wmWindow *win)
 {
+       /* Ideally all cards would work well with triple buffer, since if it works
+          well gives the least redraws and is considerably faster at partial redraw
+          for sculpting or drawing overlapping menus. For typically lower end cards
+          copy to texture is slow though and so we use overlap instead there. */
+
        if(win->drawmethod == USER_DRAW_AUTOMATIC) {
                /* ATI opensource driver is known to be very slow at this */
                if(GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE))
                        return USER_DRAW_OVERLAP;
+               /* also Intel drivers don't work well with this */
+               else if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY))
+                       return USER_DRAW_OVERLAP;
                /* Windows software driver darkens color on each redraw */
                else if(GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE))
                        return USER_DRAW_OVERLAP_FLIP;
+               /* drawing lower color depth again degrades colors each time */
                else if(GPU_color_depth() < 24)
                        return USER_DRAW_OVERLAP;
                else