[AD] Patch for Intel GPUs on Windows

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I got this netbook with an Intel GMA 3650 GPU. It works with D3D (and OpenGL in fixed pipeline mode) but there are issues when running with OpenGL and shaders. In game #1, stuff just doesn't get drawn without this patch. It will just skip drawing some primitives. In game #2, the first issue is textures < 16x16 get drawn with garbage or only partially drawn. Second issue, from my observation which may be wrong is that somehow drawing commands are getting backed up and cause the system to eventually bluescreen after it gets progressively slower. game #2 is quite extensively tested so I'm 98% confident that it's an issue with these drivers and not my code.

I propose this workaround. I already talked to Paul about it and he doesn't want to include this in the primitives addon, so I'd need to find a way to conditionally call glFlush only on (some?) Intel chips. The second part could be conditional if possible too. The only problem I have is I don't know how to detect if an Intel GPU is being used (the final patch would probably only add these things if PP mode is active.) Patch is attached.

Trent

diff --git a/addons/primitives/prim_opengl.c b/addons/primitives/prim_opengl.c
index 3cc5855..0f0470d 100644
--- a/addons/primitives/prim_opengl.c
+++ b/addons/primitives/prim_opengl.c
@@ -449,6 +449,8 @@ static int draw_prim_raw(ALLEGRO_BITMAP* target, ALLEGRO_BITMAP* texture,
       };
    }
 
+   glFlush();
+
    revert_state(texture);
 
    if (vertex_buffer) {
@@ -535,6 +537,8 @@ static int draw_prim_indexed_raw(ALLEGRO_BITMAP* target, ALLEGRO_BITMAP* texture
       };
    }
 
+   glFlush();
+
    revert_state(texture);
    
    return num_primitives;
diff --git a/src/opengl/ogl_bitmap.c b/src/opengl/ogl_bitmap.c
index ff593bd..36686f0 100644
--- a/src/opengl/ogl_bitmap.c
+++ b/src/opengl/ogl_bitmap.c
@@ -634,10 +634,11 @@ ALLEGRO_BITMAP *_al_ogl_create_bitmap(ALLEGRO_DISPLAY *d, int w, int h)
    }
 
    /* FBOs are 16x16 minimum on iPhone, this is a workaround. (Some Androids too) */
-   if (IS_OPENGLES) {
+   // FIXME
+   //if (IS_OPENGLES) {
       if (true_w < 16) true_w = 16;
       if (true_h < 16) true_h = 16;
-   }
+   //}
 
    /* glReadPixels requires 32 byte aligned rows */
    if (IS_ANDROID) {



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/